Conversation
|
Some additional context from Apollo Defer: apollographql/apollo-server#2700 |
|
Looking at the Relay test schema |
|
In this branch I created support for @stream: Some checks and optimizations are missing. But the first tests with Relay were positive: |
|
@morrys Thanks for your effort 👍 About the next steps for merging this PR please see my answer in #2319: @morrys @lilianammmatos Can you please review each other PRs and figure out how to collaborate? |
|
@IvanGoncharov yes the two PR add the same functionality. |

Hello to all,
this PR allows to support the @defer directive. Although the implementation is mostly complete, the PR is in draft to discuss it together and evaluate its integration.
In the PR I also created tests and I performed the integration tests with Relay, express-graphql & fetch-multipart-graphql with positive results.
In summary how I implemented defer:
graphql-js/src/execution/execute.js
Lines 663 to 668 in 4226f23
resolverResult: ResultResolvernew property in ExecutionContext which allows the management of the results to be returned at the end of the executionAsyncIterable<Promise<ExecutionResult> | PromiseOrValue<ExecutionResult>;. UsingisAsyncIterable (result)it is possible to distinguish if there are deferred results.this is a slow motion gif of how it works.

Let me know if more information is needed.
Thank you
Lorenzo