page.graphql 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  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. }
  25. # -----------------------------------------------
  26. # MUTATIONS
  27. # -----------------------------------------------
  28. type PageMutation {
  29. create(
  30. content: String!
  31. description: String!
  32. editor: String!
  33. isPublished: Boolean!
  34. isPrivate: Boolean!
  35. locale: String!
  36. path: String!
  37. publishEndDate: Date
  38. publishStartDate: Date
  39. tags: [String]!
  40. title: String!
  41. ): PageResponse @auth(requires: ["write:pages", "manage:pages", "manage:system"])
  42. update(
  43. id: Int!
  44. content: String
  45. description: String
  46. editor: String
  47. isPrivate: Boolean
  48. isPublished: Boolean
  49. locale: String
  50. path: String
  51. publishEndDate: Date
  52. publishStartDate: Date
  53. tags: [String]
  54. title: String
  55. ): PageResponse @auth(requires: ["manage:pages", "manage:system"])
  56. delete(
  57. id: Int!
  58. ): DefaultResponse @auth(requires: ["delete:pages", "manage:system"])
  59. }
  60. # -----------------------------------------------
  61. # TYPES
  62. # -----------------------------------------------
  63. type PageResponse {
  64. responseResult: ResponseStatus!
  65. page: Page
  66. }
  67. type Page {
  68. id: Int!
  69. }
  70. type PageHistory {
  71. versionId: Int!
  72. authorId: Int!
  73. authorName: String!
  74. actionType: String!
  75. valueBefore: String
  76. valueAfter: String
  77. createdAt: Date!
  78. }
  79. type PageHistoryResult {
  80. trail: [PageHistory]
  81. total: Int!
  82. }
  83. type PageSearchResponse {
  84. results: [PageSearchResult]!
  85. suggestions: [String]!
  86. totalHits: Int!
  87. }
  88. type PageSearchResult {
  89. id: String!
  90. title: String!
  91. description: String!
  92. path: String!
  93. locale: String!
  94. }