Open
Description
First-Class support for @stream
/@defer
in strawberry
This issue is going to collect all necessary steps for an awesome stream and defer devX in Strawberry 🍓
First steps collected today together in discovery session with @patrick91 @bellini666
ToDos for an initial support:
- Add support for
[async/sync]
generators in return types - Make sure
GraphQLDeferDirective
,GraphQLStreamDirective
, are in the GQL-Core schema
Flag in Schema(query=Query, config={enable_stream_defer: False}) - default true - Add incremental delivery support to all the views
- FastAPI integration -> Maybe in the Async Base View?
- Explore Sync View Integration
long term goals
incomplete list of problems / design improvement potential of the current raw implementation
Problem: streaming / n+1 -> first-level dataloaders are no longer working as every instance is resolved 1:1
Possible solutions
- dig deeper into [graphql-js] Yielding batches of results in resolver functions graphql/defer-stream-wg#40
- custom query execution plan engine
- Add @streamable directive to schema fields automatically if field is streamable, including custom validation rule
Some playground code: https://gist.github.com/erikwrede/993e1fc174ee75b11c491210e4a9136b
Metadata
Metadata
Assignees
Labels
No labels