NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
PyPI · #1573 most downloaded on PyPI
A library for creating GraphQL APIs
Last release today
03 Oct 2026
Ships fairly regularly
a new release about every 3 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
1122 releases · first in 2019
This release updates the Sanic integration and includes some breaking changes. You might need to update your code if you are customizing get_context o…
This release updates the Sanic integration and includes some breaking changes. You might need to update your code if you are customizing get_context or process_result
This release introduced improved errors! Now, when you have a syntax error in your code, you’ll get a nice error message with a line number and a poin
This release introduced improved errors! Now, when you have a syntax error in your code, you’ll get a nice error message with a line number and a pointer to the exact location of the error. ✨
This is a huge improvement over the previous behavior, which was providing a stack trace with no clear indication of where the error was. 🙈
You can enable rich errors by installing Strawberry with the cli extra:
Terminal window
pip install "strawberry-graphql[cli]"
Contributed by Patrick Arminio via PR #2027
One column per quarter.
Nothing published for this version
Nothing published for this version
Nothing published for this version
This release fixes an issue with type duplication of generics.
This release fixes an issue with type duplication of generics.
You can now use a lazy type with a generic even if the original type was already used with that generic in the schema.
Example:
@strawberry.type
class Query :
regular: Edge[User]
lazy: Edge[Annotated[ "User" , strawberry.lazy( ".user" )]]
Contributed by Dmitry Semenov via PR #2381
Generic types are now allowed in the schema’s extra types.
Generic types are now allowed in the schema’s extra types.
T = TypeVar( "T" )
@strawberry.type
class Node (Generic[T]):
field: T
@strawberry.type
class Query :
name: str
schema = strawberry.Schema(Query, types =[Node[ int ]])
Contributed by A. Coady via PR #2294
This release fixes a regression that prevented Generic types from being used multiple types.
This release fixes a regression that prevented Generic types from being used multiple types.
Contributed by Patrick Arminio via PR #2378
Added extra validation that types used in a schema are unique. Strawberry starts to throw an exception DuplicatedTypeName when two types defined in a
Added extra validation that types used in a schema are unique. Strawberry starts to throw an exception DuplicatedTypeName when two types defined in a schema have the same name.
Contributed by Bartosz Polnik via PR #2356
Nothing published for this version
Added an error to be used when overriding GraphQLError in custom extensions and added a guide on how to use it. Exposing GraphQLError from the strawbe
Added an error to be used when overriding GraphQLError in custom extensions and added a guide on how to use it. Exposing GraphQLError from the strawberry namespace brings a better experience and will be useful in the future (when we move to something else).
Contributed by Niten Nashiki via PR #2360
This release updates GraphiQL to 2.2.0 and fixes an issue with the websocket URL being incorrectly set when navigating to GraphiQL with an URL with a
This release updates GraphiQL to 2.2.0 and fixes an issue with the websocket URL being incorrectly set when navigating to GraphiQL with an URL with a hash.
Contributed by Shen Li via PR #2363
This release changes the dataloader batch resolution to avoid resolving futures that were canceled, and also from reusing them from the cache. Trying
This release changes the dataloader batch resolution to avoid resolving futures that were canceled, and also from reusing them from the cache. Trying to resolve a future that was canceled would raise asyncio.InvalidStateError
Contributed by Thiago Bellini Ribeiro via PR #2339
This release fixes a bug where using a custom scalar in a union would result in an unclear exception. Instead, when using a custom scalar in a union,
This release fixes a bug where using a custom scalar in a union would result in an unclear exception. Instead, when using a custom scalar in a union, the InvalidUnionType exception is raised with a clear message that you cannot use that type in a union.
Contributed by Jonathan Kim via PR #2336
This release adds support for typing.Self and typing_extensions.Self for types and interfaces.
This release adds support for typing.Self and typing_extensions.Self for types and interfaces.
from typing_extensions import Self
@strawberry.type
class Node :
@strawberry.field
def field ( self ) -> Self:
return self
Contributed by A. Coady via PR #2295
This release adds support for an implicit resolve_reference method on Federation type. This method will automatically create a Strawberry instance for
This release adds support for an implicit resolve_reference method on Federation type. This method will automatically create a Strawberry instance for a federation type based on the input data received, for example, the following:
@strawberry.federation.type ( keys =[ "id" ])
class Something :
id : str
@strawberry.federation.type ( keys =[ "upc" ])
class Product :
upc: str
something: Something
@ staticmethod
def resolve_reference (** data ):
return Product( upc =data[ "upc" ], something =Something( id =data[ "something_id" ]))
doesn’t need the resolve_reference method anymore.
Contributed by Patrick Arminio via PR #2332
Nothing published for this version
Nothing published for this version
Nothing published for this version
[Internal] Update StrawberryField so that type_annotation is always an instance of StrawberryAnnotation.
[Internal] Update StrawberryField so that type_annotation is always an instance of StrawberryAnnotation.
Contributed by Jonathan Kim via PR #2319
This release fixes an issue that prevented using enums that were using strawberry.enum_value, like the following example:
This release fixes an issue that prevented using enums that were using strawberry.enum_value, like the following example:
from enum import Enum
import strawberry
@strawberry.enum
class TestEnum ( Enum ):
A = strawberry.enum_value( "A" )
B = "B"
@strawberry.type
class Query :
@strawberry.field
def receive_enum ( self , test : TestEnum) -> int :
return 0
schema = strawberry.Schema( query =Query)
Contributed by Patrick Arminio via PR #2306
This release adds logging back for parsing and validation errors that was accidentally removed in v0.135.0.
This release adds logging back for parsing and validation errors that was accidentally removed in v0.135.0.
Contributed by Jonathan Kim via PR #2323
Nothing published for this version
This release allows to disable operation logging when running the debug server.
This release allows to disable operation logging when running the debug server.
strawberry server demo --log-operations False
Contributed by Patrick Arminio via PR #2310
This release changes the type resolution priority to prefer the field annotation over the resolver return type.
This release changes the type resolution priority to prefer the field annotation over the resolver return type.
def my_resolver () -> str :
return "1.33"
@strawberry.type
class Query :
a: float = strawberry.field( resolver =my_resolver)
schema = strawberry.Schema(Query)
str (schema) == """
type Query {
a: String!
}
"""
str (schema) == """
type Query {
a: Float!
}
"""
Contributed by Jonathan Kim via PR #2312
Nothing published for this version
Fix Pydantic integration for Python 3.10.0 (which was missing the kw_only parameter for dataclasses.make_dataclass() ).
Fix Pydantic integration for Python 3.10.0 (which was missing the kw_only parameter for dataclasses.make_dataclass() ).
Contributed by Jonathan Kim via PR #2309
Nothing published for this version
This release changes an internal implementation for FastAPI’s GraphQL router. This should reduce overhead when using the context, and it shouldn’t aff
This release changes an internal implementation for FastAPI’s GraphQL router. This should reduce overhead when using the context, and it shouldn’t affect your code.
Contributed by Kristján Valur Jónsson via PR #2278
This release adds support for generic in arguments, see the following example:
This release adds support for generic in arguments, see the following example:
T = TypeVar( "T" )
@strawberry.type
class Node (Generic[T]):
@strawberry.field
def data ( self , arg : T) -> T: # arg is also generic
return arg
Contributed by A. Coady via PR #2293
Allowed CustomScalar | None syntax for python >= 3.10.
Allowed CustomScalar | None syntax for python >= 3.10.
Contributed by Guillaume Andreu Sabater via PR #2279
This release fixes errors when using Union-of-lazy-types
This release fixes errors when using Union-of-lazy-types
Contributed by Paulo Costa via PR #2271
This release refactors the chalice integration in order to keep it consistent with the other integrations.
This release refactors the chalice integration in order to keep it consistent with the other integrations.
This release adds a new MaskErrors extension that can be used to hide error messages from the client to prevent exposing sensitive details. By default
This release adds a new MaskErrors extension that can be used to hide error messages from the client to prevent exposing sensitive details. By default it masks all errors raised in any field resolver.
import strawberry
from strawberry.extensions import MaskErrors
schema = strawberry.Schema(
Query,
extensions =[
MaskErrors(),
],
)
Contributed by Jonathan Kim via PR #2248
This release improves the error message that you get when trying to use an enum that hasn’t been decorated with @strawberry.enum inside a type’s field
This release improves the error message that you get when trying to use an enum that hasn’t been decorated with @strawberry.enum inside a type’s field.
Contributed by Rise Riyo via PR #2267
This release adds support for printing schema directives on an input type object, for example the following schema:
This release adds support for printing schema directives on an input type object, for example the following schema:
@strawberry.schema_directive ( locations =[Location.INPUT_FIELD_DEFINITION])
class RangeInput :
min : int
max : int
@strawberry.input
class CreateUserInput :
name: str
age: int = strawberry.field( directives =[RangeInput( min = 1 , max = 100 )])
prints the following:
directive @rangeInput ( min : Int !, max : Int !) on INPUT_FIELD_DEFINITION
input Input @sensitiveInput ( reason : "GDPR" ) {
firstName : String !
age : Int ! @rangeInput ( min : 1 , max : 100 )
}
Contributed by Etty via PR #2233
This release fixes an issue that prevented using strawberry.lazy with relative paths.
This release fixes an issue that prevented using strawberry.lazy with relative paths.
The following should work now:
@strawberry.type
class TypeA :
b: Annotated[ "TypeB" , strawberry.lazy( ".type_b" )]
Contributed by Paulo Costa via PR #2244
This release adds pyupgrade to our CI and includes some minor changes to keep our codebase modern.
This release adds pyupgrade to our CI and includes some minor changes to keep our codebase modern.
Contributed by Liel Fridman via PR #2255
This release fixes an issue that prevented using lazy types inside generic types.
This release fixes an issue that prevented using lazy types inside generic types.
The following is now allowed:
T = TypeVar( "T" )
TypeAType = Annotated[ "TypeA" , strawberry.lazy( "tests.schema.test_lazy.type_a" )]
@strawberry.type
class Edge (Generic[T]):
node: T
@strawberry.type
class Query :
users: Edge[TypeAType]
Contributed by Patrick Arminio via PR #2254
These release allow you to define a different url in the GraphQLTestClient , the default is “/graphql/”.
These release allow you to define a different url in the GraphQLTestClient , the default is “/graphql/”.
Here’s an example with Starlette client:
import pytest
from starlette.testclient import TestClient
from strawberry.asgi.test import GraphQLTestClient
@pytest.fixture
def graphql_client () -> GraphQLTestClient:
return GraphQLTestClient(
TestClient(app, base_url = "http://localhost:8000" ), url = "/api/"
)
Contributed by Etty via PR #2238
Nothing published for this version
Nothing published for this version
This release fixes a type issue when passing scalar_overrides to strawberry.Schema
This release fixes a type issue when passing scalar_overrides to strawberry.Schema
Contributed by Patrick Arminio via PR #2251
Fix support for arguments where arg.type=LazyType["EnumType"]
Fix support for arguments where arg.type=LazyType["EnumType"]
Contributed by Paulo Costa via PR #2245
Nothing published for this version
This will prevent strawberry from triggering its own warning on deprecated imports.
Updated unset import, from strawberry.arguments to strawberry.unset in codebase.
This will prevent strawberry from triggering its own warning on deprecated imports.
Contributed by dependabot via PR #2219
This release fixes the type of strawberry.federation.field, this will prevent errors from mypy and pyright when doing the following:
This release fixes the type of strawberry.federation.field, this will prevent errors from mypy and pyright when doing the following:
@strawberry.federation.type ( keys =[ "id" ])
class Location :
id : strawberry.ID
celestial_body: CelestialBody = strawberry.federation.field(
resolver =resolve_celestial_body
)
Contributed by Patrick Arminio via PR #2222
This release allows to create a federation schema without having to pass a Query type. This is useful when your schema only extends some types without
This release allows to create a federation schema without having to pass a Query type. This is useful when your schema only extends some types without adding any additional root field.
@strawberry.federation.type ( keys =[ "id" ])
class Location :
id : strawberry.ID
name: str = strawberry.federation.field( override = "start" )
schema = strawberry.federation.Schema( types =[Location])
Contributed by Patrick Arminio via PR #2220
Nothing published for this version
Nothing published for this version
This release fixes an issue with strawberry.federation.field that prevented instantiating field when passing a resolver function.
This release fixes an issue with strawberry.federation.field that prevented instantiating field when passing a resolver function.
Contributed by Patrick Arminio via PR #2218
This release fixes an issue that prevented using strawberry.field with UNSET as the default value.
This release fixes an issue that prevented using strawberry.field with UNSET as the default value.
Contributed by Patrick Arminio via PR #2128
Reduce the number of required dependencies, by marking Pygments and python-multipart as optional. These dependencies are still necessary for some func
Reduce the number of required dependencies, by marking Pygments and python-multipart as optional. These dependencies are still necessary for some functionality, and so users of that functionality need to ensure they’re installed, either explicitly or via an extra:
Pygments is still necessary when using Strawberry in debug mode, and is included in the strawberry-graphql[debug-server] extra.
python-multipart is still necessary when using strawberry.file_uploads.Upload with FastAPI or Starlette, and is included in the strawberry-graphql[fastapi] and strawberry-graphql[asgi] extras, respectively.
There is now also the strawberry-graphql[cli] extra to support commands like strawberry codegen and strawberry export-schema .
Contributed by Huon Wilson via PR #2205
Improve resolving performance by avoiding extra calls for basic fields.
Improve resolving performance by avoiding extra calls for basic fields.
This change improves performance of resolving a query by skipping Info creation and permission checking for fields that don’t have a resolver or permission classes. In local benchmarks it improves performance of large results by ~14%.
Contributed by Jonathan Kim via PR #2194
Support storing metadata in strawberry fields.
Support storing metadata in strawberry fields.
Contributed by Paulo Costa via PR #2190
Nothing published for this version
Fixes false positives with the mypy plugin. Happened when to_pydantic was called on a type that was converted pydantic with all_fields=True.
Fixes false positives with the mypy plugin. Happened when to_pydantic was called on a type that was converted pydantic with all_fields=True.
Also fixes the type signature when to_pydantic is defined by the user.
from pydantic import BaseModel
from typing import Optional
import strawberry
class MyModel ( BaseModel ):
email: str
password: Optional[ str ]
@strawberry.experimental.pydantic.input ( model =MyModel, all_fields = True )
class MyModelStrawberry : ...
MyModelStrawberry( email = "" ).to_pydantic()
Contributed by James Chua via PR #2017
This release updates the mypy plugin and the typing for Pyright to treat all strawberry fields as keyword-only arguments. This reflects a previous cha
This release updates the mypy plugin and the typing for Pyright to treat all strawberry fields as keyword-only arguments. This reflects a previous change to the Strawberry API.
Contributed by Paulo Costa via PR #2191
Bug fix: Do not force kw-only=False in fields specified with strawberry.field()
Bug fix: Do not force kw-only=False in fields specified with strawberry.field()
Contributed by Paulo Costa via PR #2189
This release fixes a small issue that might happen when uploading files and not passing the operations object.
This release fixes a small issue that might happen when uploading files and not passing the operations object.
Contributed by Patrick Arminio via PR #2192
Your coding agent can read these notes before it upgrades. Set up the MCP server →