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(core): Support GraphQLRequest.extensions and update subscriptionExchange #3054

Merged
merged 7 commits into from
Mar 15, 2023

Conversation

kitten
Copy link
Member

@kitten kitten commented Mar 15, 2023

Summary

This updates the GraphQLRequest type to contain an extensions field. This field will currently remain unavailable to bindings/UI code, but can be used to interact with spec extensions in exchanges.

Specifically, this enables us to replace persistedFetchExchange with a persitedExchange in the future that only interacts with the rest of the exchange pipeline by modifying Operation.extensions without triggering a fetch request.

The subscriptionExchange has been updated accordingly to receive the entire FetchBody type, to bring it inline with the default fetchExchange and @urql/core/internal utilities.

This is a breaking change as the properties key and context are now missing in the first argument that forwardSubscription receives. To compensate, the exchange now passes the entire Operation as a second argument to forwardSubscription. Generally this shouldn't affect integrations with libraries like graphql-ws.

Set of changes

  • Replace subscriptionExchange's forwardSubscription input with FetchBody and add Operation as a second argument
  • Add GraphQLRequest.extensions and expose it on createRequest

@kitten kitten marked this pull request as ready for review March 15, 2023 18:27
@kitten kitten merged commit de15c14 into main Mar 15, 2023
@kitten kitten deleted the feat/request-extensions branch March 15, 2023 19:10
@github-actions github-actions bot mentioned this pull request Mar 15, 2023
@kitten kitten added the major 🚚 Changes queued for a new major release, which will include breaking changes label 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.

None yet

2 participants