GraphQL/Role/FieldsOutput.pm

filter: Statementstmt 100% 30 / 30 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 8 / 8 Podpod n/a totaltotal 100% 38 / 38 CC 1 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« GraphQL/Role/FieldsInput.pm ↑ Summary GraphQL/Role/Input.pm »
1 package GraphQL::Role::FieldsOutput;
2  
3 18 ▶use 5.014;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 18 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 18 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 18 ▶use Moo::Role;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 18 ▶use Types::Standard -all;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 18 ▶use GraphQL::Type::Library -all;
Subroutine BEGIN: called CC=1 SCAR=0.0
9 18 ▶use MooX::Thunking;
Subroutine BEGIN: called CC=1 SCAR=0.0
10  
11 18 with qw(
12 GraphQL::Role::FieldDeprecation
13 GraphQL::Role::FieldsEither
14 );
15  
16 18 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 18 has fields => (is => 'thunked', isa => FieldMapOutput, required => 1);
43 2785 ▶around fields => sub {
Subroutine __ANON__: called CC=1 SCAR=0.0
44 2785 my ($orig, $self) = @_;
45 2785 $self->$orig; # de-thunk
46 2783 $self->_fields_deprecation_apply('fields');
47 2783 $self->{fields};
48 18 };
49  
50 18 __PACKAGE__->meta->make_immutable();
51  
52 18 1;
« GraphQL/Role/FieldsInput.pm ↑ Summary GraphQL/Role/Input.pm »