page.graphql 3.0 KB

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