page.graphql 2.4 KB

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