-
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
Detecting cache-and-network refetch via networkStatus #4693
Comments
This has been an annoyance for me as well, I've gotten around it by checking to see if |
Looks like #3660 |
benjamn
added a commit
that referenced
this issue
Apr 30, 2019
Blindly setting networkStatus to NetworkStatus.loading after the client part of a cache-and-network query was destroying useful information about the status of the request. Instead, we should use NetworkStatus.ready only when the request is complete, and leave networkStatus untouched otherwise. Should fix #1217. Should fix #3660. Should fix #4693.
benjamn
added a commit
that referenced
this issue
Apr 30, 2019
Blindly setting networkStatus to NetworkStatus.loading after the client part of a cache-and-network query was destroying useful information about the status of the request. Instead, we should use NetworkStatus.ready only when the request is complete, and leave networkStatus untouched otherwise. Fixes #3660, #4693, and apollographql/react-apollo#1217.
benjamn
added a commit
that referenced
this issue
Apr 30, 2019
Blindly setting networkStatus to NetworkStatus.loading after the client part of a cache-and-network query was destroying useful information about the status of the request. Instead, we should use NetworkStatus.ready only when the request is complete, and leave networkStatus untouched otherwise. Fixes #3660, #4693, and apollographql/react-apollo#1217.
Closing since we just published the final version of |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
When fetching a query using fetchPolicy
cache-and-network
, refetching it after the first fetch setsloading
as if it was the initial fetch, so i'm trying to usenetworkStatus
to detect a difference between initial fetch and background refetch.Intended outcome:
networkState
is set to different values while request is inflight for initial and background cache updating requests.Actual outcome:
networkState
is1
while fetching and7
or8
when finished - regardless of initial fetch or later background refetch.How to reproduce the issue:
Simple example at https://codesandbox.io/s/24nkjm76q0
If
networkStatus
is not used for this, how do i detect the difference?The text was updated successfully, but these errors were encountered: