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
loading
andnetworkStatus
variables.Thank you for reply, I set the option
notifyOnNetworkStatusChange: true
inuseQuery
and it seemsnetworkStatus != NetworkStatus.ready
is 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
fetchMore
triggers a network call, then eitherloading
ornetworkStatus
should 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
loading
always remainsfalse
andnetworkStatus
always stays at 7.This query is configured to use the
relayStylePagination
from@apollo/client/utilities
, btw