-
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-rc.12] empty object returned when calling refetch on watchQuery observable with notifyOnNetworkStatusChange and no-cache policy #6584
Comments
Thanks for the detailed issue report! As far as I can tell, you're getting what you asked for: If you don't have any use for the loading state, I would advise against setting In general, redelivering previous data for the sake of providing some data instead of none was a short-sighted hack in Apollo Client 2.x that caused more/worse problems than it solved. The old data doesn't necessarily have anything to do with what will be refetched, so it doesn't make sense to include it in the loading state. See #6566 for a similar (React-related) issue. |
Thanks for the explanation, the reasoning makes sense.
So I believe that data should be Btw, let me know if you'd like me to raise a PR with the fix, I'd be happy to do so? |
If I may be so bold and suggest that updating
I believe it's the first line in the function I don't know what other unintended consequences this change may have but I hope I saved you a couple of precious minutes of investigating the problem, I know how busy you are. |
A lot of the Apollo Client internals have changed since v3 was launched. We recommend trying a more modern version of |
Intended outcome:
Receive loading status with current data object when calling
refetch
onclient.watchQuery
withnotifyOnNetworkStatusChange: true
andfetchPolicy: no-cache
Actual outcome:
After refetch, an empty object is received.
How to reproduce the issue:
Versions
@apollo/client: >=3.0.0-rc.0 => 3.0.0-rc.12
The text was updated successfully, but these errors were encountered: