page.graphql 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242
  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. }
  92. # -----------------------------------------------
  93. # TYPES
  94. # -----------------------------------------------
  95. type PageResponse {
  96. responseResult: ResponseStatus!
  97. page: Page
  98. }
  99. type PageMigrationResponse {
  100. responseResult: ResponseStatus!
  101. count: Int
  102. }
  103. type Page {
  104. id: Int!
  105. path: String!
  106. hash: String!
  107. title: String!
  108. description: String!
  109. isPrivate: Boolean!
  110. isPublished: Boolean!
  111. privateNS: String
  112. publishStartDate: Date!
  113. publishEndDate: String!
  114. tags: [PageTag]!
  115. content: String!
  116. render: String
  117. toc: String
  118. contentType: String!
  119. createdAt: Date!
  120. updatedAt: Date!
  121. editor: String!
  122. locale: String!
  123. authorId: Int!
  124. authorName: String!
  125. authorEmail: String!
  126. creatorId: Int!
  127. creatorName: String!
  128. creatorEmail: String!
  129. }
  130. type PageTag {
  131. id: Int!
  132. tag: String!
  133. title: String
  134. createdAt: Date!
  135. updatedAt: Date!
  136. }
  137. type PageHistory {
  138. versionId: Int!
  139. authorId: Int!
  140. authorName: String!
  141. actionType: String!
  142. valueBefore: String
  143. valueAfter: String
  144. createdAt: Date!
  145. }
  146. type PageHistoryResult {
  147. trail: [PageHistory]
  148. total: Int!
  149. }
  150. type PageSearchResponse {
  151. results: [PageSearchResult]!
  152. suggestions: [String]!
  153. totalHits: Int!
  154. }
  155. type PageSearchResult {
  156. id: String!
  157. title: String!
  158. description: String!
  159. path: String!
  160. locale: String!
  161. }
  162. type PageListItem {
  163. id: Int!
  164. path: String!
  165. locale: String!
  166. title: String
  167. description: String
  168. contentType: String!
  169. isPublished: Boolean!
  170. isPrivate: Boolean!
  171. privateNS: String
  172. createdAt: Date!
  173. updatedAt: Date!
  174. tags: [String]
  175. }
  176. type PageTreeItem {
  177. id: Int!
  178. path: String!
  179. depth: Int!
  180. title: String!
  181. isPrivate: Boolean!
  182. isFolder: Boolean!
  183. privateNS: String
  184. parent: Int
  185. pageId: Int
  186. locale: String!
  187. }
  188. type PageLinkItem {
  189. id: Int!
  190. path: String!
  191. title: String!
  192. links: [String]!
  193. }
  194. enum PageOrderBy {
  195. CREATED
  196. ID
  197. PATH
  198. TITLE
  199. UPDATED
  200. }
  201. enum PageOrderByDirection {
  202. ASC
  203. DESC
  204. }
  205. enum PageTreeMode {
  206. FOLDERS
  207. PAGES
  208. ALL
  209. }