Skip to content

feat: support hooking into execute stream (defer/stream) #429

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

Merged
merged 2 commits into from
Jul 17, 2021

Conversation

n1ru4l
Copy link
Collaborator

@n1ru4l n1ru4l commented Jul 16, 2021

This PR is built upon #428 and serves as a POC for hoking into the phases where execute returns an AsyncIterable (which will be introduced as part of the next GraphQL major release for defer/stream support). Today, returning AsyncIterable from execute is already supported by various GraphQL servers such as graphql-helix, graphql-ws and graphql over Socket.io.

Adding this to envelop is a breaking change as the type signature of the ExecuteDone hook changes. The result type is now AsyncIterable<ExecutionResult> | ExecutionResult. Furthermore, the type signature of execute is changed to now return AsyncIterable<ExecutionResult> | ExecutionResult.

@changeset-bot
Copy link

changeset-bot bot commented Jul 16, 2021

🦋 Changeset detected

Latest commit: 75750b1

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

This PR includes changesets to release 1 package
Name Type
@envelop/execute-subscription-event 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

@n1ru4l n1ru4l requested a review from dotansimha July 16, 2021 08:02
@vercel
Copy link

vercel bot commented Jul 16, 2021

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/theguild/envelop/5Y22HkeWLqqyevo22wiFbEY2fea9
✅ Preview: https://envelop-git-execute-stream-hooks-theguild.vercel.app

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants