Skip to content

v0.11.0

Choose a tag to compare

@github-actions github-actions released this 09 Oct 14:11
· 19 commits to master since this release

Added

  • Stdlib @dataclass maps onto real object/input types. A dataclass
    response (or a dataclass field nested inside a model, and vice versa)
    becomes a GraphQLObjectType / GraphQLInputObjectType like a
    BaseModel or TypedDict: annotations from get_type_hints, output
    nullability from the annotation (defaults always materialize), input
    requiredness and literal defaults from the field definitions
    (default_factory fields are optional without a GraphQL default —
    FastAPI materializes them, a 422 surfaces as a field error).
    ClassVar/InitVar never become fields. FastAPI treats dataclasses as
    first-class citizens on both sides, so validation and serialization ride
    the native stack — the runtime path needed no changes. Recursive
    dataclasses get the true-depth contract like any recursive type.