2
0

page.graphql 3.2 KB

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