comment.graphql 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. # ===============================================
  2. # COMMENT
  3. # ===============================================
  4. extend type Query {
  5. commentsProviders: [CommentProvider]
  6. comments(
  7. locale: String!
  8. path: String!
  9. ): [CommentPost]!
  10. commentById(
  11. id: Int!
  12. ): CommentPost
  13. }
  14. extend type Mutation {
  15. updateCommentsProviders(
  16. providers: [CommentProviderInput]
  17. ): DefaultResponse
  18. createComment(
  19. pageId: Int!
  20. replyTo: Int
  21. content: String!
  22. guestName: String
  23. guestEmail: String
  24. ): CommentCreateResponse @rateLimit(limit: 1, duration: 15)
  25. updateComment(
  26. id: Int!
  27. content: String!
  28. ): CommentUpdateResponse
  29. deleteComment(
  30. id: Int!
  31. ): DefaultResponse
  32. }
  33. # -----------------------------------------------
  34. # TYPES
  35. # -----------------------------------------------
  36. type CommentProvider {
  37. isEnabled: Boolean
  38. key: String
  39. title: String
  40. description: String
  41. logo: String
  42. website: String
  43. isAvailable: Boolean
  44. config: [KeyValuePair]
  45. }
  46. input CommentProviderInput {
  47. isEnabled: Boolean!
  48. key: String!
  49. config: [KeyValuePairInput]
  50. }
  51. type CommentPost {
  52. id: Int
  53. content: String
  54. render: String
  55. authorId: Int
  56. authorName: String
  57. authorEmail: String
  58. authorIP: String
  59. createdAt: Date
  60. updatedAt: Date
  61. }
  62. type CommentCreateResponse {
  63. operation: Operation
  64. id: Int
  65. }
  66. type CommentUpdateResponse {
  67. operation: Operation
  68. render: String
  69. }