page.graphql 4.7 KB

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