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

(core) - Add staleWhileRevalidate option to ssrExchange #1852

Merged
merged 3 commits into from
Aug 11, 2021
Merged

Conversation

kitten
Copy link
Member

@kitten kitten commented Aug 11, 2021

Resolve #1846

Summary

This adds a staleWhileRevalidate option to both the ssrExchange and next-urql's withUrqlClient, which allows the ssrExchange to mark a result as stale while it forcefully refetches a new server result. This is similar but different to cache-and-network as we wouldn't recommend changing the request policy on every operation by default, which would also be ineffective as the ssrExchange "imitates" full network results.

Set of changes

  • Add staleWhileRevalidate to ssrExchange in @urql/core
  • Add staleWhileRevalidate to withUrqlClient in next-urql

@changeset-bot
Copy link

changeset-bot bot commented Aug 11, 2021

🦋 Changeset detected

Latest commit: 15d856e

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

This PR includes changesets to release 2 packages
Name Type
next-urql Minor
@urql/core Minor

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

@kitten kitten changed the title Feat/ssr swr (core) - Add staleWhileRevalidate option to ssrExchange Aug 11, 2021
…1853)

* add docs about staleWhileRevalidate

* Apply suggestions from code review

Co-authored-by: Phil Pluckthun <phil@kitten.sh>

* Apply suggestions from code review

Co-authored-by: Phil Pluckthun <phil@kitten.sh>

Co-authored-by: Phil Pluckthun <phil@kitten.sh>
@kitten kitten merged commit f77b46a into main Aug 11, 2021
@kitten kitten deleted the feat/ssr-swr branch August 11, 2021 18:10
@urql-ci urql-ci mentioned this pull request Aug 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants