From 5ceda4f2d27359a006b1b19a3021779768632b39 Mon Sep 17 00:00:00 2001 From: Chi Vinh Le Date: Fri, 4 Aug 2017 22:35:26 +0700 Subject: [PATCH] Update my comments after posting --- client/coral-embed-stream/src/graphql/index.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/client/coral-embed-stream/src/graphql/index.js b/client/coral-embed-stream/src/graphql/index.js index a16af23e7..f52cc4e7d 100644 --- a/client/coral-embed-stream/src/graphql/index.js +++ b/client/coral-embed-stream/src/graphql/index.js @@ -73,6 +73,11 @@ const extension = { created_at status replyCount + asset { + id + title + url + } tags { tag { name @@ -190,6 +195,15 @@ const extension = { } return insertCommentIntoEmbedQuery(prev, comment); }, + CoralEmbedStream_Profile: (prev, {mutationResult: {data: {createComment: {comment}}}}) => { + return update(prev, { + me: { + comments: { + nodes: {$unshift: [comment]}, + }, + }, + }); + }, } }), EditComment: () => ({