From b4e8648177b15a0ba408f9203dac35e5bd481716 Mon Sep 17 00:00:00 2001 From: Chi Vinh Le Date: Mon, 10 Apr 2017 21:13:48 +0700 Subject: [PATCH] Adjust fetchMore for apollo 1.0 --- client/coral-framework/graphql/queries/index.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/client/coral-framework/graphql/queries/index.js b/client/coral-framework/graphql/queries/index.js index ec0dcc336..32bdfb6c9 100644 --- a/client/coral-framework/graphql/queries/index.js +++ b/client/coral-framework/graphql/queries/index.js @@ -30,13 +30,13 @@ export const getCounts = (data) => ({asset_id, limit, sort}) => { limit, sort }, - updateQuery: (oldData, {fetchMoreResult:{data}}) => { + updateQuery: (oldData, {fetchMoreResult:{asset}}) => { return { ...oldData, asset: { ...oldData.asset, - commentCount: data.asset.commentCount + commentCount: asset.commentCount } }; } @@ -54,8 +54,7 @@ export const loadMore = (data) => ({limit, cursor, parent_id = null, asset_id, s asset_id, // the id of the asset we're currently on sort // CHRONOLOGICAL or REVERSE_CHRONOLOGICAL }, - updateQuery: (oldData, {fetchMoreResult:{data:{new_top_level_comments}}}) => { - + updateQuery: (oldData, {fetchMoreResult:{new_top_level_comments}}) => { let updatedAsset; if (!isNil(oldData.comment)) { // loaded replies on a highlighted (permalinked) comment