page.graphql 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221
  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: ["manage:pages", "manage:system"])
  72. delete(
  73. id: Int!
  74. ): DefaultResponse @auth(requires: ["delete:pages", "manage:system"])
  75. flushCache: DefaultResponse @auth(requires: ["manage:system"])
  76. migrateToLocale(
  77. sourceLocale: String!
  78. targetLocale: String!
  79. ): PageMigrationResponse @auth(requires: ["manage:system"])
  80. }
  81. # -----------------------------------------------
  82. # TYPES
  83. # -----------------------------------------------
  84. type PageResponse {
  85. responseResult: ResponseStatus!
  86. page: Page
  87. }
  88. type PageMigrationResponse {
  89. responseResult: ResponseStatus!
  90. count: Int
  91. }
  92. type Page {
  93. id: Int!
  94. path: String!
  95. hash: String!
  96. title: String!
  97. description: String!
  98. isPrivate: Boolean!
  99. isPublished: Boolean!
  100. privateNS: String
  101. publishStartDate: Date!
  102. publishEndDate: String!
  103. tags: [PageTag]!
  104. content: String!
  105. render: String
  106. toc: String
  107. contentType: String!
  108. createdAt: Date!
  109. updatedAt: Date!
  110. editor: String!
  111. locale: String!
  112. authorId: Int!
  113. authorName: String!
  114. authorEmail: String!
  115. creatorId: Int!
  116. creatorName: String!
  117. creatorEmail: String!
  118. }
  119. type PageTag {
  120. id: Int!
  121. tag: String!
  122. title: String
  123. createdAt: Date!
  124. updatedAt: Date!
  125. }
  126. type PageHistory {
  127. versionId: Int!
  128. authorId: Int!
  129. authorName: String!
  130. actionType: String!
  131. valueBefore: String
  132. valueAfter: String
  133. createdAt: Date!
  134. }
  135. type PageHistoryResult {
  136. trail: [PageHistory]
  137. total: Int!
  138. }
  139. type PageSearchResponse {
  140. results: [PageSearchResult]!
  141. suggestions: [String]!
  142. totalHits: Int!
  143. }
  144. type PageSearchResult {
  145. id: String!
  146. title: String!
  147. description: String!
  148. path: String!
  149. locale: String!
  150. }
  151. type PageListItem {
  152. id: Int!
  153. path: String!
  154. locale: String!
  155. title: String
  156. description: String
  157. contentType: String!
  158. isPublished: Boolean!
  159. isPrivate: Boolean!
  160. privateNS: String
  161. createdAt: Date!
  162. updatedAt: Date!
  163. tags: [String]
  164. }
  165. type PageTreeItem {
  166. id: Int!
  167. path: String!
  168. depth: Int!
  169. title: String!
  170. isPrivate: Boolean!
  171. isFolder: Boolean!
  172. privateNS: String
  173. parent: Int
  174. pageId: Int
  175. locale: String!
  176. }
  177. enum PageOrderBy {
  178. CREATED
  179. ID
  180. PATH
  181. TITLE
  182. UPDATED
  183. }
  184. enum PageOrderByDirection {
  185. ASC
  186. DESC
  187. }
  188. enum PageTreeMode {
  189. FOLDERS
  190. PAGES
  191. ALL
  192. }