pypi strawberry-graphql 0.290.0
🍓 0.290.0

latest release: 0.291.0
20 hours ago

This release improves schema-codegen for input types in two ways:

  1. Nullable input fields now use strawberry.Maybe[T | None], allowing them to
    be omitted when constructing the input type.

  2. GraphQL default values on input fields are now generated as Python defaults.
    Supported value types: integers, floats, strings, booleans, null, enums, and
    lists. When a field also has a description (or other metadata), the default is
    passed via strawberry.field(description=..., default=...).

Before:

@strawberry.input
class CreateUserInput:
    name: str
    role: int | None  # required – TypeError with {}
    # default value "42" from schema was lost

After:

@strawberry.input
class CreateUserInput:
    name: str
    role: strawberry.Maybe[int | None] = 42

Releases contributed by @patrick91 via #4178

Don't miss a new strawberry-graphql release

NewReleases is sending notifications on new releases.