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 fixes a bug in the subscription implementations that prevented clients from selecting one of multiple subscription operations from a quer
This release fixes a bug in the subscription implementations that prevented clients from selecting one of multiple subscription operations from a query. Client sent messages like the following one are now handled as expected.
{
"type" : "GQL_START" ,
"id" : "DEMO" ,
"payload" : {
"query" : "subscription Sub1 { sub1 } subscription Sub2 { sub2 }" ,
"operationName" : "Sub2"
}
}
Contributed by Jonathan Ehwald PR #1000
This release fixes the upload of nested file lists. Among other use cases, having an input type like shown below is now working properly.
This release fixes the upload of nested file lists. Among other use cases, having an input type like shown below is now working properly.
import typing
import strawberry
from strawberry.file_uploads import Upload
@strawberry.input
class FolderInput :
files: typing.List[Upload]
Contributed by Jonathan Ehwald PR #989
One column per quarter.
This release extends the file upload support of all integrations to support the upload of file lists.
This release extends the file upload support of all integrations to support the upload of file lists.
Here is an example how this would work with the ASGI integration.
import typing
import strawberry
from strawberry.file_uploads import Upload
@strawberry.type
class Mutation :
@strawberry.mutation
async def read_files ( self , files : typing.List[Upload]) -> typing.List[ str ]:
contents = []
for file in files:
content = ( await file.read()).decode()
contents.append(content)
return contents
Check out the documentation to learn how the same can be done with other integrations.
Contributed by Jonathan Ehwald PR #979
This release fixes that AIOHTTP subscription requests were not properly separated. This could lead to subscriptions terminating each other.
This release fixes that AIOHTTP subscription requests were not properly separated. This could lead to subscriptions terminating each other.
Contributed by Jonathan Ehwald PR #970
Remove usages of undefined in favour of UNSET
Remove usages of undefined in favour of UNSET
Change the signature of StrawberryField to make it easier to instantiate directly. Also change default_value argument to default
Rename default_value to default in StrawberryArgument
Contributed by Jonathan Kim PR #916
This release integrates the strawberry-graphql-django package into Strawberry core so that it’s possible to use the Django extension package directly
This release integrates the strawberry-graphql-django package into Strawberry core so that it’s possible to use the Django extension package directly via the strawberry.django namespace.
You still need to install strawberry-graphql-django if you want to use the extended Django support.
See: https://github.com/strawberry-graphql/strawberry-graphql-django
Contributed by Lauri Hintsala PR #949
This release fixes that enum values yielded from async generators were not resolved properly.
This release fixes that enum values yielded from async generators were not resolved properly.
Contributed by Jonathan Ehwald PR #969
This release fixes a max recursion depth error in the AIOHTTP subscription implementation.
This release fixes a max recursion depth error in the AIOHTTP subscription implementation.
Contributed by Jonathan Ehwald PR #966
This release adds an extensions field to the GraphQLHTTPResponse type and also exposes it in the view’s response.
This release adds an extensions field to the GraphQLHTTPResponse type and also exposes it in the view’s response.
This field gets populated by Strawberry extensions: https://strawberry.rocks/docs/guides/extensions#get-results
Contributed by lijok PR #903
Add root_value to ExecutionContext type so that it can be accessed in extensions.
Add root_value to ExecutionContext type so that it can be accessed in extensions.
Example:
import strawberry
from strawberry.extensions import Extension
class MyExtension ( Extension ):
def on_request_end ( self ):
root_value = self .execution_context.root_value
Contributed by Jonathan Kim PR #959
New deployment process to release new Strawberry releases
New deployment process to release new Strawberry releases
Marco Acierno PR #957
This release adds extra values to the ExecutionContext object so that it can be used by extensions and the Schema.process_errors function.
This release adds extra values to the ExecutionContext object so that it can be used by extensions and the Schema.process_errors function.
The full ExecutionContext object now looks like this:
from graphql import ExecutionResult as GraphQLExecutionResult
from graphql.error.graphql_error import GraphQLError
from graphql.language import DocumentNode as GraphQLDocumentNode
@dataclasses.dataclass
class ExecutionContext :
query: str
context: Any = None
variables: Optional[Dict[ str , Any]] = None
operation_name: Optional[ str ] = None
graphql_document: Optional[GraphQLDocumentNode] = None
errors: Optional[List[GraphQLError]] = None
result: Optional[GraphQLExecutionResult] = None
and can be accessed in any of the extension hooks:
from strawberry.extensions import Extension
class MyExtension ( Extension ):
def on_request_end ( self ):
result = self .execution_context.result
schema = strawberry.Schema( query =Query, extensions =[MyExtension])
Note: This release also removes the creation of an ExecutionContext object in the web framework views. If you were relying on overriding the get_execution_context function then you should change it to get_request_data and use the strawberry.http.parse_request_data function to extract the pieces of data needed from the incoming request.
This releases fixes an issue with the debug server that prevented the usage of dataloaders, see: https://github.com/strawberry-graphql/strawberry/issu
This releases fixes an issue with the debug server that prevented the usage of dataloaders, see: https://github.com/strawberry-graphql/strawberry/issues/940
This release adds support for GraphQL subscriptions to the AIOHTTP integration. Subscription support works out of the box and does not require any add
This release adds support for GraphQL subscriptions to the AIOHTTP integration. Subscription support works out of the box and does not require any additional configuration.
Here is an example how to get started with subscriptions in general. Note that by specification GraphQL schemas must always define a query, even if only subscriptions are used.
import asyncio
import typing
import strawberry
@strawberry.type
class Subscription :
@strawberry.subscription
async def count ( self , target : int = 100 ) -> typing.AsyncGenerator[ int , None ]:
for i in range (target):
yield i
await asyncio.sleep( 0.5 )
@strawberry.type
class Query :
@strawberry.field
def _unused ( self ) -> str :
return ""
schema = strawberry.Schema( subscription =Subscription, query =Query)
Fix @requires(fields: ["email"]) and @provides(fields: ["name"]) usage on a Federation field
Fix @requires(fields: ["email"]) and @provides(fields: ["name"]) usage on a Federation field
You can use @requires to specify which fields you need to resolve a field
import strawberry
@strawberry.federation.type ( keys =[ "id" ], extend = True )
class Product :
id : strawberry.ID = strawberry.federation.field( external = True )
code: str = strawberry.federation.field( external = True )
@ classmethod
def resolve_reference ( cls , id : strawberry.ID, code : str ):
return cls ( id = id , code =code)
@strawberry.federation.field ( requires =[ "code" ])
def my_code ( self ) -> str :
return self .code
@provides can be used to specify what fields are going to be resolved by the service itself without having the Gateway to contact the external service to resolve them.
This release adds support for the info param in resolve_reference:
This release adds support for the info param in resolve_reference:
@strawberry.federation.type ( keys =[ "upc" ])
class Product :
upc: str
info: str
@ classmethod
def resolve_reference ( cls , info , upc ):
return Product(upc, info)
Note: resolver reference is used when using Federation, similar to Apollo server’s __resolveReference
This release extends the strawberry server command to allow the specification of a schema symbol name within a module:
This release extends the strawberry server command to allow the specification of a schema symbol name within a module:
Terminal window
strawberry server mypackage.mymodule:myschema
The schema symbol name defaults to schema making this change backwards compatible.
This release adds file upload support to the Sanic integration. No additional configuration is required to enable file upload support.
This release adds file upload support to the Sanic integration. No additional configuration is required to enable file upload support.
The following example shows how a file upload based mutation could look like:
import strawberry
from strawberry.file_uploads import Upload
@strawberry.type
class Mutation :
@strawberry.mutation
def read_text ( self , text_file : Upload) -> str :
return text_file.read().decode()
This release adds an export-schema command to the Strawberry CLI. Using the command you can print your schema definition to your console. Pipes and re
This release adds an export-schema command to the Strawberry CLI. Using the command you can print your schema definition to your console. Pipes and redirection can be used to store the schema in a file.
Example usage:
Terminal window
strawberry export-schema mypackage.mymodule:myschema > schema.graphql
This release fixes an issue that prevented using source as name of an argument
This release fixes an issue that prevented using source as name of an argument
This release adds an aiohttp integration for Strawberry. The integration provides a GraphQLView class which can be used to integrate Strawberry with a
This release adds an aiohttp integration for Strawberry. The integration provides a GraphQLView class which can be used to integrate Strawberry with aiohttp:
import strawberry
from aiohttp import web
from strawberry.aiohttp.views import GraphQLView
@strawberry.type
class Query :
pass
schema = strawberry.Schema( query =Query)
app = web.Application()
app.router.add_route( "*" , "/graphql" , GraphQLView( schema =schema))
This release adds a function called create_type to create a Strawberry type from a list of fields.
This release adds a function called create_type to create a Strawberry type from a list of fields.
import strawberry
from strawberry.tools import create_type
@strawberry.field
def hello ( info ) -> str :
return "World"
def get_name ( info ) -> str :
return info.context.user.name
my_name = strawberry.field( name = "myName" , resolver =get_name)
Query = create_type( "Query" , [hello, my_name])
schema = strawberry.Schema( query =Query)
This release fixes an issue when using nested lists, this now works properly:
This release fixes an issue when using nested lists, this now works properly:
def get_polygons () -> List[List[ float ]]:
return [[ 2.0 , 6.0 ]]
@strawberry.type
class Query :
polygons: List[List[ float ]] = strawberry.field( resolver =get_polygons)
schema = strawberry.Schema( query =Query)
query = "{ polygons }"
result = schema.execute_sync(query, root_value =Query())
This release fixes support for generic types so that now we can also use generics for input types:
This release fixes support for generic types so that now we can also use generics for input types:
T = typing.TypeVar( "T" )
@strawberry.input
class Input ( typing .Generic[T]):
field: T
@strawberry.type
class Query :
@strawberry.field
def field ( self , input : Input[ str ]) -> str :
return input .field
This release fixes a bug that prevented from extending a generic type when passing a type, like here:
This release fixes a bug that prevented from extending a generic type when passing a type, like here:
T = typing.TypeVar( "T" )
@strawberry.interface
class Node ( typing .Generic[T]):
id : strawberry.ID
def _resolve ( self ) -> typing.Optional[T]:
return None
@strawberry.type
class Book (Node[ str ]):
name: str
@strawberry.type
class Query :
@strawberry.field
def books ( self ) -> typing.List[Book]:
return list ()
Fix converting pydantic objects to strawberry types using from_pydantic when having a falsy value like 0 or ”.
Fix converting pydantic objects to strawberry types using from_pydantic when having a falsy value like 0 or ”.
Add a process_errors method to strawberry.Schema which logs all exceptions during execution to a strawberry.execution logger.
Add a process_errors method to strawberry.Schema which logs all exceptions during execution to a strawberry.execution logger.
This release fixes the return type value from info argument of resolver.
This release fixes the return type value from info argument of resolver.
This release improves Pydantic support to support default values and factories.
This release improves Pydantic support to support default values and factories.
This release fixes the pydantic integration where you couldn’t convert objects to pydantic instance when they didn’t have a default value.
This release fixes the pydantic integration where you couldn’t convert objects to pydantic instance when they didn’t have a default value.
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
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.
Your coding agent can read these notes before it upgrades. Set up the MCP server →