Fix Apollo cache for timeline view
This commit is contained in:
parent
926aa3de3d
commit
02f04691fe
|
@ -5,10 +5,7 @@ import {
|
||||||
ApolloLink,
|
ApolloLink,
|
||||||
HttpLink,
|
HttpLink,
|
||||||
} from '@apollo/client'
|
} from '@apollo/client'
|
||||||
import {
|
import { getMainDefinition } from '@apollo/client/utilities'
|
||||||
getMainDefinition,
|
|
||||||
offsetLimitPagination,
|
|
||||||
} from '@apollo/client/utilities'
|
|
||||||
import { onError } from '@apollo/client/link/error'
|
import { onError } from '@apollo/client/link/error'
|
||||||
import { WebSocketLink } from '@apollo/client/link/ws'
|
import { WebSocketLink } from '@apollo/client/link/ws'
|
||||||
|
|
||||||
|
@ -129,7 +126,12 @@ const memoryCache = new InMemoryCache({
|
||||||
},
|
},
|
||||||
Query: {
|
Query: {
|
||||||
fields: {
|
fields: {
|
||||||
myTimeline: offsetLimitPagination(['onlyFavorites']),
|
myTimeline: {
|
||||||
|
keyArgs: ['onlyFavorites'],
|
||||||
|
merge(existing = [], incoming) {
|
||||||
|
return [...existing, ...incoming]
|
||||||
|
},
|
||||||
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue