strawberry.union
Creates a new named Union type.
Signature:
def union( name: str, types: Collection[Type[Any]] | None = None, description: str | None = None, directives: Iterable[object] = (),) -> StrawberryUnion: ...Parameters:
-
name:The GraphQL name of the Union type.
- Type
-
str
-
types:The types that the Union can be. (Deprecated, use
Annotated[U, strawberry.union("Name")]instead)- Type
-
Collection[Type[Any]] | None - Default
-
None
-
description:The GraphQL description of the Union type.
- Type
-
str | None - Default
-
None
-
directives:The directives to attach to the Union type.
- Type
-
Iterable[object] - Default
-
()