Skip to content

Releases: strawberry-graphql/strawberry

🍓 0.233.1

30 May 11:33
Compare
Choose a tag to compare

This release exposes get_arguments in the schema_converter module to allow
integrations, such as strawberry-django, to reuse that functionality if needed.

This is an internal change with no impact for end users.

Releases contributed by @bellini666 via #3527

🍓 0.233.0

29 May 17:44
Compare
Choose a tag to compare

This release refactors our Federation integration to create types using
Strawberry directly, instead of using low level types from GraphQL-core.

The only user facing change is that now the info object passed to the
resolve_reference function is the strawberry.Info object instead of the one
coming coming from GraphQL-core. This is a breaking change for users that
were using the info object directly.

If you need to access the original info object you can do so by accessing the
_raw_info attribute.

import strawberry


@strawberry.federation.type(keys=["upc"])
class Product:
    upc: str

    @classmethod
    def resolve_reference(cls, info: strawberry.Info, upc: str) -> "Product":
        # Access the original info object
        original_info = info._raw_info

        return Product(upc=upc)

Releases contributed by @patrick91 via #3525

🍓 0.232.2

28 May 21:37
Compare
Choose a tag to compare

This release fixes an issue that would prevent using lazy aliased connections to
annotate a connection field.

For example, this should now work correctly:

# types.py


@strawberry.type
class Fruit: ...


FruitConnection: TypeAlias = ListConnection[Fruit]
# schema.py


@strawberry.type
class Query:
    fruits: Annotated["FruitConnection", strawberry.lazy("types")] = (
        strawberry.connection()
    )

Releases contributed by @bellini666 via #3524

🍓 0.232.1

27 May 23:21
Compare
Choose a tag to compare

This release fixes an issue where mypy would complain when using a typed async
resolver with strawberry.field(resolver=...).

Now the code will type check correctly. We also updated our test suite to make
we catch similar issues in the future.

Releases contributed by @patrick91 via #3516

🍓 0.232.0

25 May 15:13
Compare
Choose a tag to compare

This release improves type checking for async resolver functions when used as
strawberry.field(resolver=resolver_func).

Now doing this will raise a type error:

import strawberry


def some_resolver() -> int:
    return 0


@strawberry.type
class User:
    # Note the field being typed as str instead of int
    name: str = strawberry.field(resolver=some_resolver)

Releases contributed by @bricker via #3241

🍓 0.231.1

25 May 10:15
Compare
Choose a tag to compare

Fixes an issue where lazy annotations raised an error when used together with a List

Releases contributed by @jeich via #3388

🍓 0.231.0

25 May 09:10
Compare
Choose a tag to compare

When calling the CLI without all the necessary dependencies installed,
a MissingOptionalDependenciesError will be raised instead of a
ModuleNotFoundError. This new exception will provide a more helpful
hint regarding how to fix the problem.

Releases contributed by @parafoxia via #3511

🍓 0.230.0

22 May 17:33
Compare
Choose a tag to compare

This release adds support for @oneOf on input types! 🎉 You can use
one_of=True on input types to create an input type that should only have one
of the fields set.

import strawberry


@strawberry.input(one_of=True)
class ExampleInputTagged:
    a: str | None = strawberry.UNSET
    b: int | None = strawberry.UNSET

Releases contributed by @patrick91 via #3429

🍓 0.229.2

22 May 14:18
Compare
Choose a tag to compare

This release fixes an issue when using Annotated + strawberry.lazy +
deferred annotations such as:

from __future__ import annotations
import strawberry
from typing import Annotated


@strawberry.type
class Query:
    a: Annotated["datetime", strawberry.lazy("datetime")]


schema = strawberry.Schema(Query)

Before this would only work if datetime was not inside quotes. Now it should
work as expected!

Releases contributed by @bellini666 via #3507

🍓 0.229.1

15 May 18:39
Compare
Choose a tag to compare

This release fixes a regression from 0.229.0 where using a generic interface
inside a union would return an error.

Releases contributed by @patrick91 via #3502