2016-11-07 11:47:33 +09:00
|
|
|
import Telescope, { newMutation, editMutation, removeMutation } from 'meteor/nova:lib';
|
2016-11-05 18:37:46 +09:00
|
|
|
import Comments from './collection.js'
|
|
|
|
import Users from 'meteor/nova:users';
|
|
|
|
import Events from "meteor/nova:events";
|
|
|
|
|
2016-11-07 11:47:33 +09:00
|
|
|
// Resolvers
|
2016-11-05 18:37:46 +09:00
|
|
|
Comments.mutations = {
|
|
|
|
|
|
|
|
commentsNew(root, {comment}, context) {
|
2016-11-07 11:47:33 +09:00
|
|
|
return newMutation(context.Comments, comment, context.currentUser);
|
2016-11-05 18:37:46 +09:00
|
|
|
},
|
|
|
|
|
|
|
|
commentsEdit(root, {commentId, set, unset}, context) {
|
2016-11-07 11:47:33 +09:00
|
|
|
return editMutation(context.Comments, commentId, set, unset, context.currentUser);
|
|
|
|
},
|
2016-11-05 18:37:46 +09:00
|
|
|
|
2016-11-07 11:47:33 +09:00
|
|
|
commentsRemove(root, {commentId}, context) {
|
|
|
|
return removeMutation(context.Comments, commentId, context.currentUser);
|
2016-11-05 18:37:46 +09:00
|
|
|
},
|
|
|
|
|
|
|
|
commentsVote(root, {commentId, voteType}, context) {
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
};
|
|
|
|
|
2016-11-07 11:47:33 +09:00
|
|
|
// GraphQL mutations
|
|
|
|
Telescope.graphQL.addMutation('commentsNew(comment: CommentInput) : Comment');
|
|
|
|
Telescope.graphQL.addMutation('commentsEdit(commentId: String, set: CommentInput, unset: CommentUnsetModifier) : Comment');
|
|
|
|
Telescope.graphQL.addMutation('commentsRemove(commentId: String) : Comment');
|
|
|
|
Telescope.graphQL.addMutation('commentsVote(commentId: String, voteType: String) : Comment');
|
|
|
|
|
2016-11-05 18:37:46 +09:00
|
|
|
export default Comments.mutations;
|