1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
|
use 5.014;
use strict;
use warnings;
use Test::More;
use Test::Exception;
BEGIN {
use_ok( 'GraphQL::Type::Interface' ) || print "Bail out!\n";
use_ok( 'GraphQL::Type::Scalar', qw($String) ) || print "Bail out!\n";
}
my $interface_type = GraphQL::Type::Interface->new(
name => 'Interface',
fields => { field_name => { type => $String } },
resolve_type => sub {
return $String;
},
);
throws_ok {
GraphQL::Type::Interface->new(
name => '@Interface',
fields => { field_name => { type => $String } },
)
} qr/did not pass type constraint/, 'name validation';
done_testing;
|