comment.graphql 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  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. ): DefaultResponse @auth(requires: ["write:comments", "manage:system"])
  34. update(
  35. id: Int!
  36. content: String!
  37. ): DefaultResponse @auth(requires: ["write:comments", "manage:comments", "manage:system"])
  38. }
  39. # -----------------------------------------------
  40. # TYPES
  41. # -----------------------------------------------
  42. type CommentProvider {
  43. isEnabled: Boolean!
  44. key: String!
  45. title: String!
  46. description: String
  47. logo: String
  48. website: String
  49. isAvailable: Boolean
  50. config: [KeyValuePair]
  51. }
  52. input CommentProviderInput {
  53. isEnabled: Boolean!
  54. key: String!
  55. config: [KeyValuePairInput]
  56. }
  57. type CommentPost {
  58. id: Int!
  59. content: String!
  60. render: String!
  61. authorId: Int!
  62. authorName: String!
  63. authorEmail: String! @auth(requires: ["manage:system"])
  64. authorIP: String! @auth(requires: ["manage:system"])
  65. createdAt: Date!
  66. updatedAt: Date!
  67. }