NAME

GraphQL::Schema - GraphQL schema object

SYNOPSIS

use GraphQL::Schema;
use GraphQL::Type::Object;
my $schema = GraphQL::Schema->new(
  query => GraphQL::Type::Object->new(
    name => 'Query',
    fields => {
      getObject => {
        type => $interfaceType,
        resolve => sub {
          return {};
        }
      }
    }
  )
);

DESCRIPTION

Class implementing GraphQL schema.

ATTRIBUTES

query

mutation

subscription

types

directives

METHODS

name2type

In this schema, returns a hash-ref mapping all types' names to their type object.

get_possible_types($abstract_type)

In this schema, get all of either the implementation types (if interface) or possible types (if union) of the $abstract_type.

is_possible_type($abstract_type, $possible_type)

In this schema, is the given $possible_type either an implementation (if interface) or a possibility (if union) of the $abstract_type?

assert_object_implements_interface($type, $iface)

In this schema, does the given $type implement interface $iface? If not, throw exception.