You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

98 lines
2.2 KiB

  1. # ===============================================
  2. # COMMENT
  3. # ===============================================
  4. extend type Query {
  5. comments: CommentQuery
  6. }
  7. extend type Mutation {
  8. comments: CommentMutation
  9. }
  10. # -----------------------------------------------
  11. # QUERIES
  12. # -----------------------------------------------
  13. type CommentQuery {
  14. providers: [CommentProvider] @auth(requires: ["manage:system"])
  15. list(
  16. locale: String!
  17. path: String!
  18. ): [CommentPost]! @auth(requires: ["read:comments", "manage:system"])
  19. single(
  20. id: Int!
  21. ): CommentPost @auth(requires: ["read:comments", "manage:system"])
  22. }
  23. # -----------------------------------------------
  24. # MUTATIONS
  25. # -----------------------------------------------
  26. type CommentMutation {
  27. updateProviders(
  28. providers: [CommentProviderInput]
  29. ): DefaultResponse @auth(requires: ["manage:system"])
  30. create(
  31. pageId: Int!
  32. replyTo: Int
  33. content: String!
  34. guestName: String
  35. guestEmail: String
  36. ): CommentCreateResponse @auth(requires: ["write:comments", "manage:system"]) @rateLimit(limit: 1, duration: 15)
  37. update(
  38. id: Int!
  39. content: String!
  40. ): CommentUpdateResponse @auth(requires: ["write:comments", "manage:comments", "manage:system"])
  41. delete(
  42. id: Int!
  43. ): DefaultResponse @auth(requires: ["manage:comments", "manage:system"])
  44. }
  45. # -----------------------------------------------
  46. # TYPES
  47. # -----------------------------------------------
  48. type CommentProvider {
  49. isEnabled: Boolean!
  50. key: String!
  51. title: String!
  52. description: String
  53. logo: String
  54. website: String
  55. isAvailable: Boolean
  56. config: [KeyValuePair]
  57. }
  58. input CommentProviderInput {
  59. isEnabled: Boolean!
  60. key: String!
  61. config: [KeyValuePairInput]
  62. }
  63. type CommentPost {
  64. id: Int!
  65. content: String! @auth(requires: ["write:comments", "manage:comments", "manage:system"])
  66. render: String!
  67. authorId: Int!
  68. authorName: String!
  69. authorEmail: String! @auth(requires: ["manage:system"])
  70. authorIP: String! @auth(requires: ["manage:system"])
  71. createdAt: Date!
  72. updatedAt: Date!
  73. }
  74. type CommentCreateResponse {
  75. responseResult: ResponseStatus
  76. id: Int
  77. }
  78. type CommentUpdateResponse {
  79. responseResult: ResponseStatus
  80. render: String
  81. }