page.graphql 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196
  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. }
  36. # -----------------------------------------------
  37. # MUTATIONS
  38. # -----------------------------------------------
  39. type PageMutation {
  40. create(
  41. content: String!
  42. description: String!
  43. editor: String!
  44. isPublished: Boolean!
  45. isPrivate: Boolean!
  46. locale: String!
  47. path: String!
  48. publishEndDate: Date
  49. publishStartDate: Date
  50. tags: [String]!
  51. title: String!
  52. ): PageResponse @auth(requires: ["write:pages", "manage:pages", "manage:system"])
  53. update(
  54. id: Int!
  55. content: String
  56. description: String
  57. editor: String
  58. isPrivate: Boolean
  59. isPublished: Boolean
  60. locale: String
  61. path: String
  62. publishEndDate: Date
  63. publishStartDate: Date
  64. tags: [String]
  65. title: String
  66. ): PageResponse @auth(requires: ["manage:pages", "manage:system"])
  67. delete(
  68. id: Int!
  69. ): DefaultResponse @auth(requires: ["delete:pages", "manage:system"])
  70. flushCache: DefaultResponse @auth(requires: ["manage:system"])
  71. migrateToLocale(
  72. sourceLocale: String!
  73. targetLocale: String!
  74. ): PageMigrationResponse @auth(requires: ["manage:system"])
  75. }
  76. # -----------------------------------------------
  77. # TYPES
  78. # -----------------------------------------------
  79. type PageResponse {
  80. responseResult: ResponseStatus!
  81. page: Page
  82. }
  83. type PageMigrationResponse {
  84. responseResult: ResponseStatus!
  85. count: Int
  86. }
  87. type Page {
  88. id: Int!
  89. path: String!
  90. hash: String!
  91. title: String!
  92. description: String!
  93. isPrivate: Boolean!
  94. isPublished: Boolean!
  95. privateNS: String
  96. publishStartDate: Date!
  97. publishEndDate: String!
  98. tags: [PageTag]!
  99. content: String!
  100. render: String
  101. toc: String
  102. contentType: String!
  103. createdAt: Date!
  104. updatedAt: Date!
  105. editor: String!
  106. locale: String!
  107. authorId: Int!
  108. authorName: String!
  109. authorEmail: String!
  110. creatorId: Int!
  111. creatorName: String!
  112. creatorEmail: String!
  113. }
  114. type PageTag {
  115. id: Int!
  116. tag: String!
  117. title: String
  118. createdAt: Date!
  119. updatedAt: Date!
  120. }
  121. type PageHistory {
  122. versionId: Int!
  123. authorId: Int!
  124. authorName: String!
  125. actionType: String!
  126. valueBefore: String
  127. valueAfter: String
  128. createdAt: Date!
  129. }
  130. type PageHistoryResult {
  131. trail: [PageHistory]
  132. total: Int!
  133. }
  134. type PageSearchResponse {
  135. results: [PageSearchResult]!
  136. suggestions: [String]!
  137. totalHits: Int!
  138. }
  139. type PageSearchResult {
  140. id: String!
  141. title: String!
  142. description: String!
  143. path: String!
  144. locale: String!
  145. }
  146. type PageListItem {
  147. id: Int!
  148. path: String!
  149. locale: String!
  150. title: String
  151. description: String
  152. contentType: String!
  153. isPublished: Boolean!
  154. isPrivate: Boolean!
  155. privateNS: String
  156. createdAt: Date!
  157. updatedAt: Date!
  158. tags: [String]
  159. }
  160. enum PageOrderBy {
  161. CREATED
  162. ID
  163. PATH
  164. TITLE
  165. UPDATED
  166. }
  167. enum PageOrderByDirection {
  168. ASC
  169. DESC
  170. }