You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
@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.
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/
The text was updated successfully, but these errors were encountered: