page.graphql 3.1 KB

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