line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
|
2
|
|
|
|
|
|
|
use 5.014; |
3
|
18
|
|
|
18
|
|
10580
|
use strict; |
|
18
|
|
|
|
|
60
|
|
4
|
18
|
|
|
18
|
|
99
|
use warnings; |
|
18
|
|
|
|
|
41
|
|
|
18
|
|
|
|
|
308
|
|
5
|
18
|
|
|
18
|
|
75
|
use Moo::Role; |
|
18
|
|
|
|
|
32
|
|
|
18
|
|
|
|
|
414
|
|
6
|
18
|
|
|
18
|
|
122
|
use Types::Standard -all; |
|
18
|
|
|
|
|
35
|
|
|
18
|
|
|
|
|
104
|
|
7
|
18
|
|
|
18
|
|
5882
|
use GraphQL::Type::Library -all; |
|
18
|
|
|
|
|
54
|
|
|
18
|
|
|
|
|
138
|
|
8
|
18
|
|
|
18
|
|
716554
|
use MooX::Thunking; |
|
18
|
|
|
|
|
45
|
|
|
18
|
|
|
|
|
154
|
|
9
|
18
|
|
|
18
|
|
215727
|
|
|
18
|
|
|
|
|
17098
|
|
|
18
|
|
|
|
|
152
|
|
10
|
|
|
|
|
|
|
with qw( |
11
|
|
|
|
|
|
|
GraphQL::Role::FieldDeprecation |
12
|
|
|
|
|
|
|
GraphQL::Role::FieldsEither |
13
|
|
|
|
|
|
|
); |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
our $VERSION = '0.02'; |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
=head1 NAME |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
GraphQL::Role::FieldsOutput - GraphQL object role implementing output fields |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
=head1 SYNOPSIS |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
with qw(GraphQL::Role::FieldsOutput); |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
# or runtime |
26
|
|
|
|
|
|
|
Role::Tiny->apply_roles_to_object($foo, qw(GraphQL::Role::FieldsOutput)); |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
=head1 DESCRIPTION |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
Implements output fields. |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
=head1 ATTRIBUTES |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
=head2 fields |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
Thunk of hash-ref mapping fields to their types. |
37
|
|
|
|
|
|
|
See L<GraphQL::Type::Library/FieldMapOutput>. |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
=cut |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
has fields => (is => 'thunked', isa => FieldMapOutput, required => 1); |
42
|
|
|
|
|
|
|
around fields => sub { |
43
|
|
|
|
|
|
|
my ($orig, $self) = @_; |
44
|
|
|
|
|
|
|
$self->$orig; # de-thunk |
45
|
|
|
|
|
|
|
$self->_fields_deprecation_apply('fields'); |
46
|
|
|
|
|
|
|
$self->{fields}; |
47
|
|
|
|
|
|
|
}; |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
__PACKAGE__->meta->make_immutable(); |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
1; |