line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
|
2
|
|
|
|
|
|
|
use 5.014; |
3
|
18
|
|
|
18
|
|
8618
|
use strict; |
|
18
|
|
|
|
|
60
|
|
4
|
18
|
|
|
18
|
|
819
|
use warnings; |
|
18
|
|
|
|
|
47
|
|
|
18
|
|
|
|
|
376
|
|
5
|
18
|
|
|
18
|
|
73
|
use Moo::Role; |
|
18
|
|
|
|
|
535
|
|
|
18
|
|
|
|
|
609
|
|
6
|
18
|
|
|
18
|
|
93
|
use GraphQL::MaybeTypeCheck; |
|
18
|
|
|
|
|
28
|
|
|
18
|
|
|
|
|
102
|
|
7
|
18
|
|
|
18
|
|
5522
|
use Types::Standard -all; |
|
18
|
|
|
|
|
33
|
|
|
18
|
|
|
|
|
128
|
|
8
|
18
|
|
|
18
|
|
112
|
use GraphQL::Debug qw(_debug); |
|
18
|
|
|
|
|
35
|
|
|
18
|
|
|
|
|
136
|
|
9
|
18
|
|
|
18
|
|
714680
|
|
|
18
|
|
|
|
|
43
|
|
|
18
|
|
|
|
|
1725
|
|
10
|
|
|
|
|
|
|
our $VERSION = '0.02'; |
11
|
|
|
|
|
|
|
use constant DEBUG => $ENV{GRAPHQL_DEBUG}; |
12
|
18
|
|
|
18
|
|
115
|
|
|
18
|
|
|
|
|
34
|
|
|
18
|
|
|
|
|
1646
|
|
13
|
|
|
|
|
|
|
=head1 NAME |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
GraphQL::Role::Leaf - GraphQL "leaf" object role |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
=head1 SYNOPSIS |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
with qw(GraphQL::Role::Leaf); |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
# or runtime |
22
|
|
|
|
|
|
|
Role::Tiny->apply_roles_to_object($foo, qw(GraphQL::Role::Leaf)); |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
=head1 DESCRIPTION |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
Allows type constraints for leaf objects. |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
=cut |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
method _complete_value( |
31
|
|
|
|
|
|
|
HashRef $context, |
32
|
|
|
|
|
|
|
ArrayRef[HashRef] $nodes, |
33
|
|
|
|
|
|
|
HashRef $info, |
34
|
|
|
|
|
|
|
ArrayRef $path, |
35
|
|
|
|
|
|
|
Any $result, |
36
|
|
|
|
|
|
|
) { |
37
|
1111
|
50
|
|
1111
|
|
1981
|
DEBUG and _debug('Leaf._complete_value', $self->to_string, $result); |
|
1111
|
50
|
|
|
|
1975
|
|
|
1111
|
50
|
|
|
|
1362
|
|
|
1111
|
50
|
|
|
|
1953
|
|
|
1111
|
50
|
|
|
|
2025
|
|
|
1111
|
50
|
|
|
|
7280
|
|
|
1111
|
50
|
|
|
|
12285
|
|
|
1111
|
|
|
|
|
6306
|
|
|
1111
|
|
|
|
|
6407
|
|
|
1111
|
|
|
|
|
5678
|
|
38
|
1111
|
|
|
|
|
1501
|
my $serialised = $self->perl_to_graphql($result); |
39
|
1111
|
|
|
|
|
3163
|
die GraphQL::Error->new(message => "Expected a value of type '@{[$self->to_string]}' but received: '$result'.\n$@") if $@; |
40
|
1106
|
50
|
|
|
|
5500
|
+{ data => $serialised }; |
|
0
|
|
|
|
|
0
|
|
41
|
1106
|
|
|
|
|
3772
|
} |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
__PACKAGE__->meta->make_immutable(); |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
1; |