Ocelot-Social/webapp/graphql/CommentMutations.js
Matt Rider c6203ad8eb Refactor CreateComments functionality
- update apollo cache on successful mutation
- remove global event listener
- avoid refetch Post to update CommentsList
- return comment with its author from resolver
2019-06-24 18:21:52 -03:00

24 lines
423 B
JavaScript

import gql from 'graphql-tag'
export default () => {
return {
CreateComment: gql`
mutation($postId: ID, $content: String!) {
CreateComment(postId: $postId, content: $content) {
id
contentExcerpt
author {
id
slug
name
avatar
}
createdAt
deleted
disabled
}
}
`,
}
}