GraphQL::Type::Union - GraphQL union type
use GraphQL::Type::Union; my $union_type = GraphQL::Type::Union->new( name => 'Union', types => [ $type1, $type2 ], resolve_type => sub { return $type1 if ref $_[0] eq 'Type1'; return $type2 if ref $_[0] eq 'Type2'; }, );
Inherits name, description from GraphQL::Type.
name
description
Thunked array-ref of GraphQL::Type::Object objects.
Optional code-ref. Input is a value, returns a GraphQL type object for it. If not given, relies on its possible type objects having a provided is_type_of.
is_type_of
Returns list of GraphQL::Type::Objects of which the object is a union, performing validation.
To install GraphQL, copy and paste the appropriate command in to your terminal.
cpanm
cpanm GraphQL
CPAN shell
perl -MCPAN -e shell install GraphQL
For more information on module installation, please visit the detailed CPAN module installation guide.