line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package GraphQL::Role::Nullable; |
2
|
|
|
|
|
|
|
|
3
|
18
|
|
|
18
|
|
11177
|
use 5.014; |
|
18
|
|
|
|
|
64
|
|
4
|
18
|
|
|
18
|
|
98
|
use strict; |
|
18
|
|
|
|
|
36
|
|
|
18
|
|
|
|
|
544
|
|
5
|
18
|
|
|
18
|
|
81
|
use warnings; |
|
18
|
|
|
|
|
32
|
|
|
18
|
|
|
|
|
689
|
|
6
|
18
|
|
|
18
|
|
98
|
use Types::Standard -all; |
|
18
|
|
|
|
|
34
|
|
|
18
|
|
|
|
|
156
|
|
7
|
18
|
|
|
18
|
|
793243
|
use Moo::Role; |
|
18
|
|
|
|
|
49
|
|
|
18
|
|
|
|
|
197
|
|
8
|
18
|
|
|
18
|
|
22321
|
use GraphQL::Type::NonNull; |
|
18
|
|
|
|
|
62
|
|
|
18
|
|
|
|
|
152
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
our $VERSION = '0.02'; |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
=head1 NAME |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
GraphQL::Role::Nullable - GraphQL object role |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
=head1 SYNOPSIS |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
with qw(GraphQL::Role::Nullable); |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
# or runtime |
21
|
|
|
|
|
|
|
Role::Tiny->apply_roles_to_object($foo, qw(GraphQL::Role::Nullable)); |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
=head1 DESCRIPTION |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
Allows type constraints for nullable objects. |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
=head1 METHODS |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
=head2 non_null |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
Returns a wrapped version of the type using L<GraphQL::Type::NonNull>, |
32
|
|
|
|
|
|
|
i.e. that may not be null. |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
=cut |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
has non_null => ( |
37
|
|
|
|
|
|
|
is => 'lazy', |
38
|
|
|
|
|
|
|
isa => InstanceOf['GraphQL::Type::NonNull'], |
39
|
242
|
|
|
242
|
|
104314
|
builder => sub { GraphQL::Type::NonNull->new(of => $_[0]) }, |
40
|
|
|
|
|
|
|
); |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
__PACKAGE__->meta->make_immutable(); |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
1; |