strawberry.union
Creates a new named Union type.
Signature:
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
-
()