Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add networkStatus to the result returned by useSuspenseQuery #10657

Merged
merged 7 commits into from
Mar 17, 2023

Conversation

jerelmiller
Copy link
Member

This PR adds the networkStatus to the result returned by useSuspenseQuery. This allows a user to have more control over the UX when loading data. For example, when using a cache-and-network fetch policy with data in the cache, a result is immediately returned from useSuspenseQuery while a network request is sent in the background. During this time, the networkStatus is reported as loading, which can be helpful if users would like to show some kind of indication that fresh data is being loaded from the server.

Checklist:

  • If this PR contains changes to the library itself (not necessary for e.g. docs updates), please include a changeset (see CONTRIBUTING.md)
  • If this PR is a new feature, please reference an issue where a consensus about the design was reached (not necessary for small changes)
  • Make sure all of the significant new logic is covered by tests

@changeset-bot
Copy link

changeset-bot bot commented Mar 15, 2023

🦋 Changeset detected

Latest commit: aae4088

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@apollo/client Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@alessbell
Copy link
Member

🎉

@jerelmiller jerelmiller merged commit db305a8 into release-3.8 Mar 17, 2023
@jerelmiller jerelmiller deleted the return-networkstatus-from-usesuspensequery branch March 17, 2023 18:24
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 17, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants