enum

Registers the enum in the GraphQL type system.

If name is passed, the name of the GraphQL type will be the value passed of name instead of the Enum class name.

Signature:

def enum(
_cls: EnumType | None = None,
name = None,
description = None,
directives = (),
authenticated: bool = False,
inaccessible: bool = False,
policy: List[List[str]] | None = None,
requires_scopes: List[List[str]] | None = None,
tags: Iterable[str] | None = (),
) -> EnumType | Callable[[EnumType], EnumType]:
...

Parameters:

  1. _cls:

    Type
    EnumType | None
    Default
    None
  2. name:

    Default
    None
  3. description:

    Default
    None
  4. directives:

    Default
    ()
  5. authenticated:

    Type
    bool
    Default
    False
  6. inaccessible:

    Type
    bool
    Default
    False
  7. policy:

    Type
    List[List[str]] | None
    Default
    None
  8. requires_scopes:

    Type
    List[List[str]] | None
    Default
    None
  9. tags:

    Type
    Iterable[str] | None
    Default
    ()