apollo-client: fetchMore networkStatus and notifyOnNetworkChange not working in 3.3.7
In the latest version (3.3.7) the networkStatus for fetchingMore is not working:
export declare enum NetworkStatus {
loading = 1,
setVariables = 2,
fetchMore = 3,
refetch = 4,
poll = 6,
ready = 7,
error = 8
}
But when calling fetchMore, the networkStatus is never changed to 3 when notifyOnNetworkChange = true…
About this issue
- Original URL
- State: open
- Created 3 years ago
- Reactions: 15
- Comments: 15 (1 by maintainers)
I’m seeing the same issue. I’m using local-only fields in my query and when my local-only fields change, it refetches from the network, but does not update the
loadingandnetworkStatusvariables.Thank you for reply, I set the option
notifyOnNetworkStatusChange: trueinuseQueryand it seemsnetworkStatus != NetworkStatus.readyis reliable now.Also, just wanted to add that I am seeing the same behaviour as mentioned by @alaminut
I’m seeing the same … I’m expecting that if a call to
fetchMoretriggers a network call, then eitherloadingornetworkStatusshould be updated so I can let the user know that data is loading.I have a query setup like this:
Then I have a sort function that gets called when a user wants to change the sorting:
I can see that this triggers a network call, but the
loadingalways remainsfalseandnetworkStatusalways stays at 7.This query is configured to use the
relayStylePaginationfrom@apollo/client/utilities, btw