From 79dbe7dcdabf13850cf9a4d9b857bdb03bc0666e Mon Sep 17 00:00:00 2001 From: David Jay Date: Wed, 15 Feb 2017 13:05:31 -0500 Subject: [PATCH] Updating commentCount on comment post. --- client/coral-framework/graphql/mutations/index.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/client/coral-framework/graphql/mutations/index.js b/client/coral-framework/graphql/mutations/index.js index fd08e1751..b67343521 100644 --- a/client/coral-framework/graphql/mutations/index.js +++ b/client/coral-framework/graphql/mutations/index.js @@ -38,7 +38,7 @@ export const postComment = graphql(POST_COMMENT, { }, updateQueries: { AssetQuery: (oldData, {mutationResult:{data:{createComment:{comment}}}}) => - + // If posting a reply parent_id ? { ...oldData, @@ -56,6 +56,7 @@ export const postComment = graphql(POST_COMMENT, { ...oldData, asset: { ...oldData.asset, + commentCount: oldData.asset.commentCount + 1, comments: [comment, ...oldData.asset.comments] } }