You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
When using InMemoryCache I should be able to access the variables sent in the network query. You can do this correctly on the first query, and when you use refetch, however, when using fetchMore this doesn't work.
// ApolloConfiguration.ts
...
const cache: InMemoryCache = new InMemoryCache({
typePolicies: {
Query: {
fields: {
Foo: {
read(existing, incoming, { variables }) {
console.log(variables.page); // When using `fetchMore` this will show the old variable, not the new variable that was used in the request
// read logic...
},
merge(existing, incoming, { variables }) {
// merge logic...
},
},
},
},
},
});
...
Expected behaviour
I should be able to access the correct and latest variables in the InMemoryCache function when using either refetch and fetchMore.
@MechJosh0 can you confirm just updating apollo-client (respective version with merged #7810) and using refetchWritePolicy fixes this?
It does not seem to in my case, especially since using refetchWritePolicy doesnt seem to change behavior of fetchMore.
Did you find any workaround?
@lucatk Sorry I can't be of any help. I ended up not going that route. I have just tested to see what happens and each time I run a new query it's running the read method for each stored version of the query along with the argument for that. Perhaps it's fixed.
I am using the same versions from the ticket description except for apollo/client which I'm now running at v3.3.12.
I am going to close this ticket as I'm leaning towards the fact that it's been resolved as I'm not having this issue anymore.
Describe the bug
When using InMemoryCache I should be able to access the variables sent in the network query. You can do this correctly on the first query, and when you use
refetch
, however, when usingfetchMore
this doesn't work.To Reproduce
Expected behaviour
I should be able to access the correct and latest variables in the
InMemoryCache
function when using eitherrefetch
andfetchMore
.Versions
vue: 2.6.12
vue-apollo: 4.0.0-alpha.12
apollo-client: 3.2.5
The text was updated successfully, but these errors were encountered: