Skip to content
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

Fix getCurrentResult() not always returning loading with fetchPolicy no-cache #4685

Merged
merged 3 commits into from
Apr 11, 2019

Conversation

fracmak
Copy link
Contributor

@fracmak fracmak commented Apr 10, 2019

This fixes a bug created by #4352. Basically what changed was an optimization that bypassed querying the cache for no-cache fetchPolicy's and instead returning { data: undefined, partial: false } directly. The problem was that the original code didn't return that. It returned { data: undefined, partial: true } because of how the cache query failed. So in the getCurrentResult() function, the loading check stopped working briefly because queryLoading was only honored if fetchPolicy === 'network-only' and the other path wasn't getting hit anymore. This fixes the bug by expanding the fetchPolicy check to include 'no-cache'

Copy link
Member

@benjamn benjamn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense @fracmak!

@benjamn benjamn merged commit 3fdbf8e into apollographql:master Apr 11, 2019
@fracmak
Copy link
Contributor Author

fracmak commented May 2, 2019

any idea when this will be released?

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 17, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants