pypi strawberry-graphql 0.156.0
🍓 0.156.0

latest releases: 0.248.1, 0.248.0, 0.247.2...
21 months ago

This release adds support for specialized generic types.
Before, the following code would give an error, saying that T was not
provided to the generic type:

@strawberry.type
class Foo(Generic[T]):
    some_var: T


@strawberry.type
class IntFoo(Foo[int]):
    ...


@strawberry.type
class Query:
    int_foo: IntFoo

Also, because the type is already specialized, Int won't get inserted to its name,
meaning it will be exported to the schema with a type name of IntFoo and not
IntIntFoo.

For example, this query:

@strawberry.type
class Query:
    int_foo: IntFoo
    str_foo: Foo[str]

Will generate a schema like this:

type IntFoo {
  someVar: Int!
}

type StrFoo {
  someVar: String!
}

type Query {
  intFoo: IntFoo!
  strfoo: StrFoo!
}

Releases contributed by @bellini666 via #2517

Don't miss a new strawberry-graphql release

NewReleases is sending notifications on new releases.