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.
Improves tooling by updating pre-commit hooks and adding pre-commit to pyproject.toml .
Improves tooling by updating pre-commit hooks and adding pre-commit to pyproject.toml .
Add support for setting root_value in asgi.
Add support for setting root_value in asgi.
Usage:
schema = strawberry.Schema( query =Query)
app = strawberry.asgi.GraphQL(schema, root_value =Query())
Fix error when a subscription accepted input arguments
Fix error when a subscription accepted input arguments
Your coding agent can read these notes before it upgrades. Set up the MCP server →
This release add supports for named unions, now you can create a new union type by writing:
This release add supports for named unions, now you can create a new union type by writing:
Result = strawberry.union( "Result" , (A, B), description = "Example Result" )
This also improves the support for Union and Generic types, as it was broken before.
This release fixes a bug introduced by 0.24.0
This release fixes a bug introduced by 0.24.0
This releases allows to use resolver without having to specify root and info arguments:
This releases allows to use resolver without having to specify root and info arguments:
def function_resolver () -> str :
return "I'm a function resolver"
def function_resolver_with_params ( x : str ) -> str :
return f "I'm { x } "
@strawberry.type
class Query :
hello: str = strawberry.field( resolver =function_resolver)
hello_with_params: str = strawberry.field( resolver =function_resolver_with_params)
@strawberry.type
class Query :
@strawberry.field
def hello ( self ) -> str :
return "I'm a function resolver"
@strawberry.field
def hello_with_params ( self , x : str ) -> str :
return f "I'm { x } "
This makes it easier to reuse existing functions and makes code cleaner when not using info or root.
This release fixes the dependency of GraphQL-core
This release fixes the dependency of GraphQL-core
This releases updates the debug server to serve the API on ’/’ as well as ‘/graphql’.
This releases updates the debug server to serve the API on ’/’ as well as ‘/graphql’.
Removes the need for duplicate graphiql template file.
Removes the need for duplicate graphiql template file.
This releases replaces the playground with GraphiQL including the GraphiQL explorer plugin.
This releases replaces the playground with GraphiQL including the GraphiQL explorer plugin.
This release adds support for generic types, allowing to reuse types, here’s an example:
This release adds support for generic types, allowing to reuse types, here’s an example:
T = typing.TypeVar( "T" )
@strawberry.type
class Edge ( typing .Generic[T]):
cursor: strawberry.ID
node: T
@strawberry.type
class Query :
@strawberry.field
def int_edge ( self , info , ** kwargs ) -> Edge[ int ]:
return Edge( cursor =strawberry.ID( "1" ), node = 1 )
Update version of graphql-core to 3.1.0b2
Update version of graphql-core to 3.1.0b2
Added a Flask view that allows you to query the schema and interact with it via GraphiQL.
Added a Flask view that allows you to query the schema and interact with it via GraphiQL.
Usage:
app.py
from strawberry.flask.views import GraphQLView
from your_project.schema import schema
app = Flask( name )
app.add_url_rule(
"/graphql" , view_func =GraphQLView.as_view( "graphql_view" , schema =schema)
)
if name == "main" :
app.run( debug = True )
Improve datetime, date and time types conversion. Removes aniso dependency and also adds support for python types, so now we can do use python datetim
Improve datetime, date and time types conversion. Removes aniso dependency and also adds support for python types, so now we can do use python datetime’s types instead of our custom scalar types.
This version adds support for Django 3.0
This version adds support for Django 3.0
- Fix autogenerated return argument bug
Fix directives bugs:
Fix autogenerated return argument bug
Fix include and skip failure bug
This release improves support for permissions (it is a breaking change). Now you will receive the source and the arguments in the has_permission metho…
This release improves support for permissions (it is a breaking change). Now you will receive the source and the arguments in the has_permission method, so you can run more complex permission checks. It also allows to use permissions on fields, here’s an example:
import strawberry
from strawberry.permission import BasePermission
class IsAdmin ( BasePermission ):
message = "You are not authorized"
def has_permission ( self , source , info ):
return source.name.lower() == "Patrick" or _is_admin(info)
@strawberry.type
class User :
name: str
email: str = strawberry.field( permission_classes =[IsAdmin])
@strawberry.type
class Query :
@strawberry.field ( permission_classes =[IsAdmin])
def user ( self , info ) -> str :
return User( name = "Patrick" , email = "example@email.com" )
This releases removes support for async resolver in django as they causes issues when accessing the databases.
This releases removes support for async resolver in django as they causes issues when accessing the databases.
This release improves support for django and asgi integration.
This release improves support for django and asgi integration.
It allows to use async resolvers when using django. It also changes the status code from 400 to 200 even if there are errors this makes it possible to still use other fields even if one raised an error.
We also moved strawberry.contrib.django to strawberry.django, so if you’re using the django view make sure you update the paths.
Fix missing support for booleans when converting arguments
Fix missing support for booleans when converting arguments
This releases fixes an issue when converting complex input types, now it should support lists of complex types properly.
This releases fixes an issue when converting complex input types, now it should support lists of complex types properly.
Set is_type_of only when the type implements an interface, this allows to return different (but compatible) types in basic cases.
Set is_type_of only when the type implements an interface, this allows to return different (but compatible) types in basic cases.
Refactored CLI folder structure, importing click commands from a subfolder. Follows click’s complex example.
Refactored CLI folder structure, importing click commands from a subfolder. Follows click’s complex example.
Add support for custom GraphQL scalars.
Add support for custom GraphQL scalars.
Tests are now run on GitHub actions on both python 3.7 and python3.8 🐍
Tests are now run on GitHub actions on both python 3.7 and python3.8 🐍
Fixed some typos in contributing.md .
Fixed some typos in contributing.md .
Fixed some typos in readme.md and contributing.md.
Fixed some typos in readme.md and contributing.md.
Minimal support for registering types without fields and abstract interface querying.
Minimal support for registering types without fields and abstract interface querying.
Grammar fixes - changed ‘corresponding tests, if tests’ to ‘corresponding tests. If tests’ and removed extraneous period from ‘Provide specific exampl
Grammar fixes - changed ‘corresponding tests, if tests’ to ‘corresponding tests. If tests’ and removed extraneous period from ‘Provide specific examples to demonstrate the steps..’. Also made ‘Enhancement’ lowercase to stay consistent with its usage in documentation and changed ‘on the Strawberry’ to ‘to Strawberry’.
Added issue template files (bug_report.md, feature_request.md, other_issues.md) and a pull request template file.
Added issue template files (bug_report.md, feature_request.md, other_issues.md) and a pull request template file.
Fix execution of async resolvers.
Fix execution of async resolvers.
Typo fix - changed the spelling from ‘follwing’ to ‘following’.
Typo fix - changed the spelling from ‘follwing’ to ‘following’.
Updated docs to provide reference on how to use Django view.
Updated docs to provide reference on how to use Django view.
Removed custom representation for Strawberry types, this should make using types much nicer.
Removed custom representation for Strawberry types, this should make using types much nicer.
Switched from graphql-core-next dependency to graphql-core@^3.0.0a0 .
Switched from graphql-core-next dependency to graphql-core@^3.0.0a0 .
Fixes MYPY plugin
Fixes MYPY plugin
Add the flake8-bugbear linting plugin to catch likely bugs
Add the flake8-bugbear linting plugin to catch likely bugs
Fixed conversion of enum when value was falsy.
Fixed conversion of enum when value was falsy.
Fixed issue when trying to convert optional arguments to a type
Fixed issue when trying to convert optional arguments to a type
Fix issue with converting arguments with optional fields.
Fix issue with converting arguments with optional fields.
Thanks to @sciyoshi for the fix!
Added a Django view that allows you to query the schema and interact with it via GraphiQL
Added a Django view that allows you to query the schema and interact with it via GraphiQL
Usage:
settings.py
INSTALLED_APPS = [
...,
"strawberry.django" ,
]
from strawberry.django.views import GraphQLView
from your_project.schema import schema
urlpatterns = [
path( "graphql/" , GraphQLView.as_view( schema =schema)),
]
This release doesn’t add any feature or fixes, but it fixes an issue with checking for release files when submitting PRs ✨.
This release doesn’t add any feature or fixes, but it fixes an issue with checking for release files when submitting PRs ✨.
Fixes the conversion of Enums in resolvers, arguments and input types.
Fixes the conversion of Enums in resolvers, arguments and input types.
Add a mypy plugin that enables typechecking Strawberry types
Add a mypy plugin that enables typechecking Strawberry types
Fix List types being converted to Optional GraphQL lists.
Fix List types being converted to Optional GraphQL lists.
This release doesn’t add any feature or fixes, it only introduces a GitHub Action to let people know how to add a RELEASE.md file when submitting a PR
This release doesn’t add any feature or fixes, it only introduces a GitHub Action to let people know how to add a RELEASE.md file when submitting a PR.
Added support for defining query directives, example:
Added support for defining query directives, example:
import strawberry
from strawberry.directive import DirectiveLocation
@strawberry.type
class Query :
cake: str = "made_in_switzerland"
@strawberry.directive (
locations =[DirectiveLocation.FIELD], description = "Make string uppercase"
)
def uppercase ( value : str , example : str ):
return value.upper()
schema = strawberry.Schema( query =Query, directives =[uppercase])
Improve dict_to_type conversion by checking if the field has a different name or case
Improve dict_to_type conversion by checking if the field has a different name or case
Fix field initialization not allowed when using strawberry.field in an input type
Fix field initialization not allowed when using strawberry.field in an input type
@strawberry.input
class Say :
what = strawberry.field( is_input = True )
Allow the usage of Union types in the mutations
Allow the usage of Union types in the mutations
@strawberry.type
class A :
x: int
@strawberry.type
class B :
y: int
@strawberry.type
class Mutation :
@strawberry.mutation
def hello ( self , info ) -> Union[A, B]:
return B( y = 5 )
schema = strawberry.Schema( query =A, mutation =Mutation)
query = """
mutation {
hello {
__typename
... on A {
x
}
... on B {
y
}
}
}
"""
Fix missing fields when extending a class, now we can do this:
Fix missing fields when extending a class, now we can do this:
@strawberry.type
class Parent :
cheese: str = "swiss"
@strawberry.field
def friend ( self , info ) -> str :
return "food"
@strawberry.type
class Schema ( Parent ):
cake: str = "made_in_swiss"
This release adds field support for permissions
This release adds field support for permissions
import strawberry
from strawberry.permission import BasePermission
class IsAdmin ( BasePermission ):
message = "You are not authorized"
def has_permission ( self , info ):
return False
@strawberry.type
class Query :
@strawberry.field ( permission_classes =[IsAdmin])
def hello ( self , info ) -> str :
return "Hello"
This releases adds support for ASGI 3.0
This releases adds support for ASGI 3.0
from strawberry.asgi import GraphQL
from starlette.applications import Starlette
graphql_app = GraphQL(schema_module.schema, debug = True )
app = Starlette( debug = True )
app.add_route( "/graphql" , graphql_app)
app.add_websocket_route( "/graphql" , graphql_app)
Added support for optional fields with default arguments in the GraphQL schema when default arguments are passed to the resolver.
Added support for optional fields with default arguments in the GraphQL schema when default arguments are passed to the resolver.
Example:
@strawberry.type
class Query :
@strawberry.field
def hello ( self , info , name : str = "world" ) -> str :
return name
type Query {
hello ( name : String = "world" ): String
}
Fixed issue that was prevent usage of InitVars. Now you can safely use InitVar to prevent fields from showing up in the schema:
Fixed issue that was prevent usage of InitVars. Now you can safely use InitVar to prevent fields from showing up in the schema:
@strawberry.type
class Category :
name: str
id : InitVar[ str ]
@strawberry.type
class Query :
@strawberry.field
def category ( self , info ) -> Category:
return Category( name = "example" , id = "123" )
Fixed logo on PyPI
Fixed logo on PyPI
Added support for passing resolver functions
Added support for passing resolver functions
def resolver ( root , info , par : str ) -> str :
return f "hello { par } "
@strawberry.type
class Query :
example: str = strawberry.field( resolver =resolver)
Also we updated some of the dependencies of the project
Added support for renaming fields. Example usage:
Added support for renaming fields. Example usage:
@strawberry.type
class Query :
example: str = strawberry.field( name = "test" )
Added support for declaring interface by using @strawberry.interface Example:
Added support for declaring interface by using @strawberry.interface Example:
@strawberry.interface
class Node :
id : strawberry.ID
This changes field to be lazy by default, allowing to use circular dependencies when declaring types.
This changes field to be lazy by default, allowing to use circular dependencies when declaring types.
One column per quarter.