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
04 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
1125 releases · first in 2019
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.
One column per quarter.
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.
Improve typing for field and StrawberryField .
Improve typing for field and StrawberryField .
This release disable implicit re-export of modules. This fixes Strawberry for you if you were using implicit_reexport = False in your MyPy config.
This release disable implicit re-export of modules. This fixes Strawberry for you if you were using implicit_reexport = False in your MyPy config.
This fixes the prettier pre-lint check.
This fixes the prettier pre-lint check.
Fix issue when using strawberry.enum(module.EnumClass) in mypy
Fix issue when using strawberry.enum(module.EnumClass) in mypy
This release adds support to mark a field as deprecated via deprecation_reason
This release adds support to mark a field as deprecated via deprecation_reason
Set default value to null in the schema when it’s set to None
Set default value to null in the schema when it’s set to None
⚠️ This is a potential breaking change because inputs of type UUID are now parsed as instances of uuid.UUID instead of strings as they were before.
Register UUID’s as a custom scalar type instead of the ID type.
⚠️ This is a potential breaking change because inputs of type UUID are now parsed as instances of uuid.UUID instead of strings as they were before.
This release fixes a bug when returning list in async resolvers
This release fixes a bug when returning list in async resolvers
This release improves how we check for enums
This release improves how we check for enums
This release improves how we handle enum values when returning lists of enums.
This release improves how we handle enum values when returning lists of enums.
This releases adds a workaround to prevent mypy from crashing in specific occasions
This releases adds a workaround to prevent mypy from crashing in specific occasions
This release fixes an issue preventing to return enums in lists
This release fixes an issue preventing to return enums in lists
This release improves support for strawberry.enums when type checking with mypy.
This release improves support for strawberry.enums when type checking with mypy.
Fix ASGI view to call get_context during a websocket request
Fix ASGI view to call get_context during a websocket request
Add support for adding a description to field arguments using the Annotated type:
Add support for adding a description to field arguments using the Annotated type:
from typing import Annotated
@strawberry.type
class Query :
@strawberry.field
def user_by_id (
id : Annotated[ str , strawberry.argument( description = "The ID of the user" )],
) -> User: ...
which results in the following schema:
type Query {
userById (
"""The ID of the user"""
id : String
): User !
}
Note: if you are not using Python v3.9 or greater you will need to import Annotated from typing_extensions
This release adds support for using strawberry.enum as a function with MyPy, this is now valid typed code:
This release adds support for using strawberry.enum as a function with MyPy, this is now valid typed code:
from enum import Enum
import strawberry
class IceCreamFlavour ( Enum ):
VANILLA = "vanilla"
STRAWBERRY = "strawberry"
CHOCOLATE = "chocolate"
Flavour = strawberry.enum(IceCreamFlavour)
Extend support for parsing isoformat datetimes, adding a dependency on the dateutil library. For example: “2020-10-12T22:00:00.000Z” can now be parsed
Extend support for parsing isoformat datetimes, adding a dependency on the dateutil library. For example: “2020-10-12T22:00:00.000Z” can now be parsed as a datetime with a UTC timezone.
Add schema.introspect() method to return introspection result of the schema. This might be useful for tools like apollo codegen or graphql-voyager whi
Add schema.introspect() method to return introspection result of the schema. This might be useful for tools like apollo codegen or graphql-voyager which expect a full json representation of the schema
This releases adds a new extension for OpenTelemetry.
This releases adds a new extension for OpenTelemetry.
import asyncio
from opentelemetry import trace
from opentelemetry.sdk.trace import TracerProvider
from opentelemetry.sdk.trace.export import (
ConsoleSpanExporter,
SimpleExportSpanProcessor,
)
import strawberry
from strawberry.extensions.tracing import OpenTelemetryExtension
trace.set_tracer_provider(TracerProvider())
trace.get_tracer_provider().add_span_processor(
SimpleExportSpanProcessor(ConsoleSpanExporter())
)
@strawberry.type
class User :
name: str
@strawberry.type
class Query :
@strawberry.field
async def user ( self , name : str ) -> User:
await asyncio.sleep( 0.1 )
return User(name)
schema = strawberry.Schema(Query, extensions =[OpenTelemetryExtension])
This release disables tracing for default resolvers and introspection queries
This release disables tracing for default resolvers and introspection queries
This releases allows UNSET to be used anywhere and prevents mypy to report an error.
This releases allows UNSET to be used anywhere and prevents mypy to report an error.
This releases adds support for strawberry.union inside mypy.
This releases adds support for strawberry.union inside mypy.
This release fixes an issue with the extension runner and async resolvers
This release fixes an issue with the extension runner and async resolvers
Fixed bug where you couldn’t use the same Union type multiple times in a schema.
Fixed bug where you couldn’t use the same Union type multiple times in a schema.
Added strawberry.Private type to mark fields as “private” so they don’t show up in the GraphQL schema.
Added strawberry.Private type to mark fields as “private” so they don’t show up in the GraphQL schema.
Example:
import strawberry
@strawberry.type
class User :
age: strawberry.Private[ int ]
@strawberry.field
def age_in_months ( self ) -> int :
return self .age * 12
Fix typo in type_resolver.py
Fix typo in type_resolver.py
This release fixes an issue with mypy when doing the following:
This release fixes an issue with mypy when doing the following:
import strawberry
@strawberry.type
class User :
name: str = strawberry.field( description = "Example" )
This release adds support for Apollo Tracing and support for creating Strawberry extensions, here’s how you can enable Apollo tracing:
This release adds support for Apollo Tracing and support for creating Strawberry extensions, here’s how you can enable Apollo tracing:
from strawberry.extensions.tracing import ApolloTracingExtension
schema = strawberry.Schema( query =Query, extensions =[ApolloTracingExtension])
And here’s an example of custom extension:
from strawberry.extensions import Extension
class MyExtension ( Extension ):
def get_results ( self ):
return { "example" : "this is an example for an extension" }
schema = strawberry.Schema( query =Query, extensions =[MyExtension])
This release fixes an issue when trying to print a type with a UNSET default value
This release fixes an issue when trying to print a type with a UNSET default value
UnionDefinition has been renamed to StrawberryUnion
UnionDefinition has been renamed to StrawberryUnion
strawberry.union now returns an instance of StrawberryUnion instead of a dynamically generated class instance with a _union_definition attribute of type UnionDefinition .
Your coding agent can read these notes before it upgrades. Set up the MCP server →