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

Feature: @stream support #2269

Open
jpvajda opened this issue May 11, 2022 · 2 comments
Open

Feature: @stream support #2269

jpvajda opened this issue May 11, 2022 · 2 comments
Labels
blocked Things that are blocked by other issues feature New addition or enhancement to existing solutions

Comments

@jpvajda
Copy link
Contributor

jpvajda commented May 11, 2022

One of the disadvantages of GraphQL’s request/response model is that the GraphQL response is not returned to clients until the entire request has finished processing. However, not all requested data may be of equal importance, and in some use cases it may be possible for applications to act on a subset of the requested data. An application can speed up its time-to-interactive if the GraphQL server can send the most important data as soon as it’s ready. The new @defer and @stream directives allow GraphQL servers to do exactly that by returning multiple payloads from a single GraphQL response.

Similar to @defer the @stream directive also allows the client to receive data before the entire result is ready. @stream can be used on list fields. Whereas @defer can be used on used on fragment spreads and inline fragments.

References

https://graphql.org/blog/2020-12-08-improving-latency-with-defer-and-stream-directives/

@jpvajda jpvajda added the feature New addition or enhancement to existing solutions label May 11, 2022
@jpvajda jpvajda changed the title Feature @stream support Feature: @stream support May 11, 2022
@calvincestari calvincestari added this to the Release 2.0 milestone May 23, 2022
@john-twigg-ck
Copy link

Is there a separate Issue for @defer support? Is it in progress?

@jpvajda
Copy link
Contributor Author

jpvajda commented Jul 25, 2022

@john-twigg-ck 👋 I just made a separate issue for @defer support in our iOS client. Apollo is currently working on supporting @defer with Apollo Router and our Web and Kotlin Clients and that is something we plan to release soon.

For the iOS client we have some networking layer improvements to make prior to supporting @defer and @stream as part of our 2.0 release. So this client will lag a bit behind in the support for @defer.

I hope that helps clarify.

@jpvajda jpvajda modified the milestone: Release 2.0 Jul 25, 2022
@AnthonyMDev AnthonyMDev added the blocked Things that are blocked by other issues label May 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked Things that are blocked by other issues feature New addition or enhancement to existing solutions
Projects
None yet
Development

No branches or pull requests

4 participants