page.graphql 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  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. ): DefaultResponse @auth(requires: ["manage:system"])
  68. }
  69. # -----------------------------------------------
  70. # TYPES
  71. # -----------------------------------------------
  72. type PageResponse {
  73. responseResult: ResponseStatus!
  74. page: Page
  75. }
  76. type Page {
  77. id: Int!
  78. path: String!
  79. hash: String!
  80. title: String!
  81. description: String!
  82. isPrivate: Boolean!
  83. isPublished: Boolean!
  84. privateNS: String
  85. publishStartDate: Date!
  86. publishEndDate: String!
  87. content: String!
  88. render: String
  89. toc: String
  90. contentType: String!
  91. createdAt: Date!
  92. updatedAt: Date!
  93. editor: String!
  94. locale: String!
  95. authorId: Int!
  96. authorName: String!
  97. authorEmail: String!
  98. creatorId: Int!
  99. creatorName: String!
  100. creatorEmail: String!
  101. }
  102. type PageHistory {
  103. versionId: Int!
  104. authorId: Int!
  105. authorName: String!
  106. actionType: String!
  107. valueBefore: String
  108. valueAfter: String
  109. createdAt: Date!
  110. }
  111. type PageHistoryResult {
  112. trail: [PageHistory]
  113. total: Int!
  114. }
  115. type PageSearchResponse {
  116. results: [PageSearchResult]!
  117. suggestions: [String]!
  118. totalHits: Int!
  119. }
  120. type PageSearchResult {
  121. id: String!
  122. title: String!
  123. description: String!
  124. path: String!
  125. locale: String!
  126. }
  127. type PageListItem {
  128. id: Int!
  129. path: String!
  130. locale: String!
  131. title: String
  132. description: String
  133. contentType: String!
  134. isPublished: Boolean!
  135. isPrivate: Boolean!
  136. privateNS: String
  137. createdAt: Date!
  138. updatedAt: Date!
  139. }