NAME

GraphQL::Houtou::Type::Union - GraphQL union type

SYNOPSIS

my $SearchResult = GraphQL::Houtou::Type::Union->new(
  name  => 'SearchResult',
  types => [ $User, $Post ],
  resolve_type => sub { my ($value) = @_; $value->{type_name} },
);

DESCRIPTION

An abstract output type over a fixed set of object types. resolve_type receives the resolved value and returns the concrete type name; member types' is_type_of callbacks are consulted otherwise.

SEE ALSO

GraphQL::Houtou::Type::Interface