From 0e0c3f19aa623e1fa0a54daecf82f4390b55a73c Mon Sep 17 00:00:00 2001 From: Wyatt Johnson Date: Thu, 23 Mar 2017 11:11:57 -0600 Subject: [PATCH] Fixed tests --- graph/mutators/comment.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/graph/mutators/comment.js b/graph/mutators/comment.js index 97504883e..c1aa0773f 100644 --- a/graph/mutators/comment.js +++ b/graph/mutators/comment.js @@ -45,8 +45,11 @@ const createComment = ({user, loaders: {Comments}, pubsub}, {body, asset_id, par } Comments.countByAssetID.incr(asset_id); - // Publish the newly added comment via the subscription. - pubsub.publish('commentAdded', comment); + if (pubsub) { + + // Publish the newly added comment via the subscription. + pubsub.publish('commentAdded', comment); + } } return comment;