enum_value

Function to customise an enum value, for example to add a description or deprecation reason.

Returns:

An EnumValueDefinition object that can be used to customise an enum member.

Signature:

def enum_value(
value: Any,
deprecation_reason: str | None = None,
directives: Iterable[object] = (),
description: str | None = None,
) -> EnumValueDefinition:
...

Parameters:

  1. value:

    The value of the enum member.

    Type
    Any
  2. deprecation_reason:

    The deprecation reason of the enum member, setting this will mark the enum member as deprecated.

    Type
    str | None
    Default
    None
  3. directives:

    The directives to attach to the enum member.

    Type
    Iterable[object]
    Default
    ()
  4. description:

    The GraphQL description of the enum member.

    Type
    str | None
    Default
    None