From 02f04691fe55fa67e2bd084baa1857a0ff94606a Mon Sep 17 00:00:00 2001 From: viktorstrate Date: Sat, 13 Feb 2021 16:13:34 +0100 Subject: [PATCH] Fix Apollo cache for timeline view --- ui/src/apolloClient.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/ui/src/apolloClient.js b/ui/src/apolloClient.js index be9fb688..6fca4587 100644 --- a/ui/src/apolloClient.js +++ b/ui/src/apolloClient.js @@ -5,10 +5,7 @@ import { ApolloLink, HttpLink, } from '@apollo/client' -import { - getMainDefinition, - offsetLimitPagination, -} from '@apollo/client/utilities' +import { getMainDefinition } from '@apollo/client/utilities' import { onError } from '@apollo/client/link/error' import { WebSocketLink } from '@apollo/client/link/ws' @@ -129,7 +126,12 @@ const memoryCache = new InMemoryCache({ }, Query: { fields: { - myTimeline: offsetLimitPagination(['onlyFavorites']), + myTimeline: { + keyArgs: ['onlyFavorites'], + merge(existing = [], incoming) { + return [...existing, ...incoming] + }, + }, }, }, },