1
Fork 0

Fix Apollo cache for timeline view

This commit is contained in:
viktorstrate 2021-02-13 16:13:34 +01:00
parent 926aa3de3d
commit 02f04691fe
No known key found for this signature in database
GPG Key ID: 3F855605109C1E8A
1 changed files with 7 additions and 5 deletions

View File

@ -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]
},
},
},
},
},