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.federation.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
-
()
-
inaccessible:
Whether the Union type is inaccessible.
- Type
-
bool
- Default
-
False
-
tags:
The federation tags to attach to the Union type.
- Type
-
Iterable[str] | None
- Default
-
()