Skip to content

Releases: strawberry-graphql/strawberry

🍓 0.246.2

12 Oct 17:20
Compare
Choose a tag to compare

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

🍓 0.246.1

09 Oct 10:36
Compare
Choose a tag to compare

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

🍓 0.246.0

07 Oct 09:04
Compare
Choose a tag to compare

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

🍓 0.245.0

07 Oct 00:07
Compare
Choose a tag to compare

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

🍓 0.244.1

06 Oct 17:33
Compare
Choose a tag to compare

Fixes an issue where the codegen tool would crash when working with a nullable list of types.

Releases contributed by @enoua5 via #3653

🍓 0.244.0

05 Oct 20:21
Compare
Choose a tag to compare

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

🍓 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