NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
PyPI, #1553 most downloaded on PyPI
A library for creating GraphQL APIs
Latest stable
0.341.2
Last release 9 days ago
07 Nov 2026
Ships fairly regularly
a new release about every 1 weeks
Nearly every release is documented
notes for 60 of the last 60 stable releases
Nothing withdrawn
no release was ever pulled
8 years old
1155 releases · first in 2019
Drag across the ruler to compare, or tap a release to open it.
Remove deprecated types parameter from strawberry.union(), deprecated since 0.191.0.
Remove deprecated types parameter from strawberry.union(), deprecated since 0.191.0.
You can run strawberry upgrade annotated-union <path> to automatically migrate your code.
Before (deprecated):
import strawberry
MyUnion = strawberry.union("MyUnion", types=(TypeA, TypeB))
After:
from typing import Annotated
import strawberry
MyUnion = Annotated[TypeA | TypeB, strawberry.union("MyUnion")]
Releases contributed by @Ckk3 via #4220
Remove deprecated types parameter from strawberry.union(), deprecated since 0.191.0.
You can run strawberry upgrade annotated-union <path> to automatically migrate your code.
Before (deprecated):
import strawberry
MyUnion = strawberry.union("MyUnion", types=(TypeA, TypeB))
After:
from typing import Annotated
import strawberry
MyUnion = Annotated[TypeA | TypeB, strawberry.union("MyUnion")]
Contributed by Luis Gustavo via PR #4220
Your coding agent can read these notes before it upgrades. Set up the MCP server →
Remove the ExecutionContext.errors property, deprecated since 0.276.2.
Remove the ExecutionContext.errors property, deprecated since 0.276.2.
Before (deprecated):
class MyExtension(SchemaExtension):
def on_execute(self):
yield
errors = self.execution_context.errors
After:
class MyExtension(SchemaExtension):
def on_execute(self):
yield
errors = self.execution_context.pre_execution_errors
Releases contributed by @Ckk3 via #4214
Remove the ExecutionContext.errors property, deprecated since 0.276.2.
Before (deprecated):
class MyExtension(SchemaExtension):
def on_execute(self):
yield
errors = self.execution_context.errors
After:
class MyExtension(SchemaExtension):
def on_execute(self):
yield
errors = self.execution_context.pre_execution_errors
Contributed by Luis Gustavo via PR #4214
Fix false-positive DuplicatedTypeName error when two different StrawberryObjectDefinition instances share the same origin class. This can happen when
Fix false-positive DuplicatedTypeName error when two different StrawberryObjectDefinition instances share the same origin class. This can happen when third-party decorators (e.g. strawberry-django's filter_type) re-process a type, creating a new definition while keeping the same Python class as origin.
Releases contributed by @bellini666 via #4193
Fix false-positive DuplicatedTypeName error when two different StrawberryObjectDefinition instances share the same origin class. This can happen when third-party decorators (e.g. strawberry-django's filter_type) re-process a type, creating a new definition while keeping the same Python class as origin.
Contributed by Thiago Bellini Ribeiro via PR #4193
Fix strawberry.experimental.pydantic to correctly handle nested pydantic.v1 models when running on Pydantic 2 (for example, list[LegacyModel] fields w
Fix strawberry.experimental.pydantic to correctly handle nested pydantic.v1
models when running on Pydantic 2 (for example, list[LegacyModel] fields with
all_fields=True), and add a regression test for this case.
Releases contributed by @patrick91 via #4246
Fix strawberry.experimental.pydantic to correctly handle nested pydantic.v1
models when running on Pydantic 2 (for example, list[LegacyModel] fields with
all_fields=True), and add a regression test for this case.
Contributed by Patrick Arminio via PR #4246
Remove deprecated argument name-based matching for info and directive_value parameters, deprecated since 0.159.0.
Remove deprecated argument name-based matching for info and directive_value parameters, deprecated since 0.159.0.
Parameters named info or directive_value are no longer automatically recognized by name. You must use explicit type annotations.
Before (deprecated):
@strawberry.type
class Query:
@strawberry.field
def example(self, info) -> str:
return info.context["key"]
After:
@strawberry.type
class Query:
@strawberry.field
def example(self, info: strawberry.Info) -> str:
return info.context["key"]
Releases contributed by @Ckk3 via #4224
Remove deprecated legacy extension hooks (on_request_start, on_request_end, on_validation_start, on_validation_end, on_parsing_start, on_parsing_end),…
Remove deprecated legacy extension hooks (on_request_start, on_request_end, on_validation_start, on_validation_end, on_parsing_start, on_parsing_end), deprecated since 0.159.0.
Before (deprecated):
class MyExtension(SchemaExtension):
def on_request_start(self): ...
def on_request_end(self): ...
After:
class MyExtension(SchemaExtension):
def on_operation(self):
# on_request_start logic
yield
# on_request_end logic
Releases contributed by @Ckk3 via #4226
Remove deprecated legacy extension hooks (on_request_start, on_request_end, on_validation_start, on_validation_end, on_parsing_start, on_parsing_end), deprecated since 0.159.0.
Before (deprecated):
class MyExtension(SchemaExtension):
def on_request_start(self): ...
def on_request_end(self): ...
After:
class MyExtension(SchemaExtension):
def on_operation(self):
# on_request_start logic
yield
# on_request_end logic
Contributed by Luis Gustavo via PR #4226
Remove deprecated Sanic-specific features: json_encoder parameter (deprecated since 0.147.0), json_dumps_params parameter (deprecated since 0.147.0),…
Remove deprecated Sanic-specific features: json_encoder parameter (deprecated since 0.147.0), json_dumps_params parameter (deprecated since 0.147.0), and context dot notation (deprecated since 0.146.0).
json_encoder / json_dumps_params — Before (deprecated):
class MyView(GraphQLView):
def __init__(self):
super().__init__(json_encoder=MyEncoder, json_dumps_params={"indent": 2})
After:
class MyView(GraphQLView):
def encode_json(self, data):
return json.dumps(data, cls=MyEncoder, indent=2)
Context dot notation — Before (deprecated):
request = info.context.request
After:
request = info.context["request"]
Releases contributed by @Ckk3 via #4221
Remove deprecated channel_listen method from the Channels integration, deprecated since 0.193.0.
Remove deprecated channel_listen method from the Channels integration, deprecated since 0.193.0.
Before (deprecated):
async for message in info.context["ws"].channel_listen("my_channel"):
yield Message(message=message["text"])
After:
async with info.context["ws"].listen_to_channel("my_channel") as listener:
async for message in listener:
yield Message(message=message["text"])
Releases contributed by @Ckk3 via #4216
Remove deprecated channel_listen method from the Channels integration, deprecated since 0.193.0.
Before (deprecated):
async for message in info.context["ws"].channel_listen("my_channel"):
yield Message(message=message["text"])
After:
async with info.context["ws"].listen_to_channel("my_channel") as listener:
async for message in listener:
yield Message(message=message["text"])
Contributed by Luis Gustavo via PR #4216
Remove deprecated graphiql parameter from all HTTP integrations (ASGI, Flask, FastAPI, Quart, Sanic, Chalice, Django, Aiohttp, Channels, and Litestar)…
Remove deprecated graphiql parameter from all HTTP integrations (ASGI, Flask, FastAPI, Quart, Sanic, Chalice, Django, Aiohttp, Channels, and Litestar), deprecated since 0.213.0.
Before (deprecated):
app = GraphQL(schema, graphiql=True)
After:
app = GraphQL(schema, graphql_ide="graphiql")
# or to disable:
app = GraphQL(schema, graphql_ide=None)
Releases contributed by @Ckk3 via #4222
Remove deprecated graphiql parameter from all HTTP integrations (ASGI, Flask, FastAPI, Quart, Sanic, Chalice, Django, Aiohttp, Channels, and Litestar), deprecated since 0.213.0.
Before (deprecated):
app = GraphQL(schema, graphiql=True)
After:
app = GraphQL(schema, graphql_ide="graphiql")
# or to disable:
app = GraphQL(schema, graphql_ide=None)
Contributed by Luis Gustavo via PR #4222
This release fixes a bug where the async execute method was creating new extension instances on every request (via get_extensions()), instead of reusi
This release fixes a bug where the async execute method was creating
new extension instances on every request (via get_extensions()),
instead of reusing cached instances like the sync execute_sync method
already did. This caused extensions that accumulate state across the
execution lifecycle (such as ApolloTracingExtension) to lose their
state between requests when using async execution.
Releases contributed by @bellini666 via #4181
This release fixes a bug where the async execute method was creating
new extension instances on every request (via get_extensions()),
instead of reusing cached instances like the sync execute_sync method
already did. This caused extensions that accumulate state across the
execution lifecycle (such as ApolloTracingExtension) to lose their
state between requests when using async execution.
Contributed by Thiago Bellini Ribeiro via PR #4181
Update type annotations for Response.data and Response.extensions in the test client to Any, instead of JsonValue, to allow nested subscript access in
Update type annotations for Response.data and Response.extensions in the test client to Any, instead of JsonValue, to allow nested subscript access in test assertions without type errors.
Releases contributed by @millar via #4195
Update type annotations for Response.data and Response.extensions in the test client to Any, instead of JsonValue, to allow nested subscript access in test assertions without type errors.
Contributed by Sam Millar via PR #4195
Nothing published for this version
Nothing published for this version
This update relaxes type annotations for Response.data and Response.extensions from dict[str, JsonValue] to dict[str, JsonValue] in the test client, m
This update relaxes type annotations for Response.data and Response.extensions from dict[str, JsonValue] to dict[str, JsonValue] in the test client, making assertions in tests easier to write.
Releases contributed by @millar via #4186
This update relaxes type annotations for Response.data and Response.extensions from dict[str, JsonValue] to dict[str, JsonValue] in the test client, making assertions in tests easier to write.
Contributed by Sam Millar via PR #4186
Adds a graphql_type parameter to strawberry.argument that allows you to explicitly override the GraphQL type of an argument, useful for static typing
Adds a graphql_type parameter to strawberry.argument that allows you
to explicitly override the GraphQL type of an argument, useful for static typing
when the Python type differs from the desired GraphQL type.
For example:
BigInt = strawberry.scalar(
int, name="BigInt", serialize=lambda v: str(v), parse_value=lambda v: int(v)
)
@strawberry.type
class Query:
@strawberry.field()
def username(
self, user_id: Annotated[int, strawberry.argument(graphql_type=BigInt)]
) -> str:
return "foobar"
schema = strawberry.Schema(Query)
str(
schema
) == """
scalar BigInt
type Query {
username(userId: BigInt!): String!
}
"""
Releases contributed by @thearchitector via #4067
This release improves schema-codegen for input types in two ways:
This release improves schema-codegen for input types in two ways:
Nullable input fields now use strawberry.Maybe[T | None], allowing them to
be omitted when constructing the input type.
GraphQL default values on input fields are now generated as Python defaults.
Supported value types: integers, floats, strings, booleans, null, enums, and
lists. When a field also has a description (or other metadata), the default is
passed via strawberry.field(description=..., default=...).
Before:
@strawberry.input
class CreateUserInput:
name: str
role: int | None # required – TypeError with {}
# default value "42" from schema was lost
After:
@strawberry.input
class CreateUserInput:
name: str
role: strawberry.Maybe[int | None] = 42
Releases contributed by @patrick91 via #4178
This release adds UploadDefinition to strawberry.file_uploads, which can be used with scalar_overrides to map framework-specific upload types to the U
This release adds UploadDefinition to strawberry.file_uploads, which can be
used with scalar_overrides to map framework-specific upload types to the
Upload scalar. This enables proper type checking with mypy/pyright when using
file uploads.
Example usage with Starlette/FastAPI:
from starlette.datastructures import UploadFile
from strawberry.file_uploads import UploadDefinition
schema = strawberry.Schema(
query=Query, mutation=Mutation, scalar_overrides={UploadFile: UploadDefinition}
)
@strawberry.type
class Mutation:
@strawberry.mutation
async def read_file(self, file: UploadFile) -> str:
return (await file.read()).decode("utf-8")
With this configuration, the file parameter is correctly typed as UploadFile,
giving you proper IDE autocomplete and type checking.
Releases contributed by @patrick91 via #4175
Fix nested generics with resolver-backed fields to avoid duplicate type names.
Fix nested generics with resolver-backed fields to avoid duplicate type names.
Example (previously raised DuplicatedTypeName):
import strawberry
@strawberry.type
class Collection[T]:
field1: list[T] = strawberry.field(resolver=lambda: [])
@strawberry.type
class Container[T]:
items: list[T]
@strawberry.type
class TypeA: ...
@strawberry.type
class TypeB: ...
@strawberry.type
class Query:
@strawberry.field
def a(self) -> Container[Collection[TypeA]]: ...
@strawberry.field
def b(self) -> Container[Collection[TypeB]]: ...
strawberry.Schema(query=Query)
Releases contributed by @bellini666 via #4162
Fix nested generics with resolver-backed fields to avoid duplicate type names.
Example (previously raised DuplicatedTypeName):
import strawberry
@strawberry.type
class Collection[T]:
field1: list[T] = strawberry.field(resolver=lambda: [])
@strawberry.type
class Container[T]:
items: list[T]
@strawberry.type
class TypeA: ...
@strawberry.type
class TypeB: ...
@strawberry.type
class Query:
@strawberry.field
def a(self) -> Container[Collection[TypeA]]: ...
@strawberry.field
def b(self) -> Container[Collection[TypeB]]: ...
strawberry.Schema(query=Query)
Contributed by Thiago Bellini Ribeiro via PR #4162
This release adds support for field extensions in experimental pydantic types.
This release adds support for field extensions in experimental pydantic types.
Previously, when using @strawberry.experimental.pydantic.type() decorator, field extensions defined with strawberry.field(extensions=[...]) were not being propagated to the generated Strawberry fields. This meant extensions like authentication, caching, or result transformation couldn't be used with pydantic-based types.
This fix ensures that extensions are properly preserved when converting pydantic fields to Strawberry fields, enabling the full power of field extensions across the pydantic integration.
Examples:
Permission-based field masking:
from pydantic import BaseModel
from typing import Optional
import strawberry
from strawberry.experimental.pydantic import type as pyd_type
from strawberry.extensions.field_extension import FieldExtension
class PermissionExtension(FieldExtension):
def resolve(self, next_, source, info, **kwargs):
# Check permission, return None if denied
if not check_field_access(info.context.user, info.field_name, source.id):
return None
return next_(source, info, **kwargs)
class UserModel(BaseModel):
id: int
fname: str
email: str
phone: str
perm_ext = PermissionExtension()
@pyd_type(model=UserModel)
class UserGQL:
# Public fields - just use auto
id: strawberry.auto
fname: strawberry.auto
# Protected fields - attach extension
email: Optional[str] = strawberry.field(extensions=[perm_ext])
phone: Optional[str] = strawberry.field(extensions=[perm_ext])
Basic transformation extension:
class UpperCaseExtension(FieldExtension):
def resolve(self, next_, source, info, **kwargs):
result = next_(source, info, **kwargs)
return str(result).upper()
class ProductModel(BaseModel):
name: str
@pyd_type(model=ProductModel)
class Product:
name: str = strawberry.field(extensions=[UpperCaseExtension()])
Releases contributed by @XChikuX via #4171
Fix union type resolution to fall back to is_type_of for generic unions when type matching fails. This allows returning domain/ORM objects from generi
Fix union type resolution to fall back to is_type_of for generic unions when
type matching fails. This allows returning domain/ORM objects from generic union
fields without spurious union type errors.
Releases contributed by @bellini666 via #4163
Fix union type resolution to fall back to is_type_of for generic unions when
type matching fails. This allows returning domain/ORM objects from generic union
fields without spurious union type errors.
Contributed by Thiago Bellini Ribeiro via PR #4163
This release fixes an issue where relay.node() fields on nested types required explicit initialization, even though the field values are resolved dyna
This release fixes an issue where relay.node() fields on nested types required
explicit initialization, even though the field values are resolved dynamically.
Previously, this code would fail at runtime:
@strawberry.type
class Sub:
node: relay.Node = relay.node()
@strawberry.type
class Query:
@strawberry.field
def sub(self) -> Sub:
return Sub() # Error: missing required argument 'node'
Now relay.node() provides a default value, allowing nested types with relay
node fields to be instantiated without explicit initialization.
Releases contributed by @devkral via #3331
This release fixes an issue where lazy union types using the new Annotated syntax were not being resolved correctly.
This release fixes an issue where lazy union types using the new Annotated syntax were not being resolved correctly.
Example that now works:
from typing import Annotated
import strawberry
@strawberry.type
class Query:
@strawberry.field
def example(self) -> Annotated["SomeUnion", strawberry.lazy("module")]: ...
Releases contributed by @patrick91 via #4156
This release fixes an issue where lazy union types using the new Annotated syntax were not being resolved correctly.
Example that now works:
from typing import Annotated
import strawberry
@strawberry.type
class Query:
@strawberry.field
def example(self) -> Annotated["SomeUnion", strawberry.lazy("module")]: ...
Contributed by Patrick Arminio via PR #4156
Fix lazy type resolution with relative imports
Fix lazy type resolution with relative imports
This fixes an issue where lazy types using relative imports (e.g., strawberry.lazy(".module")) would fail to resolve correctly when comparing with the __main__ module, potentially causing "Type X is defined multiple times in the schema" errors during test isolation.
This ensures that the fully resolved module name is used when comparing with __main__.__spec__.name, rather than the relative import path.
Releases contributed by @bellini666 via #4145
Improved execution performance by up to 10% by adding an optimized is_awaitable check with a fast path for common synchronous types (such as int, str,
Improved execution performance by up to 10% by adding an optimized is_awaitable check with a fast path for common synchronous types (such as int, str, list, dict, etc.).
This optimization reduces overhead when processing large result sets containing mostly basic values by avoiding expensive awaitable checks for types that are known to never be awaitable.
Releases contributed by @patrick91 via #4035
Support using enum values in the GraphQL schema
Support using enum values in the GraphQL schema
Releases contributed by @paulo-raca via #4071
Support using enum values in the GraphQL schema
Contributed by Paulo Costa via PR #4071
Added URL sharing support for GraphiQL. Query, variables, and headers are now persisted in the URL, allowing users to share GraphQL queries via links.
Added URL sharing support for GraphiQL. Query, variables, and headers are now persisted in the URL, allowing users to share GraphQL queries via links.
Releases contributed by @Arfey via #2842
Added URL sharing support for GraphiQL. Query, variables, and headers are now persisted in the URL, allowing users to share GraphQL queries via links.
Contributed by Mykhailo Havelia via PR #2842
Fixed a bug where strawberry.Maybe[T] was incorrectly accepting null values when passed through variables
Fixed a bug where strawberry.Maybe[T] was incorrectly accepting null values when passed through variables
Previously, Maybe[T] returned a validation error for literal null values in GraphQL queries, but allowed null when passed via variables, resulting in Some(None) reaching the resolver instead of raising a validation error.
This fix ensures consistent validation behavior for Maybe[T] regardless of how the input is provided:
Maybe[T] now returns a validation error for null in both literal queries and variablesMaybe[T | None] continues to accept null values as expectedMaybe[T | None] if null values are neededReleases contributed by @bellini666 via #4096
Fixed two bugs where using strawberry.Maybe wrapped in Annotated or using an explicit field definition would raise a TypeError about "missing 1 requir
Fixed two bugs where using strawberry.Maybe wrapped in Annotated or using an explicit field definition would raise a TypeError about "missing 1 required keyword-only argument", even though a Maybe field should allow None in all cases.
This fix addresses this via custom handling for annotations wrapped with Annotated and handling custom field with no default and no default_factory as possible to be None.
Releases contributed by @Birdi7 via #4084
Fixed a bug where using relay.node() or relay.connection() would raise a DeprecationWarning about "Argument name-based matching of 'info'", even thoug…
Fixed a bug where using relay.node() or relay.connection() would raise a
DeprecationWarning about "Argument name-based matching of 'info'", even though
the info parameter was correctly annotated.
This also fixes the same warning when using Python 3.12+ type alias syntax for
Info, such as type MyInfo = strawberry.Info[Context, None].
The fix recognizes strawberry.Info and strawberry.Parent annotations (with
or without generic parameters) when they appear as string forward references.
Only fully qualified names are matched to avoid confusion with user-defined types.
Releases contributed by @bellini666 via #4081
Deprecate passing a class to strawberry.scalar(). Use scalar_map in StrawberryConfig instead for better type checking support.
Deprecate passing a class to strawberry.scalar(). Use scalar_map in
StrawberryConfig instead for better type checking support.
# Before (deprecated)
Base64 = strawberry.scalar(
NewType("Base64", bytes),
serialize=lambda v: base64.b64encode(v).decode(),
parse_value=lambda v: base64.b64decode(v),
)
Instead, use scalar_map in StrawberryConfig:
# Recommended
Base64 = NewType("Base64", bytes)
schema = strawberry.Schema(
query=Query,
config=StrawberryConfig(
scalar_map={
Base64: strawberry.scalar(
name="Base64",
serialize=lambda v: base64.b64encode(v).decode(),
parse_value=lambda v: base64.b64decode(v),
)
}
),
)
This release also removes internal scalar wrapper exports (Date, DateTime,
etc.) from strawberry.schema.types.base_scalars. Most users are likely not
using these, but if you were, a codemod is available to help with the migration:
strawberry upgrade replace-scalar-wrappers .
More info about custom scalars at the updated doc page: https://strawberry.rocks/docs/types/scalars#scalars
Releases contributed by @bellini666 via #4076
Switch from lia-web to cross-web: lia-web has been renamed to cross-web. Update imports from lia to cross_web accordingly.
Switch from lia-web to cross-web: lia-web has been renamed to cross-web. Update imports from lia to cross_web accordingly.
Releases contributed by @Antiz96 via #4079
Switch from lia-web to cross-web: lia-web has been renamed to cross-web. Update imports from lia to cross_web accordingly.
Contributed by Robin Candau via PR #4079
Fix compatibility with Python 3.14 when using the Pydantic integration with Pydantic V2.
Fix compatibility with Python 3.14 when using the Pydantic integration with Pydantic V2.
Previously, importing strawberry.experimental.pydantic on Python 3.14 would trigger:
UserWarning: Core Pydantic V1 functionality isn't compatible with Python 3.14 or greater.
This is now fixed by avoiding pydantic.v1 imports on Python 3.14+.
Releases contributed by @patrick91 via #4072
Fix compatibility with Python 3.14 when using the Pydantic integration with Pydantic V2.
Previously, importing strawberry.experimental.pydantic on Python 3.14 would trigger:
UserWarning: Core Pydantic V1 functionality isn't compatible with Python 3.14 or greater.
This is now fixed by avoiding pydantic.v1 imports on Python 3.14+.
Contributed by Patrick Arminio via PR #4072
Fixed a bug in the codegen where Relay Node's id field was incorrectly generated as _id in the output code.
Fixed a bug in the codegen where Relay Node's id field was incorrectly generated as _id in the output code.
The codegen now correctly respects the explicit graphql_name set via the @field(name="id") decorator, ensuring that the generated code uses id instead of the Python method name _id.
Releases contributed by @Ckk3 via #4053
Fixed a bug in the codegen where Relay Node's id field was incorrectly generated as _id in the output code.
The codegen now correctly respects the explicit graphql_name set via the @field(name="id") decorator, ensuring that the generated code uses id instead of the Python method name _id.
Contributed by Luis Gustavo via PR #4053
Fix mypy plugin issues related to new version of mypy. The TypeAlias class has one more required argument "module" in the mypy version >= 1.19.
Fix mypy plugin issues related to new version of mypy. The TypeAlias class has one more required argument "module" in the mypy version >= 1.19.
Releases contributed by @Ansud via #4060
Fix mypy plugin issues related to new version of mypy. The TypeAlias class has one more required argument "module" in the mypy version >= 1.19.
Contributed by Anton Zelenov via PR #4060
Change strawberry.http.base.BaseView.encode_json() type hint to str | bytes and adjust dependent code appropriately.
Change strawberry.http.base.BaseView.encode_json() type hint to str | bytes and adjust dependent code appropriately.
Releases contributed by @Brandieee via #4054
Change strawberry.http.base.BaseView.encode_json() type hint to str | bytes and adjust dependent code appropriately.
Set Content-Type to text/plain for exceptions so that these are displayed correctly.
Set Content-Type to text/plain for exceptions so that these are displayed
correctly.
Releases contributed by @mgorven via #4037
Set Content-Type to text/plain for exceptions so that these are displayed
correctly.
Contributed by Michael Gorven via PR #4037
This release changes _enum_definition to __strawberry_definition__, this is a follow up to previous internal changes. If you were relying on _enum_def
This release changes _enum_definition to __strawberry_definition__, this is a follow up to previous
internal changes. If you were relying on _enum_definition you should update your code to use __strawberry_definition__.
We also expose has_enum_definition to check if a type is a strawberry enum definition.
from enum import Enum
import strawberry
from strawberry.types.enum import StrawberryEnumDefinition, has_enum_definition
@strawberry.enum
class ExampleEnum(Enum):
pass
has_enum_definition(ExampleEnum) # True
# Now you can use ExampleEnum.__strawberry_definition__ to access the enum definition
Releases contributed by @Ckk3 via #3999
You must migrate to Federation v2. See the breaking changes documentation for detailed migration instructions.
This release removes support for Apollo Federation v1 and improves Federation v2 support with explicit version control and new directives.
enable_federation_2 parameter: Replaced with federation_version parameterenable_federation_2=TrueRemove the parameter:
# Before
schema = strawberry.federation.Schema(query=Query, enable_federation_2=True)
# After
schema = strawberry.federation.Schema(query=Query)
You must migrate to Federation v2. See the breaking changes documentation for detailed migration instructions.
schema = strawberry.federation.Schema(
query=Query, federation_version="2.5" # Specify a specific version if needed
)
@context, @fromContext, @cost, and @listSize directives (v2.7+)Releases contributed by @patrick91 via #4045
Nothing published for this version
Bumped minimum Typer version to fix strawberry CLI commands.
Bumped minimum Typer version to fix strawberry CLI commands.
Releases contributed by @valliu via #4049
Removed Transfer-Encoding: chunked header from multipart streaming responses. This fixes HTTP 405 errors on Vercel and other serverless platforms. The
Removed Transfer-Encoding: chunked header from multipart streaming responses. This fixes HTTP 405 errors on Vercel and other serverless platforms. The server/gateway will handle chunked encoding automatically when needed.
Releases contributed by @LouisAmon via #4047
Removed Transfer-Encoding: chunked header from multipart streaming responses. This fixes HTTP 405 errors on Vercel and other serverless platforms. The server/gateway will handle chunked encoding automatically when needed.
Contributed by Louis Amon via PR #4047
Update typing of variables in the test clients to match the actual flexibility of this field.
Update typing of variables in the test clients to match the actual flexibility of this field.
Releases contributed by @ben-xo via #4044
Update typing of variables in the test clients to match the actual flexibility of this field.
This release fixes the usage of strawberry.Maybe inside modules using from __future__ import annotations
This release fixes the usage of strawberry.Maybe inside modules using from __future__ import annotations
Releases contributed by @bellini666 via #4031
This release fixes the usage of strawberry.Maybe inside modules using from __future__ import annotations
Contributed by Thiago Bellini Ribeiro via PR #4031
…no longer maintained and may contain security vulnerabilities.
This release drops support for Python 3.9, which reached its end-of-life (EOL) in October 2025. The minimum supported Python version is now 3.10.
We strongly recommend upgrading to Python 3.10 or a newer version, as older versions are no longer maintained and may contain security vulnerabilities.
Releases contributed by @bellini666 via #4018
This release drops support for Python 3.9, which reached its end-of-life (EOL) in October 2025. The minimum supported Python version is now 3.10.
We strongly recommend upgrading to Python 3.10 or a newer version, as older versions are no longer maintained and may contain security vulnerabilities.
Contributed by Thiago Bellini Ribeiro via PR #4018
Releases contributed by @rcybulski1122012 via #4017
Adds support for lazy unions.
Releases contributed by @rcybulski1122012 via #4017
Adds support for lazy unions.
Contributed by Radosław Cybulski via PR #4017
This release adds support for the upcoming Python 3.14
This release adds support for the upcoming Python 3.14
Releases contributed by @patrick91 via #3828
This release adds support for the upcoming Python 3.14
Contributed by Patrick Arminio via PR #3828
Fixed multipart subscription header parsing to properly handle optional boundary parameters and quoted subscription spec values. This improves compati
Fixed multipart subscription header parsing to properly handle optional boundary parameters and quoted subscription spec values. This improves compatibility with different GraphQL clients that may send headers in various formats.
Key improvements:
boundary=graphql parameter optional in multipart subscription detectionsubscriptionSpec values (e.g., subscriptionSpec="1.0")Example of supported headers:
Accept: multipart/mixed;boundary=graphql;subscriptionSpec=1.0,application/json
Accept: multipart/mixed;subscriptionSpec="1.0",application/json
Releases contributed by @LouisAmon via #4002
We also deprecated the strawberry-graphql[debug-server] extra in favor of strawberry-graphql[cli]. Please update your dependencies accordingly.
In this release, we renamed the strawberry server command to strawberry dev
to better reflect its purpose as a development server.
We also deprecated the strawberry-graphql[debug-server] extra in favor of
strawberry-graphql[cli]. Please update your dependencies accordingly.
Releases contributed by @DoctorJohn via #4011
In this release, we renamed the strawberry server command to strawberry dev
to better reflect its purpose as a development server.
We also deprecated the strawberry-graphql[debug-server] extra in favor of
strawberry-graphql[cli]. Please update your dependencies accordingly.
Contributed by Jonathan Ehwald via PR #4011
This release fixes mask errors to support strawberry execution results.
This release fixes mask errors to support strawberry execution results.
Releases contributed by @aryaniyaps via #3987
This release fixes mask errors to support strawberry execution results.
Contributed by Aryan Iyappan via PR #3987
In this release we removed the --log-operations option from the strawberry server command. The option only worked for WebSocket connections to the deb
In this release we removed the --log-operations option from the
strawberry server command. The option only worked for WebSocket connections to
the debug server, and had limited utility.
Removing this option allowed us to remove the undocumented debug option from
all HTTP view integrations and WebSocket protocol implementation, simplifying
the codebase.
Releases contributed by @DoctorJohn via #3979
In this release we removed the --log-operations option from the
strawberry server command. The option only worked for WebSocket connections to
the debug server, and had limited utility.
Removing this option allowed us to remove the undocumented debug option from
all HTTP view integrations and WebSocket protocol implementation, simplifying
the codebase.
Contributed by Jonathan Ehwald via PR #3979
This release unifies the format of HTTP error response bodies across all HTTP view integrations. Previously, the Chalice integration used a custom JSO
This release unifies the format of HTTP error response bodies across all HTTP view integrations. Previously, the Chalice integration used a custom JSON body response different from the plain string used by other integrations. Now, all integrations will return a plain string for HTTP error responses.
Releases contributed by @DoctorJohn via #3978
This release unifies the format of HTTP error response bodies across all HTTP view integrations. Previously, the Chalice integration used a custom JSON body response different from the plain string used by other integrations. Now, all integrations will return a plain string for HTTP error responses.
Contributed by Jonathan Ehwald via PR #3978
Breaking Change: The Maybe type definition has been changed from Union[Some[Union[T, None]], None] to Union[Some[T], None]. This means:
This release changes the strawberry.Maybe type to provide a more consistent and intuitive API for handling optional fields in GraphQL inputs.
Breaking Change: The Maybe type definition has been changed from Union[Some[Union[T, None]], None] to Union[Some[T], None]. This means:
Maybe[str] now only accepts string values or absent fields (refuses explicit null)Maybe[str | None] accepts strings, null, or absent fields (maintains previous behavior)This provides a cleaner API where if field is not None consistently means "field was provided" for all Maybe fields. A codemod is available to automatically migrate your code: strawberry upgrade maybe-optional
See the breaking changes documentation for migration details.
Releases contributed by @patrick91 via #3961
Nothing published for this version
Nothing published for this version
Nothing published for this version
This release removes some internal code in favour of using an external dependency, this will help us with maintaining the codebase in the future 😊
This release removes some internal code in favour of using an external dependency, this will help us with maintaining the codebase in the future 😊
Releases contributed by @patrick91 via #3967
This release removes some internal code in favour of using an external dependency, this will help us with maintaining the codebase in the future 😊
Contributed by Patrick Arminio via PR #3967
GraphQL query batching is now supported across all frameworks (sync and async) To enable query batching, add a valid batching_config to the schema con
GraphQL query batching is now supported across all frameworks (sync and async)
To enable query batching, add a valid batching_config to the schema configuration.
This makes your GraphQL API compatible with batching features supported by various client side libraries, such as Apollo GraphQL and Relay.
Example (FastAPI):
import strawberry
from fastapi import FastAPI
from strawberry.fastapi import GraphQLRouter
from strawberry.schema.config import StrawberryConfig
@strawberry.type
class Query:
@strawberry.field
def hello(self) -> str:
return "Hello World"
schema = strawberry.Schema(
Query, config=StrawberryConfig(batching_config={"max_operations": 10})
)
graphql_app = GraphQLRouter(schema)
app = FastAPI()
app.include_router(graphql_app, prefix="/graphql")
Example (Flask):
import strawberry
from flask import Flask
from strawberry.flask.views import GraphQLView
app = Flask(__name__)
@strawberry.type
class Query:
@strawberry.field
def hello(self) -> str:
return "Hello World"
schema = strawberry.Schema(
Query, config=StrawberryConfig(batching_config={"max_operations": 10})
)
app.add_url_rule(
"/graphql/batch",
view_func=GraphQLView.as_view("graphql_view", schema=schema),
)
if __name__ == "__main__":
app.run()
Note: Query Batching is not supported for multipart subscriptions
Releases contributed by @aryaniyaps via #3755
This release fixes the resolution of Generics when specializing using a union defined with Annotated, like in the example below:
This release fixes the resolution of Generics when specializing using a union
defined with Annotated, like in the example below:
from typing import Annotated, Generic, TypeVar, Union
import strawberry
T = TypeVar("T")
@strawberry.type
class User:
name: str
age: int
@strawberry.type
class ProUser:
name: str
age: float
@strawberry.type
class GenType(Generic[T]):
data: T
GeneralUser = Annotated[Union[User, ProUser], strawberry.union("GeneralUser")]
@strawberry.type
class Response(GenType[GeneralUser]): ...
@strawberry.type
class Query:
@strawberry.field
def user(self) -> Response: ...
schema = strawberry.Schema(query=Query)
Before this would raise a TypeError, now it works as expected.
Releases contributed by @bellini666 via #3950
This release adds experimental support for GraphQL's @defer and @stream directives, enabling incremental delivery of response data.
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.
@defer directive: Allows fields to be resolved asynchronously and delivered incrementally@stream directive: Enables streaming of list fields using the new strawberry.Streamable typestrawberry.Streamable[T]: A new generic type for defining streamable fields that work with @streamTo 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
The old errors attribute is now deprecated but still available for backward compatibility.
This release renames the ExecutionContext.errors attribute to ExecutionContext.pre_execution_errors to better reflect its purpose. The old errors attribute is now deprecated but still available for backward compatibility.
The pre_execution_errors attribute specifically stores errors that occur during the pre-execution phase (parsing and validation), making the distinction clearer from errors that might occur during the actual execution phase.
For backward compatibility, accessing ExecutionContext.errors will now emit a deprecation warning and return the value of pre_execution_errors.
Releases contributed by @patrick91 via #3947
One column per quarter.