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