line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package GraphQL::Role::Leaf; |
2
|
|
|
|
|
|
|
|
3
|
18
|
|
|
18
|
|
9122
|
use 5.014; |
|
18
|
|
|
|
|
62
|
|
4
|
18
|
|
|
18
|
|
818
|
use strict; |
|
18
|
|
|
|
|
39
|
|
|
18
|
|
|
|
|
446
|
|
5
|
18
|
|
|
18
|
|
83
|
use warnings; |
|
18
|
|
|
|
|
557
|
|
|
18
|
|
|
|
|
616
|
|
6
|
18
|
|
|
18
|
|
100
|
use Moo::Role; |
|
18
|
|
|
|
|
29
|
|
|
18
|
|
|
|
|
90
|
|
7
|
18
|
|
|
18
|
|
6688
|
use GraphQL::MaybeTypeCheck; |
|
18
|
|
|
|
|
40
|
|
|
18
|
|
|
|
|
118
|
|
8
|
18
|
|
|
18
|
|
97
|
use Types::Standard -all; |
|
18
|
|
|
|
|
34
|
|
|
18
|
|
|
|
|
156
|
|
9
|
18
|
|
|
18
|
|
789681
|
use GraphQL::Debug qw(_debug); |
|
18
|
|
|
|
|
47
|
|
|
18
|
|
|
|
|
1937
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
our $VERSION = '0.02'; |
12
|
18
|
|
|
18
|
|
129
|
use constant DEBUG => $ENV{GRAPHQL_DEBUG}; |
|
18
|
|
|
|
|
37
|
|
|
18
|
|
|
|
|
1798
|
|
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
=head1 NAME |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
GraphQL::Role::Leaf - GraphQL "leaf" object role |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
=head1 SYNOPSIS |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
with qw(GraphQL::Role::Leaf); |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
# or runtime |
23
|
|
|
|
|
|
|
Role::Tiny->apply_roles_to_object($foo, qw(GraphQL::Role::Leaf)); |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
=head1 DESCRIPTION |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
Allows type constraints for leaf objects. |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
=cut |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
method _complete_value( |
32
|
|
|
|
|
|
|
HashRef $context, |
33
|
|
|
|
|
|
|
ArrayRef[HashRef] $nodes, |
34
|
|
|
|
|
|
|
HashRef $info, |
35
|
|
|
|
|
|
|
ArrayRef $path, |
36
|
|
|
|
|
|
|
Any $result, |
37
|
1111
|
50
|
|
1111
|
|
2353
|
) { |
|
1111
|
50
|
|
|
|
2349
|
|
|
1111
|
50
|
|
|
|
1537
|
|
|
1111
|
50
|
|
|
|
2306
|
|
|
1111
|
50
|
|
|
|
2135
|
|
|
1111
|
50
|
|
|
|
7047
|
|
|
1111
|
50
|
|
|
|
12522
|
|
|
1111
|
|
|
|
|
6697
|
|
|
1111
|
|
|
|
|
6569
|
|
|
1111
|
|
|
|
|
5704
|
|
38
|
1111
|
|
|
|
|
1362
|
DEBUG and _debug('Leaf._complete_value', $self->to_string, $result); |
39
|
1111
|
|
|
|
|
3646
|
my $serialised = $self->perl_to_graphql($result); |
40
|
1106
|
50
|
|
|
|
6076
|
die GraphQL::Error->new(message => "Expected a value of type '@{[$self->to_string]}' but received: '$result'.\n$@") if $@; |
|
0
|
|
|
|
|
0
|
|
41
|
1106
|
|
|
|
|
3769
|
+{ data => $serialised }; |
42
|
|
|
|
|
|
|
} |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
__PACKAGE__->meta->make_immutable(); |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
1; |