diff --git a/client/coral-admin/src/graphql/queries/index.js b/client/coral-admin/src/graphql/queries/index.js index 64bf096ba..7b6985cba 100644 --- a/client/coral-admin/src/graphql/queries/index.js +++ b/client/coral-admin/src/graphql/queries/index.js @@ -63,13 +63,21 @@ export const loadMore = (fetchMore) => ({limit, cursor, sort, tab, asset_id}) => asset_id }, updateQuery: (oldData, {fetchMoreResult:{comments}}) => { - return { + const updatedData = { ...oldData, [tab]: [ ...oldData[tab], ...comments ] }; + + // if we're not in the all tab, put the new comments in there anyway + // this way the acceptComment and rejectComment mutations don't break + if (tab !== 'all') { + updatedData.all = [...updatedData.all, ...comments]; + } + + return updatedData; } }); };