Strawberry GraphQL @ 0.277.0
Released
This release adds experimental support for GraphQL’s @defer
and @stream
directives, enabling incremental delivery of response data.
Note: this only works when using Strawberry with graphql-core>=3.3.0a9
.
Features
-
@defer
directive: Allows fields to be resolved asynchronously and delivered incrementally -
@stream
directive: Enables streaming of list fields using the newstrawberry.Streamable
type -
strawberry.Streamable[T]
: A new generic type for defining streamable fields that work with@stream
Configuration
To enable these experimental features, configure your schema with:
from strawberry.schema.config import StrawberryConfig
schema = strawberry.Schema(
query=Query, config=StrawberryConfig(enable_experimental_incremental_execution=True)
)
Releases contributed by @patrick91 via #3819