line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package GraphQL::Role::FieldsOutput; |
2
|
|
|
|
|
|
|
|
3
|
18
|
|
|
18
|
|
11948
|
use 5.014; |
|
18
|
|
|
|
|
67
|
|
4
|
18
|
|
|
18
|
|
102
|
use strict; |
|
18
|
|
|
|
|
39
|
|
|
18
|
|
|
|
|
348
|
|
5
|
18
|
|
|
18
|
|
81
|
use warnings; |
|
18
|
|
|
|
|
33
|
|
|
18
|
|
|
|
|
398
|
|
6
|
18
|
|
|
18
|
|
83
|
use Moo::Role; |
|
18
|
|
|
|
|
35
|
|
|
18
|
|
|
|
|
110
|
|
7
|
18
|
|
|
18
|
|
6571
|
use Types::Standard -all; |
|
18
|
|
|
|
|
59
|
|
|
18
|
|
|
|
|
160
|
|
8
|
18
|
|
|
18
|
|
790383
|
use GraphQL::Type::Library -all; |
|
18
|
|
|
|
|
54
|
|
|
18
|
|
|
|
|
178
|
|
9
|
18
|
|
|
18
|
|
238607
|
use MooX::Thunking; |
|
18
|
|
|
|
|
18086
|
|
|
18
|
|
|
|
|
161
|
|
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; |