page.graphql 4.6 KB

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