-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Reference implementation of defer and stream spec #3659
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
Conversation
✅ Deploy Preview for compassionate-pike-271cb3 ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
|
Hi @robrichard, I'm @github-actions bot happy to help you with this PR 👋 Supported commandsPlease post this commands in separate comments and only one per comment:
|
This comment has been minimized.
This comment has been minimized.
@robrichard The latest changes of this PR are available on NPM as Also you can depend on latest version built from this PR: |
33f0460 to
fc08ed7
Compare
fc08ed7 to
55ac8df
Compare
This comment has been minimized.
This comment has been minimized.
@glasser The latest changes of this PR are available on NPM as Also you can depend on latest version built from this PR: |
|
@robrichard @IvanGoncharov I'm finding the types a bit hard to follow here. So However, ExecutionResult itself has AsyncExecutionResult can be ExecutionResult or SubsequentExecutionResult. The difference is that only ExecutionResult has But I don't get why I also don't get why This would make a lot more sense to me if there was the "non incremental delivery" return value that only has data/errors/extensions at the top level, and the "incremental delivery" return value that only has data/errors/extensions nested inside "incremental". Am I missing something? I'll take a look at the source too to see if that helps me understand it better. EDITED FOLLOWUP OK, it looks like the reason that all the fields of AsyncExecutionResult are also on ExecutionResult is related to the use of flattenAsyncIterable in mapSourceToResponse, a subscription-specific function that I don't really understand. This seems like it ought to hopefully be avoidable? |
|
I tried to simplify the types as described above. #3703 is what I came up with. A lot of the complexity comes from the |
|
Having tried to implement consuming in Apollo Server, I'm increasingly convinced that (assuming we don't want the first message to have an |
55ac8df to
172c853
Compare
172c853 to
feb203a
Compare
# Conflicts: # src/execution/execute.ts # src/validation/index.d.ts # src/validation/index.ts
ca151c7 to
ee0ea6c
Compare
|
@robrichard is the new |
|
@michaelstaib yes |
|
Ah, overlooked this one. Thanks for pointing this one out. |
|
@robrichard - I know this was a while ago but is it correct that Update: https://github.com/graphql/graphql-js/blob/main/website/docs/tutorials/defer-stream.md |
Extracted from initial defer/stream PR graphql#3659 Co-authored-by: Liliana Matos <liliana@1stdibs.com> Co-authored-by: David Glasser <glasser@davidglasser.net>
Extracted from initial defer/stream PR graphql#3659 Co-authored-by: Liliana Matos <liliana@1stdibs.com> Co-authored-by: David Glasser <glasser@davidglasser.net>
Extracted from initial defer/stream PR graphql#3659 Co-authored-by: Liliana Matos <liliana@1stdibs.com> Co-authored-by: David Glasser <glasser@davidglasser.net>
Extracted from initial defer/stream PR graphql#3659 Co-authored-by: Liliana Matos <liliana@1stdibs.com> Co-authored-by: David Glasser <glasser@davidglasser.net>
Extracted from initial defer/stream PR graphql#3659 Co-authored-by: Liliana Matos <liliana@1stdibs.com> Co-authored-by: David Glasser <glasser@davidglasser.net>
Extracted from initial defer/stream PR graphql#3659 Co-authored-by: Liliana Matos <liliana@1stdibs.com> Co-authored-by: David Glasser <glasser@davidglasser.net>
Extracted from initial defer/stream PR graphql#3659 Co-authored-by: Liliana Matos <liliana@1stdibs.com> Co-authored-by: David Glasser <glasser@davidglasser.net>
Extracted from initial defer/stream PR graphql#3659 Co-authored-by: Liliana Matos <liliana@1stdibs.com> Co-authored-by: David Glasser <glasser@davidglasser.net>
Extracted from initial defer/stream PR graphql#3659 Co-authored-by: Liliana Matos <liliana@1stdibs.com> Co-authored-by: David Glasser <glasser@davidglasser.net>
Extracted from initial defer/stream PR #3659 Co-authored-by: Liliana Matos <liliana@1stdibs.com> Co-authored-by: David Glasser <glasser@davidglasser.net>
Extracted from initial defer/stream PR #3659 Co-authored-by: Liliana Matos <liliana@1stdibs.com> Co-authored-by: David Glasser <glasser@davidglasser.net>
Continued from #2839
This is the reference impementation of the defer/stream spec proposal. The corresponding PR for spec changes are here: graphql/graphql-spec#742
Please limit comments on this PR to code review of this implementation. Discussion on the defer/stream spec is located in a dedicated repo: https://github.com/robrichard/defer-stream-wg/discussions