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 15 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.
Add —app-dir CLI option to specify where to find the schema module to load when using the debug server.
Add —app-dir CLI option to specify where to find the schema module to load when using the debug server.
For example if you have a schema module in a my_app package under ./src, then you can run the debug server with it using:
Terminal window
strawberry server --app-dir src my_app.schema
Add support for default and default_factory arguments in strawberry.field
Add support for default and default_factory arguments in strawberry.field
@strawberry.type
class Droid :
name: str = strawberry.field( default = "R2D2" )
aka: List[ str ] = strawberry.field( default_factory = lambda : [ "Artoo" ])
Renamed StrawberryArgument to StrawberryArgumentAnnotation
Your coding agent can read these notes before it upgrades. Set up the MCP server →
Internal refactoring.
Renamed StrawberryArgument to StrawberryArgumentAnnotation
Renamed ArgumentDefinition to StrawberryArgument
Renamed ArgumentDefinition(type: ...) argument to StrawberryArgument(type_: ...)
Fixed issue with django multipart/form-data uploads
Fixed issue with django multipart/form-data uploads
Fix issue where StrawberryField.graphql_name would always be camelCased
Fix issue where StrawberryField.graphql_name would always be camelCased
This release fixes an issue with the generated __eq__ and __repr__ methods when defining fields with resolvers.
This release fixes an issue with the generated eq and repr methods when defining fields with resolvers.
This now works properly:
@strawberry.type
class Query :
a: int
@strawberry.field
def name ( self ) -> str :
return "A"
assert Query( 1 ) == Query( 1 )
assert Query( 1 ) != Query( 2 )
Gracefully handle user-induced subscription errors.
Gracefully handle user-induced subscription errors.
- FieldDefinition has been absorbed into StrawberryField and now no longer exists.
FieldDefinition has been absorbed into StrawberryField and now no longer exists.
FieldDefinition.origin_name and FieldDefinition.name have been replaced with StrawberryField.python_name and StrawberryField.graphql_name . This should help alleviate some backend confusion about which should be used for certain situations.
strawberry.types.type_resolver.resolve_type has been split into resolve_type_argument and _resolve_type (for arguments) until StrawberryType is implemented to combine them back together. This was done to reduce the scope of this PR and defer changing ArgumentDefinition (future StrawberryArgument ) until a different PR.
Note: The constructor signature for StrawberryField has type_ as an argument instead of type as was the case for FieldDefinition . This is done to prevent shadowing of builtins.
Note: StrawberryField.name still exists because of the way dataclass Field s work, but is an alias for StrawberryField.python_name .
Include field_nodes in Strawberry info object.
Include field_nodes in Strawberry info object.
Change get_context to be async for sanic integration
Change get_context to be async for sanic integration
Configures GraphiQL to attach CSRF cookies as request headers sent to the GQL server.
Configures GraphiQL to attach CSRF cookies as request headers sent to the GQL server.
Expose Strawberry Info object instead of GraphQLResolveInfo in resolvers
Expose Strawberry Info object instead of GraphQLResolveInfo in resolvers
Django 3.2 support
Django 3.2 support
Raise exception when un-serializable payload is provided to the Django view.
Raise exception when un-serializable payload is provided to the Django view.
This release fixes a regression with the django sending the wrong content type.
This release fixes a regression with the django sending the wrong content type.
This release updates get_context in the django integration to also receive a temporal response object that can be used to set headers, cookies and sta
This release updates get_context in the django integration to also receive a temporal response object that can be used to set headers, cookies and status code.
@strawberry.type
class Query:
@strawberry.field
def abc(self, info: strawberry.Info) -> str:
info.context.response.status_code = 418
return "ABC"
This releases changes how we define resolvers internally, now we have one single resolver for async and sync code.
This releases changes how we define resolvers internally, now we have one single resolver for async and sync code.
Fix bug when using arguments inside a type that uses typing.Generics
Fix bug when using arguments inside a type that uses typing.Generics
This releases updates the ASGI class to make it easier to override get_http_response .
This releases updates the ASGI class to make it easier to override get_http_response .
get_http_response has been now removed from strawberry.asgi.http and been moved to be a method on the ASGI class.
A new get_graphiql_response method has been added to make it easier to provide a different GraphiQL interface.
This release updates get_context in the asgi integration to also receive a temporal response object that can be used to set headers and cookies.
This release updates get_context in the asgi integration to also receive a temporal response object that can be used to set headers and cookies.
This release fixes a bug when using the debug server and upload a file
This release fixes a bug when using the debug server and upload a file
Fix DataLoader docs typo.
Fix DataLoader docs typo.
Added support for sanic webserver.
Added support for sanic webserver.
ExecutionResult was erroneously defined twice in the repository. The entry in strawberry.schema.base has been removed. If you were using it, switch to using strawberry.types.ExecutionResult instead:
from strawberry.types import ExecutionResult
Enable using .get for django context as well as for the square brackets notation.
Enable using .get for django context as well as for the square brackets notation.
Enable dot notation for django context request
Enable dot notation for django context request
Supporting multipart file uploads on Flask
Supporting multipart file uploads on Flask
Expose execution info under strawberry.types.Info
Expose execution info under strawberry.types.Info
Fixes mypy failing when casting in enum decorator
Fixes mypy failing when casting in enum decorator
Suggest installing the debug server on the getting started docs, so examples can work without import errors of uvicorn
Suggest installing the debug server on the getting started docs, so examples can work without import errors of uvicorn
Fix Generic name generation to use the custom name specified in Strawberry if available
Fix Generic name generation to use the custom name specified in Strawberry if available
@strawberry.type ( name = "AnotherName" )
class EdgeName :
node: str
@strawberry.type
class Connection (Generic[T]):
edge: T
will result in AnotherNameConnection , and not EdgeNameConnection as before.
This release add the ability to disable query validation by setting validate_queries to False
This release add the ability to disable query validation by setting validate_queries to False
import strawberry
@strawberry.type
class Query :
@strawberry.field
def hello ( self ) -> str :
return "Hello"
schema = strawberry.Schema(Query, validate_queries =validate_queries)
This release adds support for MyPy==0.800
This release adds support for MyPy==0.800
Fix for a duplicated input types error.
Fix for a duplicated input types error.
Internal codebase refactor. Clean up, consolidate, and standardize the conversion layer between Strawberry types and GraphQL Core types; with room for
Internal codebase refactor. Clean up, consolidate, and standardize the conversion layer between Strawberry types and GraphQL Core types; with room for further future abstraction to support other GraphQL backends.
Improves typing when decorating an enum with kwargs like description and name. Adds more mypy tests.
Improves typing when decorating an enum with kwargs like description and name. Adds more mypy tests.
This releases fixes a wrong dependency issue
This releases fixes a wrong dependency issue
Supporting multipart uploads as described here: https://github.com/jaydenseric/graphql-multipart-request-spec for ASGI.
Supporting multipart uploads as described here: https://github.com/jaydenseric/graphql-multipart-request-spec for ASGI.
Fix Strawberry to handle multiple subscriptions at the same time
Fix Strawberry to handle multiple subscriptions at the same time
Pass execution_context_class to Schema creation
Pass execution_context_class to Schema creation
Add support for converting more pydantic types
Add support for converting more pydantic types
pydantic.EmailStr
pydantic.AnyUrl
pydantic.AnyHttpUrl
pydantic.HttpUrl
pydantic.PostgresDsn
pydantic.RedisDsn
This releases fixes an issue where methods marked as field were removed from the class.
This releases fixes an issue where methods marked as field were removed from the class.
Validate the schema when it is created instead of at runtime.
Validate the schema when it is created instead of at runtime.
This release adds support for strawberry.federation.field under mypy.
This release adds support for strawberry.federation.field under mypy.
Creation of a [debug-server] extra, which is required to get going quickly with this project!
Creation of a [debug-server] extra, which is required to get going quickly with this project!
pip install strawberry-graphql
Will now install the primary portion of of the framework, allowing you to build your GraphQL schema using the dataclasses pattern.
To get going quickly, you can install [debug-server] which brings along a server which allows you to develop your API dynamically, assuming your schema is defined in the app module:
pip install 'strawberry-graphql[debug-server]'
strawberry server app
Typically, in a production environment, you’d want to bring your own server :)
This release fixes an issue when using unions inside generic types, this is now supported:
This release fixes an issue when using unions inside generic types, this is now supported:
@strawberry.type
class Dog :
name: str
@strawberry.type
class Cat :
name: str
@strawberry.type
class Connection (Generic[T]):
nodes: List[T]
@strawberry.type
class Query :
connection: Connection[Union[Dog, Cat]]
This releases fixes an issue with Strawberry requiring Pydantic even when not used.
This releases fixes an issue with Strawberry requiring Pydantic even when not used.
This release adds support for creating types from Pydantic models. Here’s an example:
This release adds support for creating types from Pydantic models. Here’s an example:
import strawberry
from datetime import datetime
from typing import List, Optional
from pydantic import BaseModel
class UserModel ( BaseModel ):
id : int
name = "John Doe"
signup_ts: Optional[datetime] = None
friends: List[ int ] = []
@strawberry.experimental.pydantic.type (
model =UserModel, fields =[ "id" , "name" , "friends" ]
)
class UserType :
pass
Add some checks to make sure the types passed to .union are valid.
Add some checks to make sure the types passed to .union are valid.
Fix issue preventing reusing the same resolver for multiple fields, like here:
Fix issue preventing reusing the same resolver for multiple fields, like here:
def get_name ( self ) -> str :
return "Name"
@strawberry.type
class Query :
name: str = strawberry.field( resolver =get_name)
name_2: str = strawberry.field( resolver =get_name)
Another small improvement for mypy, this should prevent mypy from crashing when it can’t find a type
Another small improvement for mypy, this should prevent mypy from crashing when it can’t find a type
This release fixes another issue with mypy where it wasn’t able to identify strawberry fields. It also now knows that fields with resolvers aren’t put
This release fixes another issue with mypy where it wasn’t able to identify strawberry fields. It also now knows that fields with resolvers aren’t put in the init method of the class.
This release type improves support for strawberry.field in mypy, now we don’t get Attributes without a default cannot follow attributes with one when
This release type improves support for strawberry.field in mypy, now we don’t get Attributes without a default cannot follow attributes with one when using strawberry.field before a type without a default.
Bugfix to allow the use of UNSET as a default value for arguments.
Bugfix to allow the use of UNSET as a default value for arguments.
import strawberry
from strawberry.arguments import UNSET, is_unset
@strawberry.type
class Query :
@strawberry.field
def hello ( self , name : Optional[ str ] = UNSET) -> str :
if is_unset(name):
return "Hi there"
return "Hi {name} "
schema = strawberry.Schema( query =Query)
result = schema.execute_async( "{ hello }" )
assert result.data == { "hello" : "Hi there" }
result = schema.execute_async( '{ hello(name: "Patrick" }' )
assert result.data == { "hello" : "Hi Patrick" }
SDL:
type Query {
hello ( name : String ): String !
}
This release improves mypy support for strawberry.field
This release improves mypy support for strawberry.field
Completely revamped how resolvers are created, stored, and managed by StrawberryField. Now instead of monkeypatching a FieldDefinition object onto the
Completely revamped how resolvers are created, stored, and managed by StrawberryField. Now instead of monkeypatching a FieldDefinition object onto the resolver function itself, all resolvers are wrapped inside of a StrawberryResolver object with the useful properties.
arguments.get_arguments_from_resolver is now the StrawberryResolver.arguments property
Added a test to cover a situation where a field is added to a StrawberryType manually using dataclasses.field but not annotated. This was previously uncaught.
This release fixes an issue with forward types
This release fixes an issue with forward types
This release adds a built-in dataloader. Example:
This release adds a built-in dataloader. Example:
async def app ():
async def idx ( keys ):
return keys
loader = DataLoader( load_fn =idx)
[value_a, value_b, value_c] = await asyncio.gather(
loader.load( 1 ),
loader.load( 2 ),
loader.load( 3 ),
)
assert value_a == 1
assert value_b == 2
assert value_c == 3
Allow interfaces to implement other interfaces. This may be useful if you are using the relay pattern or if you want to model base interfaces that can
Allow interfaces to implement other interfaces. This may be useful if you are using the relay pattern or if you want to model base interfaces that can be extended.
Example:
import strawberry
@strawberry.interface
class Error :
message: str
@strawberry.interface
class FieldError ( Error ):
message: str
field: str
@strawberry.type
class PasswordTooShort ( FieldError ):
message: str
field: str
fix: str
Produces the following SDL:
interface Error {
message : String !
}
interface FieldError implements Error {
message : String !
field : String !
}
type PasswordTooShort implements FieldError & Error {
message : String !
field : String !
fix : String !
}
Fix mypy plugin to handle bug where the types argument to strawberry.union is passed in as a keyword argument instead of a position one.
Fix mypy plugin to handle bug where the types argument to strawberry.union is passed in as a keyword argument instead of a position one.
MyUnion = strawberry.union( types =(TypeA, TypeB), name = "MyUnion" )
This release adds a new AsyncGraphQLView for django.
This release adds a new AsyncGraphQLView for django.
One column per quarter.