pypi strawberry-graphql 0.258.1
🍓 0.258.1

latest release: 0.259.0
2 days ago

This release adjusts the schema printer to avoid printing a schema directive
value set to UNSET as "" (empty string).

For example, the following:

@strawberry.input
class FooInput:
    a: str | None = strawberry.UNSET
    b: str | None = strawberry.UNSET


@strawberry.schema_directive(locations=[Location.FIELD_DEFINITION])
class FooDirective:
    input: FooInput


@strawberry.type
class Query:
    @strawberry.field(directives=[FooDirective(input=FooInput(a="aaa"))])
    def foo(self, info) -> str: ...

Would previously print as:

directive @fooDirective(
  input: FooInput!
  optionalInput: FooInput
) on FIELD_DEFINITION

type Query {
  foo: String! @fooDirective(input: { a: "aaa", b: "" })
}

input FooInput {
  a: String
  b: String
}

Now it will be correctly printed as:

directive @fooDirective(
  input: FooInput!
  optionalInput: FooInput
) on FIELD_DEFINITION

type Query {
  foo: String! @fooDirective(input: { a: "aaa" })
}

input FooInput {
  a: String
  b: String
}

Releases contributed by @bellini666 via #3770

Don't miss a new strawberry-graphql release

NewReleases is sending notifications on new releases.