-
-
Notifications
You must be signed in to change notification settings - Fork 565
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
Support Defer and Stream Directives #1452
Comments
I am not planning to work on this myself, but am generally open towards implementing ongoing RFCs or experimental features and would accept a pull request for this. |
Would the support for |
It is not necessary, but might be better to increase the amount of possible concurrent queries. Also, I remembered that Lighthouse already supports |
In this case the barrier for entry would be pretty much null, and this feature could interest a lot of people, including myself 🤩 |
I'll try to do it on my free time. I wrote some lines today, and when a walk through the code; I can see that all existing directives are added by default in the schema definition. So I followed the same logic by adding: // BuildSchema::buildSchema()
if (! isset($directivesByName[Directive::DIRECTIVE_DEFER_NAME])) {
$directives[] = Directive::deferDirective();
} But since it's an "experimental" feature, wouldn't it be better not to add it by default? $schema = new Schema(
(new SchemaConfig())
->useDeferExperimentalDirective()
); Another question that I've in mind (cc. @spawnia): |
Yeah, making
|
I'm interested in the stream directive, mostly to reduce the memory usage of the server when resolving large lists of nested json data. In this case the data is a little hard to paginate |
Hi,
The DeferStream RFC describes a mechanism to deliver some parts of a query response incrementally:
Quoting apollo-server:
The RFC is still a working draft, but it's implemented by relay, graphql-js (PR), apollo-server (PR).
On the transport level, servers can use a multipart response: https://github.com/graphql/graphql-over-http/blob/main/rfcs/IncrementalDelivery.md
It would be nice if this library implemented DeferStream. This can considerably simplify some data fetching patterns.
The text was updated successfully, but these errors were encountered: