Closed twittwer closed 4 years ago
@twittwer Can you try setting notifyOnNetworkStatusChange: true
in the options (along with fetchPolicy
and nextFetchPolicy
)?
Although loading states are desirable in many cases, refetching a query without rendering an intermediate loading state is also a pretty common desire, so notifyOnNetworkStatusChange
allows you to select your desired loading state behavior.
I already tried the flag but probably I had some other faulty configuration back then Now it seems to work as expected - Thanks 👍
Intended outcome:
I was expecting that
ObservableQuery.refetch
always triggers a network request to ensure a real refetch. This seems to be achieved here: https://github.com/apollographql/apollo-client/blob/481b30d5f90132d60ac479ce23ab4fd61acb3db5/src/core/ObservableQuery.ts#L231-L240In this process I would like to inform the user about the loading state. Therefore, I assumed
loading
&networkStatus
would be updated.Actual outcome:
In case of
{ fetchPolicy: 'cache-and-network', nextFetchPolicy: 'cache-first' }
(related to issue 6760) a network request is made, but the loading flag never became true.Is this in intended? Can it be changed/workaround in any way?
Versions