line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
|
2
|
|
|
|
|
|
|
use 5.014; |
3
|
18
|
|
|
18
|
|
386
|
use strict; |
|
18
|
|
|
|
|
59
|
|
4
|
18
|
|
|
18
|
|
83
|
use warnings; |
|
18
|
|
|
|
|
34
|
|
|
18
|
|
|
|
|
321
|
|
5
|
18
|
|
|
18
|
|
76
|
use Moo; |
|
18
|
|
|
|
|
33
|
|
|
18
|
|
|
|
|
359
|
|
6
|
18
|
|
|
18
|
|
84
|
use Types::Standard -all; |
|
18
|
|
|
|
|
33
|
|
|
18
|
|
|
|
|
117
|
|
7
|
18
|
|
|
18
|
|
5834
|
use GraphQL::MaybeTypeCheck; |
|
18
|
|
|
|
|
46
|
|
|
18
|
|
|
|
|
124
|
|
8
|
18
|
|
|
18
|
|
717565
|
extends qw(GraphQL::Type); |
|
18
|
|
|
|
|
44
|
|
|
18
|
|
|
|
|
177
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
our $VERSION = '0.02'; |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
# A-ha |
13
|
|
|
|
|
|
|
my @TAKE_ON_ME = qw( |
14
|
|
|
|
|
|
|
GraphQL::Role::Input |
15
|
|
|
|
|
|
|
GraphQL::Role::Output |
16
|
|
|
|
|
|
|
); |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
=head1 NAME |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
GraphQL::Type::NonNull - GraphQL type that is a non-null version of another type |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
=head1 SYNOPSIS |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
use GraphQL::Type::NonNull; |
25
|
|
|
|
|
|
|
my $type = GraphQL::Type::NonNull->new(of => $other_type); |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
=head1 DESCRIPTION |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
Type that is a wrapper for another type. Means data cannot be a null value. |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
=head1 ATTRIBUTES |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
=head2 of |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
GraphQL type object of which this is a non-null version. |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
=cut |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
has of => ( |
40
|
|
|
|
|
|
|
is => 'ro', |
41
|
|
|
|
|
|
|
isa => InstanceOf['GraphQL::Type'], |
42
|
|
|
|
|
|
|
required => 1, |
43
|
|
|
|
|
|
|
handles => [ qw(name) ], |
44
|
|
|
|
|
|
|
); |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
=head1 METHODS |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
=head2 BUILD |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
L<Moo> method that applies the relevant roles. |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
=cut |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
my ($self, $args) = @_; |
55
|
|
|
|
|
|
|
my $of = $self->of; |
56
|
242
|
|
|
242
|
1
|
51684
|
Role::Tiny->apply_roles_to_object($self, grep $of->DOES($_), @TAKE_ON_ME); |
57
|
242
|
|
|
|
|
610
|
} |
58
|
242
|
|
|
|
|
942
|
|
59
|
|
|
|
|
|
|
=head2 to_string |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
Part of serialisation. |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
=cut |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
has to_string => (is => 'lazy', isa => Str, init_arg => undef, builder => sub { |
66
|
|
|
|
|
|
|
my ($self) = @_; |
67
|
|
|
|
|
|
|
$self->of->to_string . '!'; |
68
|
12
|
|
|
12
|
|
446
|
}); |
69
|
12
|
|
|
|
|
202
|
|
70
|
|
|
|
|
|
|
=head2 is_valid |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
True if given Perl value is a valid value for this type. |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
=cut |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
method is_valid(Any $item) :ReturnType(Bool) { |
77
|
|
|
|
|
|
|
return if !defined $item or !$self->of->is_valid($item); |
78
|
1
|
50
|
|
1
|
1
|
1376
|
1; |
|
1
|
50
|
|
|
|
4
|
|
|
1
|
50
|
|
|
|
3
|
|
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
36
|
|
79
|
1
|
50
|
33
|
|
|
12
|
} |
80
|
1
|
|
|
|
|
18
|
|
81
|
18
|
|
|
18
|
|
2995
|
method graphql_to_perl(Any $item) :ReturnType(Any) { |
|
18
|
|
|
|
|
44
|
|
|
18
|
|
|
|
|
144
|
|
82
|
|
|
|
|
|
|
my $of = $self->of; |
83
|
75
|
50
|
|
75
|
1
|
187
|
$of->graphql_to_perl($item) // die $self->to_string . " given null value.\n"; |
|
75
|
50
|
|
|
|
171
|
|
|
75
|
50
|
|
|
|
108
|
|
|
75
|
|
|
|
|
149
|
|
|
75
|
|
|
|
|
172
|
|
|
75
|
|
|
|
|
450
|
|
84
|
75
|
|
|
|
|
207
|
} |
85
|
75
|
|
100
|
|
|
278
|
|
86
|
18
|
|
|
18
|
|
8654
|
=head2 name |
|
18
|
|
|
|
|
39
|
|
|
18
|
|
|
|
|
109
|
|
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
The C<name> of the type this object is a non-null version of. |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
=cut |
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
__PACKAGE__->meta->make_immutable(); |
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
1; |