-
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
[3.0.0-beta.27] Querying data that is already in the cache sets loading to true #5869
Comments
added details from original issue if it helps get more traction on the issue. For now, the mitigation is to stop relying on |
I think it's the same issue described in #5835, where queries resolved with data have loading state during SSR (and subsequent first render on the client when the page hydrates). |
Still an issue on For a component containing a single useQuery hook with fetchPolicy: The component renders for the first time, the loading prop is Seems like this component should only render once, with |
Same here. I also tested this on beta-35, and there the issue is still occurring. |
Tried on 3.0.0-beta.44, still occurring |
can also reproduce with
|
Any progress on this? |
can also reproduce with
|
seems still be the case with the final version of @apollo/client ! |
I've verified this is no longer an issue with |
When using |
This is a repeat of issue #5757 created by @od1k about this a few weeks back and marked as fixed in beta.23: unfortunately, it's still reproing in beta.27.
I've updated @od1k's original repro to beta.27 and published it as a code sandbox here for easier debugging.
The repro code, in essence, first fetches all data in
ALL_DATA_QUERY
and then fetches a subset inCLOCK_SPEED_QUERY
. The expected behavior is that the second query (triggered when the button is clicked) only renders once withloading: false
, but it actually renders twice (see console log).The text was updated successfully, but these errors were encountered: