line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package GraphQL::Role::Nullable; |
2
|
|
|
|
|
|
|
|
3
|
18
|
|
|
18
|
|
10284
|
use 5.014; |
|
18
|
|
|
|
|
71
|
|
4
|
18
|
|
|
18
|
|
106
|
use strict; |
|
18
|
|
|
|
|
33
|
|
|
18
|
|
|
|
|
429
|
|
5
|
18
|
|
|
18
|
|
94
|
use warnings; |
|
18
|
|
|
|
|
38
|
|
|
18
|
|
|
|
|
628
|
|
6
|
18
|
|
|
18
|
|
95
|
use Types::Standard -all; |
|
18
|
|
|
|
|
36
|
|
|
18
|
|
|
|
|
145
|
|
7
|
18
|
|
|
18
|
|
839963
|
use Moo::Role; |
|
18
|
|
|
|
|
48
|
|
|
18
|
|
|
|
|
179
|
|
8
|
18
|
|
|
18
|
|
20951
|
use GraphQL::Type::NonNull; |
|
18
|
|
|
|
|
71
|
|
|
18
|
|
|
|
|
135
|
|
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
|
|
103749
|
builder => sub { GraphQL::Type::NonNull->new(of => $_[0]) }, |
40
|
|
|
|
|
|
|
); |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
__PACKAGE__->meta->make_immutable(); |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
1; |