page.graphql 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
  1. # ===============================================
  2. # PAGES
  3. # ===============================================
  4. extend type Query {
  5. pages: PageQuery
  6. }
  7. extend type Mutation {
  8. pages: PageMutation
  9. }
  10. # -----------------------------------------------
  11. # QUERIES
  12. # -----------------------------------------------
  13. type PageQuery {
  14. history(
  15. id: Int!
  16. offsetPage: Int
  17. offsetSize: Int
  18. ): PageHistoryResult @auth(requires: ["manage:system", "read:pages"])
  19. search(
  20. query: String!
  21. path: String
  22. locale: String
  23. ): PageSearchResponse! @auth(requires: ["manage:system", "read:pages"])
  24. list: [PageListItem!]! @auth(requires: ["manage:system"])
  25. single(
  26. id: Int!
  27. ): Page @auth(requires: ["manage:pages", "delete:pages", "manage:system"])
  28. }
  29. # -----------------------------------------------
  30. # MUTATIONS
  31. # -----------------------------------------------
  32. type PageMutation {
  33. create(
  34. content: String!
  35. description: String!
  36. editor: String!
  37. isPublished: Boolean!
  38. isPrivate: Boolean!
  39. locale: String!
  40. path: String!
  41. publishEndDate: Date
  42. publishStartDate: Date
  43. tags: [String]!
  44. title: String!
  45. ): PageResponse @auth(requires: ["write:pages", "manage:pages", "manage:system"])
  46. update(
  47. id: Int!
  48. content: String
  49. description: String
  50. editor: String
  51. isPrivate: Boolean
  52. isPublished: Boolean
  53. locale: String
  54. path: String
  55. publishEndDate: Date
  56. publishStartDate: Date
  57. tags: [String]
  58. title: String
  59. ): PageResponse @auth(requires: ["manage:pages", "manage:system"])
  60. delete(
  61. id: Int!
  62. ): DefaultResponse @auth(requires: ["delete:pages", "manage:system"])
  63. }
  64. # -----------------------------------------------
  65. # TYPES
  66. # -----------------------------------------------
  67. type PageResponse {
  68. responseResult: ResponseStatus!
  69. page: Page
  70. }
  71. type Page {
  72. id: Int!
  73. path: String!
  74. hash: String!
  75. title: String!
  76. description: String!
  77. isPrivate: Boolean!
  78. isPublished: Boolean!
  79. privateNS: String
  80. publishStartDate: Date!
  81. publishEndDate: String!
  82. content: String!
  83. render: String
  84. toc: String
  85. contentType: String!
  86. createdAt: Date!
  87. updatedAt: Date!
  88. editor: String!
  89. locale: String!
  90. authorId: Int!
  91. authorName: String!
  92. authorEmail: String!
  93. creatorId: Int!
  94. creatorName: String!
  95. creatorEmail: String!
  96. }
  97. type PageHistory {
  98. versionId: Int!
  99. authorId: Int!
  100. authorName: String!
  101. actionType: String!
  102. valueBefore: String
  103. valueAfter: String
  104. createdAt: Date!
  105. }
  106. type PageHistoryResult {
  107. trail: [PageHistory]
  108. total: Int!
  109. }
  110. type PageSearchResponse {
  111. results: [PageSearchResult]!
  112. suggestions: [String]!
  113. totalHits: Int!
  114. }
  115. type PageSearchResult {
  116. id: String!
  117. title: String!
  118. description: String!
  119. path: String!
  120. locale: String!
  121. }
  122. type PageListItem {
  123. id: Int!
  124. path: String!
  125. locale: String!
  126. title: String
  127. description: String
  128. contentType: String!
  129. isPublished: Boolean!
  130. isPrivate: Boolean!
  131. privateNS: String
  132. createdAt: Date!
  133. updatedAt: Date!
  134. }