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
Is your feature request related to a problem? Please describe.
I'd like to issue 1 request and get back important data, but then have the less important data sent later, or have some parts streamed as they change (like a "like" count).
Describe the solution you'd like
The GraphQL spec is being updated to describe 2 directives: @defer and @stream that were made exactly to solve the problem as described above: graphql/graphql-spec#742 This is different from subscriptions, and it can use http 1.1 chunked encoding without websockets to accomplish this goal as described here: https://youtu.be/icv_Pq06aOY?t=788
Describe alternatives you've considered
Subscriptions are an alternative, however, that requires a second request.
Related to the implementation of @defer and @stream, it looks like @skip and @include have inlined logic at the moment, and I'm curious if there are any thoughts around having a way to provide resolvers for directives.
This could bring a few benefits:
An established method to add new directives (which would make it easier to add future directives, including @defer and @stream)
Specific location(s) for directive resolvers to live (if desired)
An easy way to declare custom directives on types would be really helpful! I was looking into a way to implement @fetchable for some object, and I don't believe there is currently a way to add custom directives at the type level.
Is your feature request related to a problem? Please describe.
I'd like to issue 1 request and get back important data, but then have the less important data sent later, or have some parts streamed as they change (like a "like" count).
Describe the solution you'd like
The GraphQL spec is being updated to describe 2 directives: @defer and @stream that were made exactly to solve the problem as described above: graphql/graphql-spec#742 This is different from subscriptions, and it can use http 1.1 chunked encoding without websockets to accomplish this goal as described here: https://youtu.be/icv_Pq06aOY?t=788
Describe alternatives you've considered
Subscriptions are an alternative, however, that requires a second request.
Additional context
These ideas have been around for a long time: https://www.apollographql.com/blog/new-features-in-graphql-batch-defer-stream-live-and-subscribe-7585d0c28b07/
The text was updated successfully, but these errors were encountered: