line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
|
2
|
|
|
|
|
|
|
use 5.014; |
3
|
18
|
|
|
18
|
|
11565
|
use strict; |
|
18
|
|
|
|
|
71
|
|
4
|
18
|
|
|
18
|
|
88
|
use warnings; |
|
18
|
|
|
|
|
37
|
|
|
18
|
|
|
|
|
387
|
|
5
|
18
|
|
|
18
|
|
75
|
use Moo::Role; |
|
18
|
|
|
|
|
29
|
|
|
18
|
|
|
|
|
426
|
|
6
|
18
|
|
|
18
|
|
79
|
use Types::Standard -all; |
|
18
|
|
|
|
|
29
|
|
|
18
|
|
|
|
|
106
|
|
7
|
18
|
|
|
18
|
|
6700
|
use GraphQL::MaybeTypeCheck; |
|
18
|
|
|
|
|
37
|
|
|
18
|
|
|
|
|
116
|
|
8
|
18
|
|
|
18
|
|
715441
|
use GraphQL::Type::Library qw(StrNameValid); |
|
18
|
|
|
|
|
53
|
|
|
18
|
|
|
|
|
167
|
|
9
|
18
|
|
|
18
|
|
97
|
|
|
18
|
|
|
|
|
34
|
|
|
18
|
|
|
|
|
147
|
|
10
|
|
|
|
|
|
|
our $VERSION = '0.02'; |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
=head1 NAME |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
GraphQL::Role::Named - GraphQL "named" object role |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
=head1 SYNOPSIS |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
with qw(GraphQL::Role::Named); |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
=head1 DESCRIPTION |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
Allows type constraints for named objects, providing also C<name> and |
23
|
|
|
|
|
|
|
C<description> attributes. |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
=head1 ATTRIBUTES |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
=head2 name |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
=cut |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
has name => (is => 'ro', isa => StrNameValid, required => 1); |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
=head2 description |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
Optional description. |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
=cut |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
has description => (is => 'ro', isa => Str); |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
=head1 METHODS |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
=head2 to_string |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
Part of serialisation. |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
=cut |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
has to_string => (is => 'lazy', isa => Str, init_arg => undef, builder => sub { |
50
|
|
|
|
|
|
|
my ($self) = @_; |
51
|
41
|
|
|
41
|
|
7436
|
$self->name; |
52
|
41
|
|
|
|
|
633
|
}); |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
method _from_ast_named( |
55
|
|
|
|
|
|
|
HashRef $ast_node, |
56
|
|
|
|
|
|
|
) { |
57
|
105
|
50
|
|
105
|
|
325
|
( |
|
105
|
50
|
|
|
|
303
|
|
|
105
|
50
|
|
|
|
148
|
|
|
105
|
|
|
|
|
210
|
|
|
105
|
|
|
|
|
255
|
|
|
105
|
|
|
|
|
620
|
|
58
|
|
|
|
|
|
|
name => $ast_node->{name}, |
59
|
|
|
|
|
|
|
($ast_node->{description} ? (description => $ast_node->{description}) : ()), |
60
|
105
|
100
|
|
|
|
1184
|
); |
61
|
|
|
|
|
|
|
} |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
__PACKAGE__->meta->make_immutable(); |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
1; |