Skip to content

Releases: strawberry-graphql/strawberry

0.315.3

29 Apr 08:20
2b60ddf

Choose a tag to compare

This release fixes the Channels integration when using cross-web 0.6.0 or newer.

cross-web now requires request adapters to expose path_params, so Strawberry's
Channels HTTP adapters now read them from the Channels url_route scope.

This release was contributed by @patrick91 in #4390

0.315.2

26 Apr 12:25
ae1192b

Choose a tag to compare

Await cancelled subscription tasks during WebSocket shutdown so their finally blocks run before shared state (DB pools, event loop) is torn down.

This release was contributed by @Flamefork in #4319

0.315.1

25 Apr 08:54
8412dcc

Choose a tag to compare

Raise MissingFieldAnnotationError instead of MissingReturnAnnotationError when a field using strawberry.field(resolver=...) is missing both a type annotation and a resolver return type.

This release was contributed by @youngjaekwon in #4360

Additional contributors: @pre-commit-ci[bot]

0.315.0

24 Apr 07:54
e34e31c

Choose a tag to compare

Cancel DataLoader dispatch task when all futures are cancelled.

Previously, the background task created by dispatch() was fire-and-forget — its
reference was never stored, so it couldn't be cancelled even when no caller was
waiting for the results. This caused wasted work (e.g. database queries against
closed sessions) when using asyncio.TaskGroup or similar structured concurrency
patterns that cancel futures on failure.

The dispatch task is now tracked in Batch._dispatch_task and automatically
cancelled when all futures in the batch are cancelled.

This release was contributed by @ChihebBENCHEIKH1 in #4379

0.314.3

08 Apr 18:04
39c849a

Choose a tag to compare

Fix deprecation_reason not being copied from arguments to auto-generated input type fields in InputMutationExtension.

This release was contributed by @youngjaekwon in #4353

0.314.2

08 Apr 17:57
6547465

Choose a tag to compare

This release fixes a bug in _listen_to_channel_generator where yield await awaitable inside try/except asyncio.TimeoutError caused the yield to fall
within the try block's bytecode exception table range.

This meant that a TimeoutError thrown into the generator at the yield point
(i.e. when the generator is suspended after delivering a value) was incorrectly
caught by the internal timeout handler, silently stopping the generator instead
of propagating to the caller. In production, this could manifest as
RuntimeError: cannot reuse already awaited coroutine during WebSocket
disconnect cleanup.

The fix splits yield await awaitable into result = await awaitable followed
by yield result, so the yield is outside the try block and exceptions
thrown at the yield point propagate correctly.

This release was contributed by @ben-xo in #4352

0.314.1

08 Apr 09:49
73f0d3e

Choose a tag to compare

This release attaches error details to Apollo Federation inline tracing (FTV1) trace nodes. This was missing in the original FTV1 addition made in 0.314.0.

When a resolver raises an exception, the error message, location, and path are now included in the corresponding trace node, allowing Apollo Studio to display error information alongside timing data.

This release was contributed by @FineAndDanD in #4351

Additional contributors: @bellini666

0.314.0

07 Apr 17:55
b189f44

Choose a tag to compare

This release adds support for Apollo Federation inline tracing (FTV1).

When a request includes the apollo-federation-include-trace: ftv1 header, Strawberry now records per-resolver timing information and includes it in the response under extensions.ftv1 as a base64-encoded protobuf message, following the Apollo Federation trace format. This allows an Apollo Gateway to aggregate subgraph traces and report them to Apollo Studio.

Install the new optional extra to pull in the required protobuf dependency:

pip install 'strawberry-graphql[apollo-federation]'

Use the async extension for async schemas:

import strawberry
from strawberry.extensions.tracing import ApolloFederationTracingExtension


@strawberry.type
class Query:
    @strawberry.field
    def hello(self) -> str:
        return "Hello, world!"


schema = strawberry.Schema(
    query=Query,
    extensions=[ApolloFederationTracingExtension],
)

Or the sync version when running outside of an async context:

from strawberry.extensions.tracing import ApolloFederationTracingExtensionSync

schema = strawberry.Schema(
    query=Query,
    extensions=[ApolloFederationTracingExtensionSync],
)

Security: any client can send the apollo-federation-include-trace: ftv1 header unless you restrict it. Tracing payloads expose resolver timing details, so make sure only a trusted Apollo Gateway (or other internal traffic) can request traces — for example by enforcing authentication, network policy, or stripping the header from public requests at the edge.\

Release contributed by @bellini666 via #4136

🍓 0.313.0

06 Apr 10:06

Choose a tag to compare

Add PydanticErrorExtension to format validation errors into structured GraphQL error extensions.

Includes:

  • Structured validation_errors output
  • Support for Pydantic v1 and v2

Releases contributed by @peehu-k via #4342

🍓 0.312.4

05 Apr 12:02

Choose a tag to compare

Fix a memory leak in the graphql-transport-ws WebSocket handler where completed
task objects would accumulate in a list between messages. Task cleanup now uses
asyncio.Task.add_done_callback for immediate cleanup instead of deferred reaping.

Releases contributed by @bellini666 via #4345