2
0

page.graphql 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229
  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(
  25. limit: Int
  26. orderBy: PageOrderBy
  27. orderByDirection: PageOrderByDirection
  28. tags: [String!]
  29. locale: String
  30. ): [PageListItem!]! @auth(requires: ["manage:system", "read:pages"])
  31. single(
  32. id: Int!
  33. ): Page @auth(requires: ["manage:pages", "delete:pages", "manage:system"])
  34. tags: [PageTag]! @auth(requires: ["manage:system", "read:pages"])
  35. tree(
  36. parent: Int!
  37. mode: PageTreeMode!
  38. locale: String!
  39. ): [PageTreeItem] @auth(requires: ["manage:system", "read:pages"])
  40. }
  41. # -----------------------------------------------
  42. # MUTATIONS
  43. # -----------------------------------------------
  44. type PageMutation {
  45. create(
  46. content: String!
  47. description: String!
  48. editor: String!
  49. isPublished: Boolean!
  50. isPrivate: Boolean!
  51. locale: String!
  52. path: String!
  53. publishEndDate: Date
  54. publishStartDate: Date
  55. tags: [String]!
  56. title: String!
  57. ): PageResponse @auth(requires: ["write:pages", "manage:pages", "manage:system"])
  58. update(
  59. id: Int!
  60. content: String
  61. description: String
  62. editor: String
  63. isPrivate: Boolean
  64. isPublished: Boolean
  65. locale: String
  66. path: String
  67. publishEndDate: Date
  68. publishStartDate: Date
  69. tags: [String]
  70. title: String
  71. ): PageResponse @auth(requires: ["write:pages", "manage:pages", "manage:system"])
  72. move(
  73. id: Int!
  74. destinationPath: String!
  75. destinationLocale: String!
  76. ): DefaultResponse @auth(requires: ["manage:pages", "manage:system"])
  77. delete(
  78. id: Int!
  79. ): DefaultResponse @auth(requires: ["delete:pages", "manage:system"])
  80. flushCache: DefaultResponse @auth(requires: ["manage:system"])
  81. migrateToLocale(
  82. sourceLocale: String!
  83. targetLocale: String!
  84. ): PageMigrationResponse @auth(requires: ["manage:system"])
  85. rebuildTree: DefaultResponse @auth(requires: ["manage:system"])
  86. }
  87. # -----------------------------------------------
  88. # TYPES
  89. # -----------------------------------------------
  90. type PageResponse {
  91. responseResult: ResponseStatus!
  92. page: Page
  93. }
  94. type PageMigrationResponse {
  95. responseResult: ResponseStatus!
  96. count: Int
  97. }
  98. type Page {
  99. id: Int!
  100. path: String!
  101. hash: String!
  102. title: String!
  103. description: String!
  104. isPrivate: Boolean!
  105. isPublished: Boolean!
  106. privateNS: String
  107. publishStartDate: Date!
  108. publishEndDate: String!
  109. tags: [PageTag]!
  110. content: String!
  111. render: String
  112. toc: String
  113. contentType: String!
  114. createdAt: Date!
  115. updatedAt: Date!
  116. editor: String!
  117. locale: String!
  118. authorId: Int!
  119. authorName: String!
  120. authorEmail: String!
  121. creatorId: Int!
  122. creatorName: String!
  123. creatorEmail: String!
  124. }
  125. type PageTag {
  126. id: Int!
  127. tag: String!
  128. title: String
  129. createdAt: Date!
  130. updatedAt: Date!
  131. }
  132. type PageHistory {
  133. versionId: Int!
  134. authorId: Int!
  135. authorName: String!
  136. actionType: String!
  137. valueBefore: String
  138. valueAfter: String
  139. createdAt: Date!
  140. }
  141. type PageHistoryResult {
  142. trail: [PageHistory]
  143. total: Int!
  144. }
  145. type PageSearchResponse {
  146. results: [PageSearchResult]!
  147. suggestions: [String]!
  148. totalHits: Int!
  149. }
  150. type PageSearchResult {
  151. id: String!
  152. title: String!
  153. description: String!
  154. path: String!
  155. locale: String!
  156. }
  157. type PageListItem {
  158. id: Int!
  159. path: String!
  160. locale: String!
  161. title: String
  162. description: String
  163. contentType: String!
  164. isPublished: Boolean!
  165. isPrivate: Boolean!
  166. privateNS: String
  167. createdAt: Date!
  168. updatedAt: Date!
  169. tags: [String]
  170. }
  171. type PageTreeItem {
  172. id: Int!
  173. path: String!
  174. depth: Int!
  175. title: String!
  176. isPrivate: Boolean!
  177. isFolder: Boolean!
  178. privateNS: String
  179. parent: Int
  180. pageId: Int
  181. locale: String!
  182. }
  183. enum PageOrderBy {
  184. CREATED
  185. ID
  186. PATH
  187. TITLE
  188. UPDATED
  189. }
  190. enum PageOrderByDirection {
  191. ASC
  192. DESC
  193. }
  194. enum PageTreeMode {
  195. FOLDERS
  196. PAGES
  197. ALL
  198. }