apollo-client icon indicating copy to clipboard operation
apollo-client copied to clipboard

Loading is false while fetching data

Open gurschitz opened this issue 2 years ago • 4 comments
trafficstars

Issue Description

Hi there!

We are currently on Apollo 3.7.17 and looking into upgrading to latest Apollo (3.8.6 as time of writing). In 3.7.17 we are still experiencing https://github.com/apollographql/apollo-client/issues/10737, where we have the same setup with cache-and-network being the default fetchPolicy. In our case it also happens that we run a query with cache-and-network, then due to the nextFetchPolicy function that we implement, we set the next fetch policy to cache-first (similar to how it is mentioned in the docs). Now while the first query is still running and the cached result is returned, we get back the loading state being false.

This caused us to implement some workarounds, that we also need to think of whenever we add new queries. In the linked issue, there is a comment saying that this issue got inadvertently fixed in 3.8.x.

However, I have found that since 3.8.5, it happens again. Using the original code sandbox from the issue, I can see that it works with 3.8.4 but doesn't work with 3.8.5.

Link to Reproduction

https://codesandbox.io/s/loading-false-while-fetching-forked-45yqz8?file=/src/index.jsx

Reproduction Steps

See the reproduction link above.

gurschitz avatar Oct 27 '23 11:10 gurschitz

Hi @gurschitz 👋🏻 thanks for opening this issue! The team needs to triage this one further but we'll be taking a look soon. Thanks so much for the reproduction case 🙏🏻

bignimbus avatar Nov 02 '23 14:11 bignimbus

This problem is still actual. Any updates?

malinindev avatar Jul 17 '24 07:07 malinindev

Same. Problem is still actual.

norzserge avatar Jul 22 '24 11:07 norzserge

The issue is reproducible

dmitriisurdin avatar Jul 22 '24 12:07 dmitriisurdin