Subscribe to comments

This commit is contained in:
Chi Vinh Le
2017-06-05 20:51:08 +07:00
parent 3c96b7eb1e
commit 6b0cdae183
18 changed files with 418 additions and 217 deletions
+6
View File
@@ -340,6 +340,12 @@ const edit = async (context, {id, asset_id, edit: {body}}) => {
// Execute the edit.
const comment = await CommentsService.edit(id, context.user.id, {body, status});
if (context.pubsub) {
// Publish the edited comment via the subscription.
context.pubsub.publish('commentEdited', comment);
}
return comment;
};