graphql-flutter icon indicating copy to clipboard operation
graphql-flutter copied to clipboard

Support @defer directive

Open danilofuchs opened this issue 4 years ago • 2 comments

Is your feature request related to a problem? Please describe. Apollo Server has the @defer directive, which returns a stream of partial data, building the response one piece at a time, deferring non-essential queries

Describe the solution you'd like GraphQL Flutter should be able to handle @defer directives seemlesly

Describe alternatives you've considered Perhaps the result of query could be a Stream, in which data is publish as it comes in

Additional context https://www.apollographql.com/blog/introducing-defer-in-apollo-server-f6797c4e9d6e/

danilofuchs avatar Jan 31 '21 19:01 danilofuchs

This is probably something we'll leave in the 3rd party link / "userland" world.

micimize avatar Feb 07 '21 16:02 micimize

To go a bit more in-depth: if someone wrote a link that detected @defer in the request, and handled merging and re-emitting updated responses as they were returned, then we could rework the code path for watchQuery to be a stream that closes upon the final response with some indicative context of what paths are still deferred. However, this is all fairly involved.

micimize avatar Feb 10 '21 15:02 micimize