Closed timkendrick closed 2 years ago
@timkendrick can you re-rest with @apollo/client@3.0.0-beta.50
and let us know if this is still an issue?
Have the same bug for apollo-client v 2.6.10
same bug here with @apollo/client@3.1.3, but worked for us in apollo-client@2.6.10 - or at least didn't mess up the cache because the merge behaviour was different.
Marking this is as needs-reproduction
since I see this might still be an issue. If so, a runnable reproduction will go a long away in helping us resolve this. You can use either this repo or this CodeSandbox to reproduce the issue.
Have the same issue with apollo 3.3.8 - on every poll interval with "no-cache" policy query enters cache read/merge functions. https://codesandbox.io/s/stoic-star-0g4ms?file=/src/App.js here you can see that it adds object to no cached data, and this is my usage in app, basically i need to have same query with different parameters one query for one part of data and second query for second part of data, one is with infinite scroll configured so it needs to be cached, but from the same query with unread
variable i want to read also unreadCount data which i am polling.
This still happens in apollo/client v3.5.8
@jcreighton @hwillson I think this might be the problematic line in the code: https://github.com/apollographql/apollo-client/blob/main/src/core/ObservableQuery.ts#L637
It always uses network-only
for polling.
I think the logic from refetch
could be used instead, see here https://github.com/apollographql/apollo-client/blob/main/src/core/ObservableQuery.ts#L327
This issue might be related to what was reported in #9691
Commenting to say this should be resolved in https://github.com/apollographql/apollo-client/pull/10020! Please let us know if this issue is still cropping up after our next release.
All the best, Emmanuel, Intern :-)
Currently, when executing a
watchQuery
with apollInterval
and thefetchPolicy: 'no-cache'
option, the caching option is overridden internally within Apollo tonetwork-only
, causing data to be written to the cache despite theno-cache
fetch policy.Intended outcome:
Actual outcome: The cache
.write()
method is called with the results of the queryHow to reproduce the issue: See 'Intended outcome' section
Versions