page.graphql 3.4 KB

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