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.
This release adds missing packaging dependency required by DatadogTracingExtension
This release adds missing packaging dependency required by DatadogTracingExtension
Releases contributed by @jakub-bacic via #3803
This release adds missing packaging dependency required by DatadogTracingExtension
Contributed by Jakub Bacic via PR #3803
This release updates the handling of the Django graphql/graphiql.html template, if provided; it will now receive the current request as context.
This release updates the handling of the Django graphql/graphiql.html template, if provided; it will now receive the current request as context.
Releases contributed by @sersorrel via #3800
Your coding agent can read these notes before it upgrades. Set up the MCP server →
This release updates the handling of the Django graphql/graphiql.html template, if provided; it will now receive the current request as context.
This release adds support for exporting schema created by a callable:
This release adds support for exporting schema created by a callable:
strawberry export-schema package.module:create_schema
when
def create_schema():
return strawberry.Schema(query=Query)
Releases contributed by @alexey-pelykh via #3797
This release adds support for exporting schema created by a callable:
strawberry export-schema package.module:create_schema
when
def create_schema():
return strawberry.Schema(query=Query)
Contributed by Alexey Pelykh via PR #3797
This release adds support for exporting schema created by a callable:
Terminal window
strawberry export-schema package.module:create_schema
when
def create_schema ():
return strawberry.Schema( query =Query)
Contributed by Alexey Pelykh via PR #3797
This release updates the Python version requirement to use python >= 3.9 instead of ^3.9 to avoid conflicts with other projects that use >= 3.x
This release updates the Python version requirement to use python >= 3.9 instead of ^3.9 to avoid conflicts with other projects that use >= 3.x
Releases contributed by @PaleNeutron via #3789
This release updates the Python version requirement to use python >= 3.9 instead of ^3.9 to avoid conflicts with other projects that use >= 3.x
This release adds support for type[strawberry.UNSET] in addition to strawberry.types.unset.UnsetType for annotations.
This release adds support for type[strawberry.UNSET] in addition to strawberry.types.unset.UnsetType for annotations.
@strawberry.type
class User:
name: str | None = UNSET
age: int | None | type[strawberry.UNSET] = UNSET
Releases contributed by @alexey-pelykh via #3765
This release adds support for type[strawberry.UNSET] in addition to strawberry.types.unset.UnsetType for annotations.
@strawberry.type
class User:
name: str | None = UNSET
age: int | None | type[strawberry.UNSET] = UNSET
Contributed by Alexey Pelykh via PR #3765
This release adds support for Datadog ddtrace v3.0.0 in the DatadogTracingExtension
This release adds support for Datadog ddtrace v3.0.0 in the DatadogTracingExtension
Releases contributed by @jonfinerty via #3794
This release adds support for Datadog ddtrace v3.0.0 in the DatadogTracingExtension
Contributed by Jon Finerty via PR #3794
This release fixes the issue that some subscription resolvers were not canceled if a client unexpectedly disconnected.
This release fixes the issue that some subscription resolvers were not canceled if a client unexpectedly disconnected.
Releases contributed by @jakub-bacic via #3778
This release fixes the issue that some subscription resolvers were not canceled if a client unexpectedly disconnected.
Contributed by Jakub Bacic via PR #3778
This release fixes an issue where directives with input types using snake_case would not be printed in the schema.
This release fixes an issue where directives with input types using snake_case would not be printed in the schema.
For example, the following:
@strawberry.input
class FooInput:
hello: str
hello_world: str
@strawberry.schema_directive(locations=[Location.FIELD_DEFINITION])
class FooDirective:
input: FooInput
@strawberry.type
class Query:
@strawberry.field(
directives=[
FooDirective(input=FooInput(hello="hello", hello_world="hello world")),
]
)
def foo(self, info) -> str: ...
Would previously print as:
directive @fooDirective(
input: FooInput!
optionalInput: FooInput
) on FIELD_DEFINITION
type Query {
foo: String! @fooDirective(input: { hello: "hello" })
}
input FooInput {
hello: String!
hello_world: String!
}
Now it will be correctly printed as:
directive @fooDirective(
input: FooInput!
optionalInput: FooInput
) on FIELD_DEFINITION
type Query {
foo: String!
@fooDirective(input: { hello: "hello", helloWorld: "hello world" })
}
input FooInput {
hello: String!
hello_world: String!
}
Releases contributed by @bellini666 via #3780
This release fixes an issue where extensions were being duplicated when custom directives were added to the schema. Previously, when user directives w
This release fixes an issue where extensions were being duplicated when custom directives were added to the schema. Previously, when user directives were present, extensions were being appended twice to the extension list, causing them to be executed multiple times during query processing.
The fix ensures that extensions are added only once and maintains their original order. Test cases have been added to validate this behavior and ensure extensions are executed exactly once.
Releases contributed by @doney-dkp via #3783
Support aliases (TypeVar passthrough) in get_specialized_type_var_map.
Support aliases (TypeVar passthrough) in get_specialized_type_var_map.
Releases contributed by @alexey-pelykh via #3766
Support aliases (TypeVar passthrough) in get_specialized_type_var_map.
Contributed by Alexey Pelykh via PR #3766
This release adjusts the context_getter attribute from the fastapi GraphQLRouter to accept an async callables.
This release adjusts the context_getter attribute from the fastapi GraphQLRouter
to accept an async callables.
Releases contributed by @alexey-pelykh via #3763
This release adjusts the context_getter attribute from the fastapi GraphQLRouter
to accept an async callables.
Contributed by Alexey Pelykh via PR #3763
This release refactors some of the internal execution logic by:
This release refactors some of the internal execution logic by:
This is an internal refactor that should not affect the public API or functionality. The changes make the codebase simpler and easier to maintain.
Releases contributed by @patrick91 via #3771
This release refactors some of the internal execution logic by:
Moving execution logic from separate files into schema.py for better organization
Using graphql-core’s parse and validate functions directly instead of wrapping them
Removing redundant execute.py and subscribe.py files
This is an internal refactor that should not affect the public API or functionality. The changes make the codebase simpler and easier to maintain.
Contributed by Patrick Arminio via PR #3771
This release adjusts the schema printer to avoid printing a schema directive value set to UNSET as "" (empty string).
This release adjusts the schema printer to avoid printing a schema directive
value set to UNSET as "" (empty string).
For example, the following:
@strawberry.input
class FooInput:
a: str | None = strawberry.UNSET
b: str | None = strawberry.UNSET
@strawberry.schema_directive(locations=[Location.FIELD_DEFINITION])
class FooDirective:
input: FooInput
@strawberry.type
class Query:
@strawberry.field(directives=[FooDirective(input=FooInput(a="aaa"))])
def foo(self, info) -> str: ...
Would previously print as:
directive @fooDirective(
input: FooInput!
optionalInput: FooInput
) on FIELD_DEFINITION
type Query {
foo: String! @fooDirective(input: { a: "aaa", b: "" })
}
input FooInput {
a: String
b: String
}
Now it will be correctly printed as:
directive @fooDirective(
input: FooInput!
optionalInput: FooInput
) on FIELD_DEFINITION
type Query {
foo: String! @fooDirective(input: { a: "aaa" })
}
input FooInput {
a: String
b: String
}
Releases contributed by @bellini666 via #3770
Add the ability to override the "max results" a relay's connection can return on a per-field basis.
Add the ability to override the "max results" a relay's connection can return on a per-field basis.
The default value for this is defined in the schema's config, and set to 100
unless modified by the user. Now, that per-field value will take precedence over
it.
For example:
@strawerry.type
class Query:
# This will still use the default value in the schema's config
fruits: ListConnection[Fruit] = relay.connection()
# This will reduce the maximum number of results to 10
limited_fruits: ListConnection[Fruit] = relay.connection(max_results=10)
# This will increase the maximum number of results to 10
higher_limited_fruits: ListConnection[Fruit] = relay.connection(max_results=10_000)
Note that this only affects ListConnection and subclasses. If you are
implementing your own connection resolver, there's an extra keyword named
max_results: int | None that will be passed to it.
Releases contributed by @bellini666 via #3746
The common node: Node used to resolve relay nodes means we will be relying on is_type_of to check if the returned object is in fact a subclass of the
The common node: Node used to resolve relay nodes means we will be relying on
is_type_of to check if the returned object is in fact a subclass of the Node
interface.
However, integrations such as Django, SQLAlchemy and Pydantic will not return the type itself, but instead an alike object that is later resolved to the expected type.
In case there are more than one possible type defined for that model that is
being returned, the first one that replies True to is_type_of check would be
used in the resolution, meaning that when asking for "PublicUser:123",
strawberry could end up returning "User:123", which can lead to security
issues (such as data leakage).
In here we are introducing a new strawberry.cast, which will be used to mark
an object with the already known type by us, and when asking for is_type_of that
mark will be used to check instead, ensuring we will return the correct type.
That cast is already in place for the relay node resolution and pydantic.
Releases contributed by @bellini666 via #3749
Nothing published for this version
Support for supplying keyword arguments to pathlib.PurePath is deprecated and scheduled for removal in Python 3.14
This release updates Strawberry internally to no longer pass keywords arguments
to pathlib.PurePath. Support for supplying keyword arguments to
pathlib.PurePath is deprecated and scheduled for removal in Python 3.14
Releases contributed by @DoctorJohn via #3738
This release updates Strawberry internally to no longer pass keywords arguments
to pathlib.PurePath. Support for supplying keyword arguments to
pathlib.PurePath is deprecated and scheduled for removal in Python 3.14
Contributed by Jonathan Ehwald via PR #3738
We strongly recommend upgrading to Python 3.9 or a newer version, as older versions are no longer maintained and may contain security vulnerabilities.
This release drops support for Python 3.8, which reached its end-of-life (EOL) in October 2024. The minimum supported Python version is now 3.9.
We strongly recommend upgrading to Python 3.9 or a newer version, as older versions are no longer maintained and may contain security vulnerabilities.
Releases contributed by @bellini666 via #3730
This release drops support for Python 3.8, which reached its end-of-life (EOL) in October 2024. The minimum supported Python version is now 3.9.
We strongly recommend upgrading to Python 3.9 or a newer version, as older versions are no longer maintained and may contain security vulnerabilities.
Contributed by Thiago Bellini Ribeiro via PR #3730
This release adds support for making Relay connection optional, this is useful when you want to add permission classes to the connection and not fail
This release adds support for making Relay connection optional, this is useful when you want to add permission classes to the connection and not fail the whole query if the user doesn't have permission to access the connection.
Example:
import strawberry
from strawberry import relay
from strawberry.permission import BasePermission
class IsAuthenticated(BasePermission):
message = "User is not authenticated"
# This method can also be async!
def has_permission(
self, source: typing.Any, info: strawberry.Info, **kwargs
) -> bool:
return False
@strawberry.type
class Fruit(relay.Node):
code: relay.NodeID[int]
name: str
weight: float
@classmethod
def resolve_nodes(
cls,
*,
info: strawberry.Info,
node_ids: Iterable[str],
):
return []
@strawberry.type
class Query:
node: relay.Node = relay.node()
@relay.connection(
relay.ListConnection[Fruit] | None, permission_classes=[IsAuthenticated()]
)
def fruits(self) -> Iterable[Fruit]:
# This can be a database query, a generator, an async generator, etc
return all_fruits.values()
Releases contributed by @patrick91 via #3707
This release updates the Context and RootValue vars to have a default value of None, this makes it easier to use the views without having to pass in a
This release updates the Context and RootValue vars to have
a default value of None, this makes it easier to use the views
without having to pass in a value for these vars.
Releases contributed by @patrick91 via #3732
This release updates the Context and RootValue vars to have
a default value of None, this makes it easier to use the views
without having to pass in a value for these vars.
Contributed by Patrick Arminio via PR #3732
This release adds a new on_ws_connect method to all HTTP view integrations. The method is called when a graphql-transport-ws or graphql-ws connection
This release adds a new on_ws_connect method to all HTTP view integrations.
The method is called when a graphql-transport-ws or graphql-ws connection is
established and can be used to customize the connection acknowledgment behavior.
This is particularly useful for authentication, authorization, and sending a custom acknowledgment payload to clients when a connection is accepted. For example:
class MyGraphQLView(GraphQLView):
async def on_ws_connect(self, context: Dict[str, object]):
connection_params = context["connection_params"]
if not isinstance(connection_params, dict):
# Reject without a custom graphql-ws error payload
raise ConnectionRejectionError()
if connection_params.get("password") != "secret:
# Reject with a custom graphql-ws error payload
raise ConnectionRejectionError({"reason": "Invalid password"})
if username := connection_params.get("username"):
# Accept with a custom acknowledgement payload
return {"message": f"Hello, {username}!"}
# Accept without a acknowledgement payload
return await super().on_ws_connect(context)
Take a look at our documentation to learn more.
Releases contributed by @DoctorJohn via #3720
Description: Fixed a bug in the OpenTelemetryExtension class where the _span_holder dictionary was incorrectly shared across all instances. This was c
Description: Fixed a bug in the OpenTelemetryExtension class where the _span_holder dictionary was incorrectly shared across all instances. This was caused by defining _span_holder as a class-level attribute with a mutable default value (dict()).
Releases contributed by @conglei via #3716
Description: Fixed a bug in the OpenTelemetryExtension class where the _span_holder dictionary was incorrectly shared across all instances. This was caused by defining _span_holder as a class-level attribute with a mutable default value (dict()).
In this release, the return types of the get_root_value and get_context methods were updated to be consistent across all view integrations. Before thi
In this release, the return types of the get_root_value and get_context
methods were updated to be consistent across all view integrations. Before this
release, the return types used by the ASGI and Django views were too generic.
Releases contributed by @DoctorJohn via #3712
In this release, the return types of the get_root_value and get_context
methods were updated to be consistent across all view integrations. Before this
release, the return types used by the ASGI and Django views were too generic.
Contributed by Jonathan Ehwald via PR #3712
The view classes of all integrations now have a decode_json method that allows you to customize the decoding of HTTP JSON requests.
The view classes of all integrations now have a decode_json method that allows
you to customize the decoding of HTTP JSON requests.
This is useful if you want to use a different JSON decoder, for example, to optimize performance.
Releases contributed by @DoctorJohn via #3709
The view classes of all integrations now have a decode_json method that allows
you to customize the decoding of HTTP JSON requests.
This is useful if you want to use a different JSON decoder, for example, to optimize performance.
Contributed by Jonathan Ehwald via PR #3709
Starting with this release, the same JSON encoder is used to encode HTTP responses and WebSocket messages.
Starting with this release, the same JSON encoder is used to encode HTTP responses and WebSocket messages.
This enables developers to override the encode_json method on their views to
customize the JSON encoder used by all web protocols.
Releases contributed by @DoctorJohn via #3708
Starting with this release, the same JSON encoder is used to encode HTTP responses and WebSocket messages.
This enables developers to override the encode_json method on their views to
customize the JSON encoder used by all web protocols.
Contributed by Jonathan Ehwald via PR #3708
This release refactors part of the legacy graphql-ws protocol implementation, making it easier to read, maintain, and extend.
This release refactors part of the legacy graphql-ws protocol implementation, making it easier to read, maintain, and extend.
Releases contributed by @DoctorJohn via #3704
This release refactors part of the legacy graphql-ws protocol implementation, making it easier to read, maintain, and extend.
Contributed by Jonathan Ehwald via PR #3704
In this release, we migrated the graphql-transport-ws types from data classes to typed dicts. Using typed dicts enabled us to precisely model null ver
In this release, we migrated the graphql-transport-ws types from data classes to typed dicts.
Using typed dicts enabled us to precisely model null versus undefined values, which are common in that protocol.
As a result, we could remove custom conversion methods handling these cases and simplify the codebase.
Releases contributed by @DoctorJohn via #3701
In this release, we migrated the graphql-transport-ws types from data classes to typed dicts.
Using typed dicts enabled us to precisely model null versus undefined values, which are common in that protocol.
As a result, we could remove custom conversion methods handling these cases and simplify the codebase.
Contributed by Jonathan Ehwald via PR #3701
After a year-long deprecation period, the SentryTracingExtension has been removed in favor of the official Sentry SDK integration.
After a year-long deprecation period, the SentryTracingExtension has been
removed in favor of the official Sentry SDK integration.
To migrate, remove the SentryTracingExtension from your Strawberry schema and
then follow the
official Sentry SDK integration guide.
Releases contributed by @DoctorJohn via #3672
After a year-long deprecation period, the SentryTracingExtension has been
removed in favor of the official Sentry SDK integration.
To migrate, remove the SentryTracingExtension from your Strawberry schema and
then follow the
official Sentry SDK integration guide.
Contributed by Jonathan Ehwald via PR #3672
This release fixes the following deprecation warning:
This release fixes the following deprecation warning:
Failing to pass a value to the 'type_params' parameter of 'typing._eval_type' is deprecated,
as it leads to incorrect behaviour when calling typing._eval_type on a stringified annotation
that references a PEP 695 type parameter. It will be disallowed in Python 3.15.
This was only trigger in Python 3.13 and above.
Releases contributed by @patrick91 via #3692
In this release, all types of the legacy graphql-ws protocol were refactored. The types are now much stricter and precisely model the difference betwe
In this release, all types of the legacy graphql-ws protocol were refactored. The types are now much stricter and precisely model the difference between null and undefined fields. As a result, our protocol implementation and related tests are now more robust and easier to maintain.
Releases contributed by @DoctorJohn via #3689
In this release, all types of the legacy graphql-ws protocol were refactored. The types are now much stricter and precisely model the difference between null and undefined fields. As a result, our protocol implementation and related tests are now more robust and easier to maintain.
Contributed by Jonathan Ehwald via PR #3689
This release fixes the issue that some coroutines in the WebSocket protocol handlers were never awaited if clients disconnected shortly after starting
This release fixes the issue that some coroutines in the WebSocket protocol handlers were never awaited if clients disconnected shortly after starting an operation.
Releases contributed by @DoctorJohn via #3687
This release fixes the issue that some coroutines in the WebSocket protocol handlers were never awaited if clients disconnected shortly after starting an operation.
Contributed by Jonathan Ehwald via PR #3687
Starting with this release, both websocket-based protocols will handle unexpected socket disconnections more gracefully.
Starting with this release, both websocket-based protocols will handle unexpected socket disconnections more gracefully.
Releases contributed by @DoctorJohn via #3685
Starting with this release, both websocket-based protocols will handle unexpected socket disconnections more gracefully.
Contributed by Jonathan Ehwald via PR #3685
This release fixes a regression in the legacy GraphQL over WebSocket protocol. Legacy protocol implementations should ignore client message parsing er
This release fixes a regression in the legacy GraphQL over WebSocket protocol. Legacy protocol implementations should ignore client message parsing errors. During a recent refactor, Strawberry changed this behavior to match the new protocol, where parsing errors must close the WebSocket connection. The expected behavior is restored and adequately tested in this release.
Releases contributed by @DoctorJohn via #3670
This release fixes a regression in the legacy GraphQL over WebSocket protocol. Legacy protocol implementations should ignore client message parsing errors. During a recent refactor, Strawberry changed this behavior to match the new protocol, where parsing errors must close the WebSocket connection. The expected behavior is restored and adequately tested in this release.
Contributed by Jonathan Ehwald via PR #3670
This release addresses a bug where directives were being added multiple times when defined in an interface which multiple objects inherits from.
This release addresses a bug where directives were being added multiple times when defined in an interface which multiple objects inherits from.
The fix involves deduplicating directives when applying extensions/permissions to a field, ensuring that each directive is only added once.
Releases contributed by @Speedy1991 via #3674
This release addresses a bug where directives were being added multiple times when defined in an interface which multiple objects inherits from.
The fix involves deduplicating directives when applying extensions/permissions to a field, ensuring that each directive is only added once.
This release tweaks the Flask integration's render_graphql_ide method to be stricter typed internally, making type checkers ever so slightly happier.
This release tweaks the Flask integration's render_graphql_ide method to be stricter typed internally, making type checkers ever so slightly happier.
Releases contributed by @DoctorJohn via #3666
This release tweaks the Flask integration's render_graphql_ide method to be stricter typed internally, making type checkers ever so slightly happier.
Contributed by Jonathan Ehwald via PR #3666
This release adds support for using raw Python enum types in your schema (enums that are not decorated with @strawberry.enum)
This release adds support for using raw Python enum types in your schema
(enums that are not decorated with @strawberry.enum)
This is useful if you have enum types from other places in your code that you want to use in strawberry. i.e
# somewhere.py
from enum import Enum
class AnimalKind(Enum):
AXOLOTL, CAPYBARA = range(2)
# gql/animals
from somewhere import AnimalKind
@strawberry.type
class AnimalType:
kind: AnimalKind
Releases contributed by @nrbnlulu via #3639
This change is backwards-compatible, but the old option name will raise a deprecation warning.
The AIOHTTP, ASGI, and Django test clients' asserts_errors option has been renamed to assert_no_errors to better reflect its purpose.
This change is backwards-compatible, but the old option name will raise a deprecation warning.
Releases contributed by @DoctorJohn via #3661
The AIOHTTP, ASGI, and Django test clients' asserts_errors option has been renamed to assert_no_errors to better reflect its purpose.
This change is backwards-compatible, but the old option name will raise a deprecation warning.
Contributed by Jonathan Ehwald via PR #3661
This release removes the dated subscriptions_enabled setting from the Django and Channels integrations. Instead, WebSocket support is now enabled by d
This release removes the dated subscriptions_enabled setting from the Django and Channels integrations.
Instead, WebSocket support is now enabled by default in all GraphQL IDEs.
Releases contributed by @DoctorJohn via #3660
This release removes the dated subscriptions_enabled setting from the Django and Channels integrations.
Instead, WebSocket support is now enabled by default in all GraphQL IDEs.
Contributed by Jonathan Ehwald via PR #3660
Fixes an issue where the codegen tool would crash when working with a nullable list of types.
Fixes an issue where the codegen tool would crash when working with a nullable list of types.
Releases contributed by @enoua5 via #3653
Fixes an issue where the codegen tool would crash when working with a nullable list of types.
Contributed by Jacob Allen via PR #3653
Starting with this release, WebSocket logic now lives in the base class shared between all HTTP integrations. This makes the behaviour of WebSockets m
Starting with this release, WebSocket logic now lives in the base class shared between all HTTP integrations. This makes the behaviour of WebSockets much more consistent between integrations and easier to maintain.
Releases contributed by @DoctorJohn via #3638
Starting with this release, WebSocket logic now lives in the base class shared between all HTTP integrations. This makes the behaviour of WebSockets much more consistent between integrations and easier to maintain.
Contributed by Jonathan Ehwald via PR #3638
This releases adds support for Pydantic 2.9.0's Mypy plugin
This releases adds support for Pydantic 2.9.0's Mypy plugin
Releases contributed by @chrisemke via #3632
These are breaking changes if you are using multipart uploads OR the Strawberry Django view. Migrations guides including further information are avail…
Starting with this release, multipart uploads are disabled by default and Strawberry Django view is no longer implicitly exempted from Django's CSRF protection. Both changes relieve users from implicit security implications inherited from the GraphQL multipart request specification which was enabled in Strawberry by default.
These are breaking changes if you are using multipart uploads OR the Strawberry Django view. Migrations guides including further information are available on the Strawberry website.
Releases contributed by @DoctorJohn via #3645
Starting with this release, clients using the legacy graphql-ws subprotocol will receive an error when they try to send binary data frames. Before, bi
Starting with this release, clients using the legacy graphql-ws subprotocol will receive an error when they try to send binary data frames. Before, binary data frames were silently ignored.
While vaguely defined in the protocol, the legacy graphql-ws subprotocol is generally understood to only support text data frames.
Releases contributed by @DoctorJohn via #3633
Starting with this release, clients using the legacy graphql-ws subprotocol will receive an error when they try to send binary data frames. Before, binary data frames were silently ignored.
While vaguely defined in the protocol, the legacy graphql-ws subprotocol is generally understood to only support text data frames.
Contributed by Jonathan Ehwald via PR #3633
You can now configure your schemas to provide a custom subclass of strawberry.types.Info to your types and queries.
You can now configure your schemas to provide a custom subclass of
strawberry.types.Info to your types and queries.
import strawberry
from strawberry.schema.config import StrawberryConfig
from .models import ProductModel
class CustomInfo(strawberry.Info):
@property
def selected_group_id(self) -> int | None:
"""Get the ID of the group you're logged in as."""
return self.context["request"].headers.get("Group-ID")
@strawberry.type
class Group:
id: strawberry.ID
name: str
@strawberry.type
class User:
id: strawberry.ID
name: str
group: Group
@strawberry.type
class Query:
@strawberry.field
def user(self, id: strawberry.ID, info: CustomInfo) -> Product:
kwargs = {"id": id, "name": ...}
if info.selected_group_id is not None:
# Get information about the group you're a part of, if
# available.
kwargs["group"] = ...
return User(**kwargs)
schema = strawberry.Schema(
Query,
config=StrawberryConfig(info_class=CustomInfo),
)
Releases contributed by @parafoxia via #3592
This release fixes how we check for multipart subscriptions to be in line with the latest changes in the spec.
This release fixes how we check for multipart subscriptions to be in line with the latest changes in the spec.
Releases contributed by @patrick91 via #3627
This release fixes how we check for multipart subscriptions to be in line with the latest changes in the spec.
Contributed by Patrick Arminio via PR #3627
This release fixes an issue that prevented extensions to receive the result from the execution context when executing operations in async.
This release fixes an issue that prevented extensions to receive the result from the execution context when executing operations in async.
Releases contributed by @nrbnlulu via #3629
Nothing published for this version
This release updates how we check for GraphQL core's version to remove a dependency on the packaging package.
This release updates how we check for GraphQL core's version to remove a
dependency on the packaging package.
Releases contributed by @bollwyvl via #3622
This release updates how we check for GraphQL core's version to remove a
dependency on the packaging package.
Contributed by Nicholas Bollweg via PR #3622
This release adds support for Python 3.13 (which will be out soon!)
This release adds support for Python 3.13 (which will be out soon!)
Releases contributed by @patrick91 via #3510
This release adds support for Python 3.13 (which will be out soon!)
Contributed by Patrick Arminio via PR #3510
This release adds support for schema-extensions in subscriptions.
This release adds support for schema-extensions in subscriptions.
Here's a small example of how to use them (they work the same way as query and mutation extensions):
import asyncio
from typing import AsyncIterator
import strawberry
from strawberry.extensions.base_extension import SchemaExtension
@strawberry.type
class Subscription:
@strawberry.subscription
async def notifications(self, info: strawberry.Info) -> AsyncIterator[str]:
for _ in range(3):
yield "Hello"
class MyExtension(SchemaExtension):
async def on_operation(self):
# This would run when the subscription starts
print("Subscription started")
yield
# The subscription has ended
print("Subscription ended")
schema = strawberry.Schema(
query=Query, subscription=Subscription, extensions=[MyExtension]
)
Releases contributed by @nrbnlulu via #3554
This release fixes a TypeError on Python 3.8 due to us using a asyncio.Queue[Tuple[bool, Any]](1) instead of asyncio.Queue(1).
This release fixes a TypeError on Python 3.8 due to us using a
asyncio.Queue[Tuple[bool, Any]](1) instead of asyncio.Queue(1).
Releases contributed by @szokeasaurusrex via #3615
This release fixes a TypeError on Python 3.8 due to us using a
asyncio.Queue[Tuple[bool, Any]](1) instead of asyncio.Queue(1).
Contributed by Daniel Szoke via PR #3615
This release fixes an issue with the http multipart subscription where the status code would be returned as None, instead of 200.
This release fixes an issue with the http multipart subscription where the
status code would be returned as None, instead of 200.
We also took the opportunity to update the internals to better support additional protocols in future.
Releases contributed by @patrick91 via #3610
This release fixes an issue with the http multipart subscription where the
status code would be returned as None, instead of 200.
We also took the opportunity to update the internals to better support additional protocols in future.
Contributed by Patrick Arminio via PR #3610
This release adds support for multipart subscriptions in almost all[^1] of our http integrations!
This release adds support for multipart subscriptions in almost all[^1] of our http integrations!
Multipart subcriptions
are a new protocol from Apollo GraphQL, built on the
Incremental Delivery over HTTP spec,
which is also used for @defer and @stream.
The main advantage of this protocol is that when using the Apollo Client
libraries you don't need to install any additional dependency, but in future
this feature should make it easier for us to implement @defer and @stream
Also, this means that you don't need to use Django Channels for subscription, since this protocol is based on HTTP we don't need to use websockets.
[^1]: Flask, Chalice and the sync Django integration don't support this.
Releases contributed by @patrick91 via #3076
Fix an issue where StrawberryResolver.is_async was returning False for a function decorated with asgiref's @sync_to_async.
Fix an issue where StrawberryResolver.is_async was returning False for a
function decorated with asgiref's @sync_to_async.
The root cause is that in python >= 3.12 coroutine functions are market using
inspect.markcoroutinefunction, which should be checked with
inspect.iscoroutinefunction instead of asyncio.iscoroutinefunction
Releases contributed by @shmoon-kr via #3599
Fix an issue where StrawberryResolver.is_async was returning False for a
function decorated with asgiref's @sync_to_async.
The root cause is that in python >= 3.12 coroutine functions are market using
inspect.markcoroutinefunction, which should be checked with
inspect.iscoroutinefunction instead of asyncio.iscoroutinefunction
Contributed by Hyun S. Moon via PR #3599
This release removes the integration of Starlite, as it has been deprecated since 11 May 2024.
This release removes the integration of Starlite, as it has been deprecated since 11 May 2024.
If you are using Starlite, please consider migrating to Litestar (https://litestar.dev) or another alternative.
Releases contributed by @patrick91 via #3609
This release removes the integration of Starlite, as it has been deprecated since 11 May 2024.
If you are using Starlite, please consider migrating to Litestar (https://litestar.dev) or another alternative.
Contributed by Patrick Arminio via PR #3609
This release fixes the type of the ASGI request handler's scope argument, making type checkers ever so slightly happier.
This release fixes the type of the ASGI request handler's scope argument, making type checkers ever so slightly happier.
Releases contributed by @DoctorJohn via #3581
This release fixes the type of the ASGI request handler's scope argument, making type checkers ever so slightly happier.
Contributed by Jonathan Ehwald via PR #3581
This release makes the ASGI and FastAPI integrations share their HTTP request adapter code, making Strawberry ever so slightly smaller and easier to m
This release makes the ASGI and FastAPI integrations share their HTTP request adapter code, making Strawberry ever so slightly smaller and easier to maintain.
Releases contributed by @DoctorJohn via #3582
This release makes the ASGI and FastAPI integrations share their HTTP request adapter code, making Strawberry ever so slightly smaller and easier to maintain.
Contributed by Jonathan Ehwald via PR #3582
This release adds support for GraphQL-core v3.3 (which has not yet been released). Note that we continue to support GraphQL-core v3.2 as well.
This release adds support for GraphQL-core v3.3 (which has not yet been released). Note that we continue to support GraphQL-core v3.2 as well.
Releases contributed by @nrbnlulu via #3570
This release ensures using pydantic 2.8.0 doesn't break when using experimental pydantic_type and running mypy.
This release ensures using pydantic 2.8.0 doesn't break when using experimental pydantic_type and running mypy.
Releases contributed by @lindycoder via #3562
This release ensures using pydantic 2.8.0 doesn't break when using experimental pydantic_type and running mypy.
Contributed by Martin Roy via PR #3562
Update federation entity resolver exception handling to set the result to the original error instead of a GraphQLError, which obscured the original me
Update federation entity resolver exception handling to set the result to the original error instead of a GraphQLError, which obscured the original message and meta-fields.
Releases contributed by @bradleyoesch via #3144
Update federation entity resolver exception handling to set the result to the original error instead of a GraphQLError, which obscured the original message and meta-fields.
Contributed by Bradley Oesch via PR #3144
One column per quarter.