Skip to content

Releases: strawberry-graphql/strawberry

🍓 0.270.4

29 May 10:40

Choose a tag to compare

This release fixes that the Strawberry debug server no longer supported
WebSockets out of the box.

Releases contributed by @DoctorJohn via #3872

🍓 0.270.3

29 May 09:09

Choose a tag to compare

This release fixes an dependency issue with the Strawberry CLI and
libcst.

Releases contributed by @DoctorJohn via #3875

🍓 0.270.2

24 May 13:48

Choose a tag to compare

This release resolves the issue of subscriptions started via the legacy graphql-ws WebSocket subprotocol getting stuck if a non-existing operationName was specified.

Releases contributed by @DoctorJohn via #3858

🍓 0.270.1

22 May 12:28

Choose a tag to compare

Fix multipart subscriptions by always yielding the closing boundary if it's enqueued.

Releases contributed by @RogerHYang via #3866

🍓 0.270.0

20 May 10:43

Choose a tag to compare

This release adds support for GraphQL over WebSocket transport protocols to the Quart integration.

Releases contributed by @DoctorJohn via #3860

🍓 0.269.0

17 May 09:37

Choose a tag to compare

This release adds support for input extension (To explain and document)

Releases contributed by @omarzouk via #3461

🍓 0.268.2

17 May 09:26

Choose a tag to compare

This release (finally) fixes support for using ID and GlobalID
in the same schema.

Releases contributed by @patrick91 via #3859

🍓 0.268.1

12 May 23:49

Choose a tag to compare

This releases fixed an issue that prevented from using ID and GlobalID at the same
time, like in this example:

import strawberry
from strawberry.relay.types import GlobalID


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

    @strawberry.field
    def hello2(self, id: strawberry.ID) -> str:
        return "Hello World"


schema = strawberry.Schema(
    Query,
)

Releases contributed by @patrick91 via #3855

🍓 0.268.0

10 May 18:00

Choose a tag to compare

This release renames the generated type from GlobalID to ID in the GraphQL
schema.

This means that when using relay.Node, like in this example:

@strawberry.type
class Fruit(relay.Node):
    code: relay.NodeID[int]
    name: str

You'd create a GraphQL type that looks like this:

type Fruit implements Node {
  id: ID!
  name: String!
}

while previously you'd get this:

type Fruit implements Node {
  id: GlobalID!
  name: String!
}

The runtime behaviour is still the same, so if you want to use GlobalID in
Python code, you can still do so, for example:

@strawberry.type
class Mutation:
    @strawberry.mutation
    @staticmethod
    async def update_fruit_weight(id: relay.GlobalID, weight: float) -> Fruit:
        # while `id` is a GraphQL `ID` type, here is still an instance of `relay.GlobalID`
        fruit = await id.resolve_node(info, ensure_type=Fruit)
        fruit.weight = weight
        return fruit

If you want to revert this change, and keep GlobalID in the schema, you can
use the following configuration:

schema = strawberry.Schema(
    query=Query, config=StrawberryConfig(relay_use_legacy_global_id=True)
)

Releases contributed by @patrick91 via #3853

🍓 0.267.0

10 May 15:38

Choose a tag to compare

This release adds support to use strawberry.Parent with future annotations.

For example, the following code will now work as intended:

from __future__ import annotations


def get_full_name(user: strawberry.Parent[User]) -> str:
    return f"{user.first_name} {user.last_name}"


@strawberry.type
class User:
    first_name: str
    last_name: str
    full_name: str = strawberry.field(resolver=get_full_name)


@strawberry.type
class Query:
    @strawberry.field
    def user(self) -> User:
        return User(first_name="John", last_name="Doe")


schema = strawberry.Schema(query=Query)

Or even when not using future annotations, but delaying the evaluation of User, like:

# Note the User being delayed by passing it as a string
def get_full_name(user: strawberry.Parent["User"]) -> str:
    return f"{user.first_name} {user.last_name}"


@strawberry.type
class User:
    first_name: str
    last_name: str
    full_name: str = strawberry.field(resolver=get_full_name)


@strawberry.type
class Query:
    @strawberry.field
    def user(self) -> User:
        return User(first_name="John", last_name="Doe")


schema = strawberry.Schema(query=Query)

Releases contributed by @bellini666 via #3851