Skip to content

First-Class support for @stream/@defer in strawberry #2914

Open
@erikwrede

Description

@erikwrede

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

Some playground code: https://gist.github.com/erikwrede/993e1fc174ee75b11c491210e4a9136b

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions