NAME

GraphQL::Directive - GraphQL directive

SYNOPSIS

use GraphQL::Directive;
my $directive = GraphQL::Directive->new(
  name => 'Object',
  interfaces => [ $interfaceType ],
  fields => { field_name => { type => $scalar_type, resolve => sub { '' } }},
);

ATTRIBUTES

Inherits name, description from GraphQL::Type.

locations

Array-ref of locations where the directive can occur. Must be one of these strings:

QUERY
MUTATION
SUBSCRIPTION
FIELD
FRAGMENT_DEFINITION
FRAGMENT_SPREAD
INLINE_FRAGMENT
SCHEMA
SCALAR
OBJECT
FIELD_DEFINITION
ARGUMENT_DEFINITION
INTERFACE
UNION
ENUM
ENUM_VALUE
INPUT_OBJECT
INPUT_FIELD_DEFINITION

args

Array-ref of arguments.