-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
QueryResult.fetchMore() triggers unexpected refetch of indirectly related "cache-and-network" queries #7939
Comments
Maybe related to #6916 |
@Akryum Definitely somewhat related. I actually had noticed that issue too but with so many things going wrong I didn't document them all. I'm able to work around that issue by adding |
I can observe that as well in 3.4.16, this is unfortunate. |
Spent 48 hours trying to understand why after executing Using v3.5.5 |
This does sound like the same issue as #6916—see my thoughts in #6916 (comment). The central idea is that complete cache results (broadcast after a successful I am actively working on that issue for v3.6. Unfortunately there are a number of test differences to work through, and those disruptions (even if they're ultimately improvements, like fewer network requests) needed more intensive beta testing than we thought we could get before v3.5 was released. I'm still hopeful it will be safe for a minor release (rather than AC4). Closing this as a duplicate (please join the discussion in #6916), but happy to reopen if my planned changes don't (seem like they will) solve the whole problem here as well. |
thank you @benjamn |
Intended outcome:
When I call
query.fetchMore()
I expect this to never affect other queries or cause the other queries to be refetched.Actual outcome:
When I call
query.fetchMore()
it sometimes causes a refetch of some "cache-and-network" query on the page.It seems to happen when both queries (the one for which we call
query.fetchMore()
and the one that usesfetchPolicy: "cache-and-network"
) request data inside a common object type (e.g.__typename: "User"
).How to reproduce the issue:
query.fetchMore()
is used on a query that shares data with other queries shown on-screenfetchPolicy
for the other queries to "cache-and-network"query.fetchMore()
in the appVersions
@apollo/client v3.3.13
The text was updated successfully, but these errors were encountered: