Skip to content

Releases: strawberry-graphql/strawberry

🍓 0.243.1

26 Sep 12:23
Compare
Choose a tag to compare

This releases adds support for Pydantic 2.9.0's Mypy plugin

Releases contributed by @chrisemke via #3632

🍓 0.243.0

25 Sep 16:10
Compare
Choose a tag to compare

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

🍓 0.242.0

19 Sep 19:46
Compare
Choose a tag to compare

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

🍓 0.241.0

16 Sep 16:43
Compare
Choose a tag to compare

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

🍓 0.240.4

13 Sep 14:50
Compare
Choose a tag to compare

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

🍓 0.240.3

12 Sep 20:07
Compare
Choose a tag to compare

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

🍓 0.240.2

11 Sep 19:39
Compare
Choose a tag to compare

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

🍓 0.240.1

11 Sep 19:14
Compare
Choose a tag to compare

This release adds support for Python 3.13 (which will be out soon!)

Releases contributed by @patrick91 via #3510

🍓 0.240.0

10 Sep 20:16
Compare
Choose a tag to compare

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

🍓 0.239.2

03 Sep 10:24
Compare
Choose a tag to compare

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