page.graphql 3.6 KB

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