Support `@stream` directive extension
See original GitHub issueThere is a proposal spec for @stream
directive that supposed to address streaming list results:
- Similar to @defer, but for lists
- Will load each element of the list as it is ready
- Show users the first item in the list without waiting for the whole list
Request
query {
talks @stream {
title
time
speaker {
name
}
}
}
Initial Response
{
"data": {
"talks": []
}
}
Patch for first talk
{
"path": ["talks", 0],
"data": {
"title": "Opening Keynote",
"time": "10:30-11:00",
"speaker": {
"name": "Sean Larkin"
}
}
}
Patch for second talk
{
"path": ["talks", 1],
"data": {
"title": "Knock knock, who’s there?",
"time": "11:30-12:00",
"speaker": {
"name": "Sam Bellen"
}
}
}
Having native @stream
directive support in graphql-java
will be great for streaming large result sets without having to wait for the whole root list or any embedded list to resolve in memory for https://github.com/introproventures/graphql-jpa-query in order to minimize memory usage while fetching large results from the database.
I tried to use subscriptions for streaming large results via SSE or HTTP streaming, but it is very limited for queries type, i.e. https://github.com/introproventures/graphql-jpa-query/pull/229#issue-353230436
I can collaborate and contribute to graphql-java
Issue Analytics
- State:
- Created 4 years ago
- Reactions:8
- Comments:5 (2 by maintainers)
Top Results From Across the Web
HSTREAM: A directive-based language extension for ... - arXiv
In this paper, we present HSTREAM, a compiler directive- based language extension that supports heterogeneous stream computing.
Read more >HSTREAM: A Directive-Based Language Extension for ...
In this paper, we present HSTREAM, a compiler directive-based language extension to support programming stream computing applications for heterogeneous ...
Read more >Defer and Stream Directives in GraphQL - YouTube
Defer and Stream Directives in GraphQL with Rob Richard, Sr Director, Front-End Engineering at 1stdibs, and Liliana Matos, Director, ...
Read more >AudioPlayer Interface Reference | Alexa Skills Kit
The AudioPlayer interface provides directives and requests for streaming audio and monitoring playback progression. Your skill can send directives to start ...
Read more >Extensions | Twitch Developers
A Twitch Extension is a webpage that sits inside Twitch and communicates with Twitch to provide extra functionality. For example, the Hearthstone Deck ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@igdianov please follow the development here: https://github.com/graphql/graphql-spec/blob/master/rfcs/DeferStream.md
GraphQL Java will not implement any stream/defer until the spec for has made some serious progress: we don’t have the resources to support an alpha version of it. We already implemented defer once (it is actually still available) but then the community never implemented it more widely.
May I ask, is there any progress on @stream directive and @defer?
For data heavy applications @stream and @defer are very interesting as they solve the issue when querying larger amounts of data, which are heavy and slow.
I guess many users are not using defer yet, as it is in experimental state. Side questions, but maybe not related to this issue: are there any plans to extend defer from experimental to stable? When do you normally declare a feature as stable?