blib/lib/GraphQL/Houtou/Role/Leaf.pm

filter: Statementstmt 68.1% 15 / 22 Branchbran 0.0% 0 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 83.3% 5 / 6 Podpod n/a totaltotal 66.6% 20 / 30 CC 2 SCAR 8.9
CC
2
Cov
62%
_complete_value
6.0
BEGIN
1.0
BEGIN
1.0
CRAP 2.4
« blib/lib/GraphQL/Houtou/Runtime/InputCoercion.pm ↑ Summary blib/lib/GraphQL/Houtou/Type.pm »
1 package GraphQL::Houtou::Role::Leaf;
2  
3 62 ▶use 5.014;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 62 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 62 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 62 ▶use Role::Tiny;
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 62 ▶use GraphQL::Houtou::Error ();
Subroutine BEGIN: called CC=1 SCAR=0.0
10  
11 # Runtime completion helpers for scalar-like leaf values.
12  
13 0 ▶sub _complete_value {
Subroutine _complete_value: not called CC=2 SCAR=17.9
14 0 my ($self, $context, $nodes, $info, $path, $result) = @_;
15 0 my $serialised = eval { $self->perl_to_graphql($result) };
16 0 my $error = $@;
17  
18 0 ▶ die GraphQL::Houtou::Error->new(
Branch: 1 branch
BranchTrueFalseTotal
if $error 0 0 0
19 0 message => "Expected a value of type '@{[$self->to_string]}' but received: '$result'.\n$error"
20 ) if $error;
21  
22 0 return +{ data => $serialised };
23 }
24  
25 62 1;
« blib/lib/GraphQL/Houtou/Runtime/InputCoercion.pm ↑ Summary blib/lib/GraphQL/Houtou/Type.pm »