GraphQL::Type::Enum(3pm)

GraphQL::Type::Enum3pm

Graphql enum type

Usage

  use GraphQL::Type::Enum;
  my %text2value;
  my $type = GraphQL::Type::Enum->new(
    name => 'Enum',
    values => { value1 => {}, value2 => { value => 'yo' } },
  );

Attributes

Has "name", "description" from GraphQL::Role::Named.

values

Hash-ref mapping value labels to a hash-ref description. Description keys, all optional:

value

Perl value of that item. If not specified, will be the string name of the value. Integers are often useful.

deprecation_reason

Reason if deprecated. If supplied, the hash for that value will also have a key "is_deprecated" with a true value.

description

Description.

Methods

is_valid

True if given Perl entity is valid value for this type. Relies on unique stringification of the value.

Build

Internal method.

Releases

Unchanged in 2 releases since Debian 12 (Bookworm).

  1. 12–13

From libgraphql-perl 0.54-1 in Debian 13 (Trixie). Parsed by carta from the page's man source.