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

feat(persisted): Replace persistedFetchExchange with generic persistedExchange #3057

Merged
merged 10 commits into from Mar 16, 2023

Conversation

kitten
Copy link
Member

@kitten kitten commented Mar 15, 2023

Resolves #2988
Resolves #2989

Summary

This change modifies @urql/core/internal to know how to modify FetchBody according to the (Automatic) Persisted Queries specification, leaving out query as needed.

The persistedExchange replaces persistedFetchExchange and hence also now works with third-party transports and the subscriptionExchange.

Types have been added to @urql/core to reflect the extensions.persistedQuery spec, with an added miss?: boolean field, which is set when query must be included again (i.e. when a persisted query "misses", via APQ)

The persistedExchange must hence now be placed in front of the default fetch exchange, and/or in front of a subscriptionExchange that handles queries.

The package has been renamed to @urql/exchange-persisted to reflect this.

Set of changes

  • Rename @urql/exchange-persisted-fetch to @urql/exchange-persisted
  • Add persistedQuery types to extensions on @urql/core
  • Handle omitting query in makeFetchBody
  • Implement persistedExchange replacing persistedFetchExchange with generic retry logic

@kitten kitten marked this pull request as ready for review March 15, 2023 21:32
@kitten
Copy link
Member Author

kitten commented Mar 15, 2023

We'll have to decide what to do with @urql/exchange-multipart-fetch. I reckon, we remove it from the repository after a release. As for @urql/exchange-persisted-fetch, it'll likely just continue to work, as normal, after this is merged and released, so similarly there's no actionable after it's removed when this PR is merged.

@kitten kitten added the major 🚚 Changes queued for a new major release, which will include breaking changes label Mar 16, 2023
@kitten kitten merged commit 7241181 into main Mar 16, 2023
7 checks passed
@kitten kitten deleted the feat/persisted-exchange branch March 16, 2023 17:24
This was referenced Mar 16, 2023
@github-actions github-actions bot mentioned this pull request Mar 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
major 🚚 Changes queued for a new major release, which will include breaking changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

RFC: Support subscriptionExchange API in @urql/exchange-persisted-fetch
2 participants