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): Allow fetch exchange to handle subscriptions #3106

Merged
merged 1 commit into from
Mar 31, 2023

Conversation

kitten
Copy link
Member

@kitten kitten commented Mar 27, 2023

Summary

This is a proposal which allows the fetchExchange to handle subscriptions.
This has been submitted to validate the following two assumptions:

  • OperationContext.fetchSubscriptions & ClientOptions.fetchSubscriptions may or may not be a good idea
  • GraphQL API frameworks like graphql-yoga will be able to handle subscriptions via text/event-stream/multipart/mixed response streams

If these two assumptions are fine, we can go ahead and merge this, I reckon.

Set of changes

  • Add OperationContext.fetchSubscriptions & ClientOptions.fetchSubscriptions
    • Allow fetchExchange to handle subscriptions when enabled
  • Switch Accept header when a subscription is sent

@kitten kitten marked this pull request as ready for review March 31, 2023 14:19
@kitten kitten merged commit 97c8be2 into main Mar 31, 2023
@kitten kitten deleted the feat/fetch-subscriptions-option branch March 31, 2023 14:25
@github-actions github-actions bot mentioned this pull request Mar 31, 2023
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.

None yet

2 participants