page.graphql 5.3 KB

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