question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Missing networkStatus for "cache ready and loading from network"

See original GitHub issue

Intended outcome: When I use fetchPolicy: 'cache-and-network' I can’t know if the data is loaded from cache or if it’s the first time the component load.

Actual outcome: networkStatus should be equal to 1 when the components loads without cache and it should be 5 if its fetching from network but has the data from cache.

How to reproduce the issue: Use fetchPolicy: 'cache-and-network' and console.log(this.props.data.networkStatus)

Actually I’m using Object.keys(this.props.data).length === 10 to check, true if there is no data.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:3
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
rtymchykcommented, Mar 28, 2018

Has there been any development on this? When using cache-and-network, the network status is always 1, regardless of what’s triggering it.

0reactions
helfercommented, May 3, 2017

Closing this for lack of activity. In a future API version, I think it would be great to expose this as source on the result.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Queries - Apollo GraphQL Docs
When loading is false and there is no error , the query has completed. ... To see this caching in action, let's build...
Read more >
Benjie on Twitter: "Ooo! And it's got a `loaded` prop! The lack of this ...
Missing networkStatus for "cache ready and loading from network " · Issue ... if the data is loaded from cache or if it's...
Read more >
How to use the apollo-client.NetworkStatus.ready function in ...
To help you get started, we've selected a few apollo-client.NetworkStatus.ready examples, based on popular ways it is used in public projects.
Read more >
What does notifyOnNetworkStatusChange do exactly?
It seems like notifyOnNetworkStatusChange: true is to allow us check the current networkStatus of your useQuery , which is a number.
Read more >
Netlogon event ID 5719 or Group Policy event 1129
In Windows 10 and later versions, event 5719 is no longer logged in this ... The Netlogon service starts before the network is...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found