enum
Annotates an Enum class a GraphQL enum.
GraphQL enums only have names, while Python enums have names and values, Strawberry will use the names of the Python enum as the names of the GraphQL enum values.
Returns:
The decorated Enum class.
Signature:
Parameters:
-
name:
The name of the GraphQL enum.
- Type
-
str | None
- Default
-
None
-
description:
The description of the GraphQL enum.
- Type
-
str | None
- Default
-
None
-
directives:
The directives to attach to the GraphQL enum.
- Type
-
Iterable[object]
- Default
-
()