comment.graphql 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  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. pageId: Int!
  17. ): [CommentPost]! @auth(requires: ["read:comments", "manage:system"])
  18. single(
  19. id: Int!
  20. ): CommentPost @auth(requires: ["read:comments", "manage:system"])
  21. }
  22. # -----------------------------------------------
  23. # MUTATIONS
  24. # -----------------------------------------------
  25. type CommentMutation {
  26. updateProviders(
  27. providers: [CommentProviderInput]
  28. ): DefaultResponse @auth(requires: ["manage:system"])
  29. create(
  30. pageId: Int!
  31. replyTo: Int
  32. content: String!
  33. guestName: String
  34. guestEmail: String
  35. ): DefaultResponse @auth(requires: ["write:comments", "manage:system"])
  36. update(
  37. id: Int!
  38. content: String!
  39. ): DefaultResponse @auth(requires: ["write:comments", "manage:comments", "manage:system"])
  40. delete(
  41. id: Int!
  42. ): DefaultResponse @auth(requires: ["manage:comments", "manage:system"])
  43. }
  44. # -----------------------------------------------
  45. # TYPES
  46. # -----------------------------------------------
  47. type CommentProvider {
  48. isEnabled: Boolean!
  49. key: String!
  50. title: String!
  51. description: String
  52. logo: String
  53. website: String
  54. isAvailable: Boolean
  55. config: [KeyValuePair]
  56. }
  57. input CommentProviderInput {
  58. isEnabled: Boolean!
  59. key: String!
  60. config: [KeyValuePairInput]
  61. }
  62. type CommentPost {
  63. id: Int!
  64. content: String!
  65. render: String!
  66. authorId: Int!
  67. authorName: String!
  68. authorEmail: String! @auth(requires: ["manage:system"])
  69. authorIP: String! @auth(requires: ["manage:system"])
  70. createdAt: Date!
  71. updatedAt: Date!
  72. }