Adjusted query/tag flow

This commit is contained in:
Wyatt Johnson
2017-05-09 15:01:01 -06:00
parent b8e530ca1f
commit 2e1bc8d75a
25 changed files with 476 additions and 343 deletions
+5 -6
View File
@@ -1,5 +1,4 @@
const wrapResponse = require('../helpers/response');
const CommentsService = require('../../services/comments');
const RootMutation = {
createComment(_, {comment}, {mutators: {Comment}}) {
@@ -29,12 +28,12 @@ const RootMutation = {
setCommentStatus(_, {id, status}, {mutators: {Comment}}) {
return wrapResponse(null)(Comment.setCommentStatus({id, status}));
},
addCommentTag(_, {id, tag}, {mutators: {Comment}}) {
return wrapResponse('comment')(Comment.addCommentTag({id, tag}).then(() => CommentsService.findById(id)));
},
removeCommentTag(_, {id, tag}, {mutators: {Comment}}) {
return wrapResponse('comment')(Comment.removeCommentTag({id, tag}).then(() => CommentsService.findById(id)));
addCommentTag(_, {id, asset_id, name}, {mutators: {Comment}}) {
return wrapResponse('comment')(Comment.addCommentTag({id, asset_id, name}));
},
removeCommentTag(_, {id, asset_id, name}, {mutators: {Comment}}) {
return wrapResponse('comment')(Comment.removeCommentTag({id, asset_id, name}));
}
};
module.exports = RootMutation;