« blib/lib/GraphQL/Houtou/Runtime/VMOp.pm
↑ Summary
blib/lib/GraphQL/Houtou/Runtime/OperationCompiler.pm »
| 1 | package GraphQL::Houtou::Type::Object; | ||||||||||||||||||||||||||||||||||
| 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 parent 'GraphQL::Houtou::Type'; | ||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||
| 8 | 62 | ▶ | use Role::Tiny::With; | ||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||
| 9 | 62 | ▶ | use GraphQL::Houtou::Directive (); | ||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||
| 10 | 62 | ▶ | use GraphQL::Houtou::Error (); | ||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||
| 11 | 62 | ▶ | use GraphQL::Houtou::Internal::TypeSupport qw( | ||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||
| 12 | apply_fields_deprecation | ||||||||||||||||||||||||||||||||||
| 13 | description_doc_lines | ||||||||||||||||||||||||||||||||||
| 14 | from_ast_fields | ||||||||||||||||||||||||||||||||||
| 15 | from_ast_maptype | ||||||||||||||||||||||||||||||||||
| 16 | make_fieldtuples | ||||||||||||||||||||||||||||||||||
| 17 | named_from_ast | ||||||||||||||||||||||||||||||||||
| 18 | 62 | ); | |||||||||||||||||||||||||||||||||
| 19 | 62 | ▶ | use GraphQL::Houtou::Type::List (); | ||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||
| 20 | 62 | ▶ | use GraphQL::Houtou::Type::NonNull (); | ||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||
| 21 | |||||||||||||||||||||||||||||||||||
| 22 | 62 | with qw( | |||||||||||||||||||||||||||||||||
| 23 | GraphQL::Houtou::Role::Output | ||||||||||||||||||||||||||||||||||
| 24 | GraphQL::Houtou::Role::Composite | ||||||||||||||||||||||||||||||||||
| 25 | GraphQL::Houtou::Role::Named | ||||||||||||||||||||||||||||||||||
| 26 | GraphQL::Houtou::Role::FieldsOutput | ||||||||||||||||||||||||||||||||||
| 27 | GraphQL::Houtou::Role::HashMappable | ||||||||||||||||||||||||||||||||||
| 28 | ); | ||||||||||||||||||||||||||||||||||
| 29 | |||||||||||||||||||||||||||||||||||
| 30 | 144 | ▶ | sub list { | ||||||||||||||||||||||||||||||||
|
Subroutine
list: called CC=2 SCAR=7.2
Pod
undocumented
| |||||||||||||||||||||||||||||||||||
| 31 | 144 | ▶ | $_[0]->{_houtou_list} ||= GraphQL::Houtou::Type::List->new(of => $_[0]); | ||||||||||||||||||||||||||||||||
|
Condition66%2/3
$_[0]{"_houtou_list"} ||= "GraphQL::Houtou::Type::List"->new("of", $_[0])
MC/DC0%0/2
$_[0]{"_houtou_list"} ||= "GraphQL::Houtou::Type::List"->new("of", $_[0])
$_[0]{"_houtou_list"}
"GraphQL::Houtou::Type::List"->new("of", $_[0])
Truth table66%2/3
A ||= B
A= $_[0]{"_houtou_list"}B= "GraphQL::Houtou::Type::List"->new("of", $_[0])
| |||||||||||||||||||||||||||||||||||
| 32 | } | ||||||||||||||||||||||||||||||||||
| 33 | |||||||||||||||||||||||||||||||||||
| 34 | 791 | ▶ | sub non_null { | ||||||||||||||||||||||||||||||||
|
Subroutine
non_null: called CC=2 SCAR=7.2
Pod
undocumented
| |||||||||||||||||||||||||||||||||||
| 35 | 791 | ▶ | $_[0]->{_houtou_non_null} ||= GraphQL::Houtou::Type::NonNull->new(of => $_[0]); | ||||||||||||||||||||||||||||||||
|
Condition66%2/3
$_[0]{"_houtou_non_null"} ||= "GraphQL::Houtou::Type::NonNull"->new("of", $_[0])
MC/DC0%0/2
$_[0]{"_houtou_non_null"} ||= "GraphQL::Houtou::Type::NonNull"->new("of", $_[0])
$_[0]{"_houtou_non_null"}
"GraphQL::Houtou::Type::NonNull"->new("of", $_[0])
Truth table66%2/3
A ||= B
A= $_[0]{"_houtou_non_null"}B= "GraphQL::Houtou::Type::NonNull"->new("of", $_[0])
| |||||||||||||||||||||||||||||||||||
| 36 | } | ||||||||||||||||||||||||||||||||||
| 37 | |||||||||||||||||||||||||||||||||||
| 38 | 62 | ▶ | use constant DEBUG => $ENV{GRAPHQL_DEBUG}; | ||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||
| 39 | |||||||||||||||||||||||||||||||||||
| 40 | 985 | ▶ | sub new { | ||||||||||||||||||||||||||||||||
|
Subroutine
new: called CC=4 SCAR=13.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||
| 41 | 985 | my ($class, %args) = @_; | |||||||||||||||||||||||||||||||||
| 42 | 985 | ▶ | die "GraphQL::Houtou::Type::Object requires name" if !defined $args{name}; | ||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||
| 43 | 985 | ▶ | die "GraphQL::Houtou::Type::Object requires fields" if !exists $args{fields}; | ||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||
| 44 | 985 | my $self = $class->SUPER::new(%args); | |||||||||||||||||||||||||||||||||
| 45 | 985 | $self->{name} = $args{name}; | |||||||||||||||||||||||||||||||||
| 46 | 985 | $self->{description} = $args{description}; | |||||||||||||||||||||||||||||||||
| 47 | 985 | $self->{fields} = $args{fields}; | |||||||||||||||||||||||||||||||||
| 48 | 985 | ▶ | $self->{interfaces} = $args{interfaces} || []; | ||||||||||||||||||||||||||||||||
|
Condition100%2/2
$args{'interfaces'} || []
MC/DC100%1/1
$args{'interfaces'} || []
$args{'interfaces'}
Truth table100%2/2
A
A= $args{'interfaces'}
| |||||||||||||||||||||||||||||||||||
| 49 | 985 | $self->{is_type_of} = $args{is_type_of}; | |||||||||||||||||||||||||||||||||
| 50 | 985 | $self->{runtime_tag} = $args{runtime_tag}; | |||||||||||||||||||||||||||||||||
| 51 | 985 | return $self; | |||||||||||||||||||||||||||||||||
| 52 | } | ||||||||||||||||||||||||||||||||||
| 53 | |||||||||||||||||||||||||||||||||||
| 54 | 59330 | ▶ | sub name { return $_[0]->{name} } | ||||||||||||||||||||||||||||||||
|
Subroutine
name: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||
| 55 | 9424 | ▶ | sub description { return $_[0]->{description} } | ||||||||||||||||||||||||||||||||
|
Subroutine
description: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||
| 56 | 28980 | ▶ | sub to_string { return $_[0]->{to_string} ||= $_[0]->name } | ||||||||||||||||||||||||||||||||
|
Subroutine
to_string: called CC=2 SCAR=7.2
Pod
undocumented
Condition66%2/3
$_[0]{"to_string"} ||= $_[0]->name
MC/DC0%0/2
$_[0]{"to_string"} ||= $_[0]->name
$_[0]{"to_string"}
$_[0]->name
Truth table66%2/3
A ||= B
A= $_[0]{"to_string"}B= $_[0]->name
| |||||||||||||||||||||||||||||||||||
| 57 | 10944 | ▶ | sub is_type_of { return $_[0]->{is_type_of} } | ||||||||||||||||||||||||||||||||
|
Subroutine
is_type_of: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||
| 58 | 1821 | ▶ | sub runtime_tag { return $_[0]->{runtime_tag} } | ||||||||||||||||||||||||||||||||
|
Subroutine
runtime_tag: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||
| 59 | |||||||||||||||||||||||||||||||||||
| 60 | 23545 | ▶ | sub interfaces { | ||||||||||||||||||||||||||||||||
|
Subroutine
interfaces: called CC=2 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||
| 61 | 23545 | my ($self) = @_; | |||||||||||||||||||||||||||||||||
| 62 | 23545 | ▶ | if (ref($self->{interfaces}) eq 'CODE') { | ||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||
| 63 | 137 | $self->{interfaces} = $self->{interfaces}->(); | |||||||||||||||||||||||||||||||||
| 64 | } | ||||||||||||||||||||||||||||||||||
| 65 | 23545 | return $self->{interfaces}; | |||||||||||||||||||||||||||||||||
| 66 | } | ||||||||||||||||||||||||||||||||||
| 67 | |||||||||||||||||||||||||||||||||||
| 68 | 127 | ▶ | sub from_ast { | ||||||||||||||||||||||||||||||||
|
Subroutine
from_ast: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||
| 69 | 127 | my ($class, $name2type, $ast_node) = @_; | |||||||||||||||||||||||||||||||||
| 70 | 127 | return $class->new( | |||||||||||||||||||||||||||||||||
| 71 | named_from_ast($ast_node), | ||||||||||||||||||||||||||||||||||
| 72 | from_ast_maptype($name2type, $ast_node, 'interfaces'), | ||||||||||||||||||||||||||||||||||
| 73 | from_ast_fields($name2type, $ast_node, 'fields'), | ||||||||||||||||||||||||||||||||||
| 74 | ); | ||||||||||||||||||||||||||||||||||
| 75 | } | ||||||||||||||||||||||||||||||||||
| 76 | |||||||||||||||||||||||||||||||||||
| 77 | 24684 | ▶ | sub fields { | ||||||||||||||||||||||||||||||||
|
Subroutine
fields: called CC=3 SCAR=11.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||
| 78 | 24684 | my ($self) = @_; | |||||||||||||||||||||||||||||||||
| 79 | 24684 | ▶ | if (ref($self->{fields}) eq 'CODE') { | ||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||
| 80 | 294 | $self->{fields} = $self->{fields}->(); | |||||||||||||||||||||||||||||||||
| 81 | } | ||||||||||||||||||||||||||||||||||
| 82 | 24683 | ▶ | if (!$self->{_fields_deprecation_applied}) { | ||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||
| 83 | 909 | $self->{fields} = apply_fields_deprecation($self->{fields}); | |||||||||||||||||||||||||||||||||
| 84 | 909 | $self->{_fields_deprecation_applied} = 1; | |||||||||||||||||||||||||||||||||
| 85 | } | ||||||||||||||||||||||||||||||||||
| 86 | 24683 | return $self->{fields}; | |||||||||||||||||||||||||||||||||
| 87 | } | ||||||||||||||||||||||||||||||||||
| 88 | |||||||||||||||||||||||||||||||||||
| 89 | 0 | ▶ | sub graphql_to_perl { | ||||||||||||||||||||||||||||||||
|
Subroutine
graphql_to_perl: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||
| 90 | 0 | my ($self, $item) = @_; | |||||||||||||||||||||||||||||||||
| 91 | 0 | my $fields = $self->fields; | |||||||||||||||||||||||||||||||||
| 92 | |||||||||||||||||||||||||||||||||||
| 93 | 0 | ▶ | return $item if !defined $item; | ||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||
| 94 | 0 | $item = $self->uplift($item); | |||||||||||||||||||||||||||||||||
| 95 | 0 | ▶ | return $self->hashmap($item, $fields, sub { | ||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: not called CC=2 SCAR=17.9
| |||||||||||||||||||||||||||||||||||
| 96 | 0 | my ($key, $value) = @_; | |||||||||||||||||||||||||||||||||
| 97 | 0 | ▶ | return $fields->{$key}{type}->graphql_to_perl($value // $fields->{$key}{default_value}); | ||||||||||||||||||||||||||||||||
|
Condition0%0/3
$value // $fields->{$key}{"default_value"}
MC/DC0%0/2
$value // $fields->{$key}{"default_value"}
$value
$fields->{$key}{"default_value"}
Truth table0%0/3
A // B
A= $valueB= $fields->{$key}{"default_value"}
| |||||||||||||||||||||||||||||||||||
| 98 | 0 | }); | |||||||||||||||||||||||||||||||||
| 99 | } | ||||||||||||||||||||||||||||||||||
| 100 | |||||||||||||||||||||||||||||||||||
| 101 | 0 | ▶ | sub _collect_fields { | ||||||||||||||||||||||||||||||||
|
Subroutine
_collect_fields: not called CC=13 SCAR=52.0
| |||||||||||||||||||||||||||||||||||
| 102 | 0 | my ($self, $context, $selections, $fields_got, $visited_fragments) = @_; | |||||||||||||||||||||||||||||||||
| 103 | |||||||||||||||||||||||||||||||||||
| 104 | 0 | for my $selection (@$selections) { | |||||||||||||||||||||||||||||||||
| 105 | 0 | my $node = $selection; | |||||||||||||||||||||||||||||||||
| 106 | 0 | ▶ | next if !_should_include_node($context->{variable_values}, $node); | ||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||
| 107 | |||||||||||||||||||||||||||||||||||
| 108 | 0 | ▶ | if ($selection->{kind} eq 'field') { | ||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||
| 109 | 0 | ▶ | my $use_name = $node->{alias} || $node->{name}; | ||||||||||||||||||||||||||||||||
|
Condition0%0/3
$node->{'alias'} || $node->{'name'}
MC/DC0%0/2
$node->{'alias'} || $node->{'name'}
$node->{'alias'}
$node->{'name'}
Truth table0%0/3
A || B
A= $node->{'alias'}B= $node->{'name'}
| |||||||||||||||||||||||||||||||||||
| 110 | 0 | my ($field_names, $nodes_defs) = @$fields_got; | |||||||||||||||||||||||||||||||||
| 111 | 0 | ▶ | $field_names = [ @$field_names, $use_name ] if !exists $nodes_defs->{$use_name}; | ||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||
| 112 | $nodes_defs = { | ||||||||||||||||||||||||||||||||||
| 113 | %$nodes_defs, | ||||||||||||||||||||||||||||||||||
| 114 | 0 | ▶ | $use_name => [ @{ $nodes_defs->{$use_name} || [] }, $node ], | ||||||||||||||||||||||||||||||||
|
Condition0%0/2
$nodes_defs->{$use_name} || []
MC/DC0%0/1
$nodes_defs->{$use_name} || []
$nodes_defs->{$use_name}
Truth table0%0/2
A
A= $nodes_defs->{$use_name}
| |||||||||||||||||||||||||||||||||||
| 115 | }; | ||||||||||||||||||||||||||||||||||
| 116 | 0 | $fields_got = [ $field_names, $nodes_defs ]; | |||||||||||||||||||||||||||||||||
| 117 | 0 | next; | |||||||||||||||||||||||||||||||||
| 118 | } | ||||||||||||||||||||||||||||||||||
| 119 | |||||||||||||||||||||||||||||||||||
| 120 | 0 | ▶ | if ($selection->{kind} eq 'inline_fragment') { | ||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||
| 121 | 0 | ▶ | next if !$self->_fragment_condition_match($context, $node); | ||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||
| 122 | ($fields_got, $visited_fragments) = $self->_collect_fields( | ||||||||||||||||||||||||||||||||||
| 123 | $context, | ||||||||||||||||||||||||||||||||||
| 124 | $node->{selections}, | ||||||||||||||||||||||||||||||||||
| 125 | 0 | $fields_got, | |||||||||||||||||||||||||||||||||
| 126 | $visited_fragments, | ||||||||||||||||||||||||||||||||||
| 127 | ); | ||||||||||||||||||||||||||||||||||
| 128 | 0 | next; | |||||||||||||||||||||||||||||||||
| 129 | } | ||||||||||||||||||||||||||||||||||
| 130 | |||||||||||||||||||||||||||||||||||
| 131 | 0 | ▶ | if ($selection->{kind} eq 'fragment_spread') { | ||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||
| 132 | 0 | my $frag_name = $node->{name}; | |||||||||||||||||||||||||||||||||
| 133 | 0 | my $fragment; | |||||||||||||||||||||||||||||||||
| 134 | 0 | ▶ | next if $visited_fragments->{$frag_name}; | ||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||
| 135 | 0 | $visited_fragments = { %$visited_fragments, $frag_name => 1 }; | |||||||||||||||||||||||||||||||||
| 136 | 0 | $fragment = $context->{fragments}{$frag_name}; | |||||||||||||||||||||||||||||||||
| 137 | 0 | ▶ | next if !$fragment; | ||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||
| 138 | 0 | ▶ | next if !$self->_fragment_condition_match($context, $fragment); | ||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||
| 139 | ($fields_got, $visited_fragments) = $self->_collect_fields( | ||||||||||||||||||||||||||||||||||
| 140 | $context, | ||||||||||||||||||||||||||||||||||
| 141 | $fragment->{selections}, | ||||||||||||||||||||||||||||||||||
| 142 | 0 | $fields_got, | |||||||||||||||||||||||||||||||||
| 143 | $visited_fragments, | ||||||||||||||||||||||||||||||||||
| 144 | ); | ||||||||||||||||||||||||||||||||||
| 145 | } | ||||||||||||||||||||||||||||||||||
| 146 | } | ||||||||||||||||||||||||||||||||||
| 147 | |||||||||||||||||||||||||||||||||||
| 148 | 0 | return ($fields_got, $visited_fragments); | |||||||||||||||||||||||||||||||||
| 149 | } | ||||||||||||||||||||||||||||||||||
| 150 | |||||||||||||||||||||||||||||||||||
| 151 | 0 | ▶ | sub _fragment_condition_match { | ||||||||||||||||||||||||||||||||
|
Subroutine
_fragment_condition_match: not called CC=11 SCAR=48.8
| |||||||||||||||||||||||||||||||||||
| 152 | 0 | my ($self, $context, $node) = @_; | |||||||||||||||||||||||||||||||||
| 153 | 0 | my $condition_type; | |||||||||||||||||||||||||||||||||
| 154 | 0 | my $schema = $context->{schema}; | |||||||||||||||||||||||||||||||||
| 155 | 0 | ▶ | my $runtime_cache = $context->{runtime_cache} || $schema->runtime_cache || $schema->prepare_runtime; | ||||||||||||||||||||||||||||||||
|
Condition0%0/6
$context->{'runtime_cache'} || $schema->runtime_cache || $schema->prepare_runtime
$context->{"runtime_cache"} or $schema->runtime_cache
MC/DC0%0/3
$context->{'runtime_cache'} || $schema->runtime_cache || $schema->prepare_runtime
$context->{"runtime_cache"}
$schema->runtime_cache
$schema->prepare_runtime
Truth table0%0/4
A or B || C
A= $context->{"runtime_cache"}B= $schema->runtime_cacheC= $schema->prepare_runtime
| |||||||||||||||||||||||||||||||||||
| 156 | 0 | ▶ | my $name2type = $runtime_cache->{name2type} || $schema->name2type; | ||||||||||||||||||||||||||||||||
|
Condition0%0/3
$runtime_cache->{'name2type'} || $schema->name2type
MC/DC0%0/2
$runtime_cache->{'name2type'} || $schema->name2type
$runtime_cache->{'name2type'}
$schema->name2type
Truth table0%0/3
A || B
A= $runtime_cache->{'name2type'}B= $schema->name2type
| |||||||||||||||||||||||||||||||||||
| 157 | 0 | ▶ | my $possible_type_map = $runtime_cache->{possible_type_map} ||= {}; | ||||||||||||||||||||||||||||||||
|
Condition0%0/2
$runtime_cache->{"possible_type_map"} ||= {}
MC/DC0%0/1
$runtime_cache->{"possible_type_map"} ||= {}
$runtime_cache->{"possible_type_map"}
Truth table0%0/2
A
A= $runtime_cache->{"possible_type_map"}
| |||||||||||||||||||||||||||||||||||
| 158 | |||||||||||||||||||||||||||||||||||
| 159 | 0 | ▶ | return 1 if !$node->{on}; | ||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||
| 160 | 0 | ▶ | return 1 if $node->{on} eq $self->name; | ||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||
| 161 | $condition_type = $name2type->{ $node->{on} } | ||||||||||||||||||||||||||||||||||
| 162 | 0 | ▶ | // die GraphQL::Houtou::Error->new( | ||||||||||||||||||||||||||||||||
|
Condition0%0/2
$$name2type{$node->{"on"}} // die("GraphQL::Houtou::Error"->new("message", qq[Unknown type for fragment condition '$node->{"on"}'.]))
MC/DC0%0/1
$$name2type{$node->{"on"}} // die("GraphQL::Houtou::Error"->new("message", qq[Unknown type for fragment condition '$node->{"on"}'.]))
$$name2type{$node->{"on"}}
Truth table0%0/2
A
A= $$name2type{$node->{"on"}}
| |||||||||||||||||||||||||||||||||||
| 163 | message => "Unknown type for fragment condition '$node->{on}'." | ||||||||||||||||||||||||||||||||||
| 164 | ); | ||||||||||||||||||||||||||||||||||
| 165 | 0 | ▶ | return '' if !$condition_type->DOES('GraphQL::Houtou::Role::Abstract') | ||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$condition_type->DOES("GraphQL::Houtou::Role::Abstract") or $condition_type->DOES("GraphQL::Role::Abstract")
MC/DC0%0/2
$condition_type->DOES("GraphQL::Houtou::Role::Abstract") or $condition_type->DOES("GraphQL::Role::Abstract")
$condition_type->DOES("GraphQL::Houtou::Role::Abstract")
$condition_type->DOES("GraphQL::Role::Abstract")
Truth table0%0/3
A or B
A= $condition_type->DOES("GraphQL::Houtou::Role::Abstract")B= $condition_type->DOES("GraphQL::Role::Abstract")
| |||||||||||||||||||||||||||||||||||
| 166 | && !$condition_type->DOES('GraphQL::Role::Abstract'); | ||||||||||||||||||||||||||||||||||
| 167 | return $possible_type_map->{ $condition_type->name }{ $self->name } | ||||||||||||||||||||||||||||||||||
| 168 | 0 | ▶ | if exists $possible_type_map->{ $condition_type->name }; | ||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||
| 169 | 0 | return $schema->is_possible_type($condition_type, $self); | |||||||||||||||||||||||||||||||||
| 170 | } | ||||||||||||||||||||||||||||||||||
| 171 | |||||||||||||||||||||||||||||||||||
| 172 | 0 | ▶ | sub _should_include_node { | ||||||||||||||||||||||||||||||||
|
Subroutine
_should_include_node: not called CC=5 SCAR=34.0
| |||||||||||||||||||||||||||||||||||
| 173 | 0 | my ($variables, $node) = @_; | |||||||||||||||||||||||||||||||||
| 174 | 0 | my $skip = $GraphQL::Houtou::Directive::SKIP->_get_directive_values($node, $variables); | |||||||||||||||||||||||||||||||||
| 175 | 0 | ▶ | return '' if $skip && $skip->{if}; | ||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$skip and $skip->{"if"}
MC/DC0%0/2
$skip and $skip->{"if"}
$skip
$skip->{"if"}
Truth table0%0/3
A and B
A= $skipB= $skip->{"if"}
| |||||||||||||||||||||||||||||||||||
| 176 | 0 | my $include = $GraphQL::Houtou::Directive::INCLUDE->_get_directive_values($node, $variables); | |||||||||||||||||||||||||||||||||
| 177 | 0 | ▶ | return '' if $include && !$include->{if}; | ||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$include and not $include->{"if"}
MC/DC0%0/2
$include and not $include->{"if"}
$include
not $include->{"if"}
Truth table0%0/3
A and not(B)
A= $includeB= not $include->{"if"}
| |||||||||||||||||||||||||||||||||||
| 178 | 0 | return 1; | |||||||||||||||||||||||||||||||||
| 179 | } | ||||||||||||||||||||||||||||||||||
| 180 | |||||||||||||||||||||||||||||||||||
| 181 | 0 | ▶ | sub _complete_value { | ||||||||||||||||||||||||||||||||
|
Subroutine
_complete_value: not called CC=1 SCAR=6.9
| |||||||||||||||||||||||||||||||||||
| 182 | 0 | my ($self) = @_; | |||||||||||||||||||||||||||||||||
| 183 | 0 | die "Type::Object->_complete_value is part of the removed legacy execution path; use GraphQL::Houtou::Schema->build_runtime or ->build_native_runtime for object completion on '@{[$self->name]}'.\n"; | |||||||||||||||||||||||||||||||||
| 184 | } | ||||||||||||||||||||||||||||||||||
| 185 | |||||||||||||||||||||||||||||||||||
| 186 | 219 | ▶ | sub to_doc { | ||||||||||||||||||||||||||||||||
|
Subroutine
to_doc: called CC=5 SCAR=16.2
Pod
undocumented
| |||||||||||||||||||||||||||||||||||
| 187 | 219 | my ($self) = @_; | |||||||||||||||||||||||||||||||||
| 188 | 219 | ▶ | return $self->{to_doc} if exists $self->{to_doc}; | ||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||
| 189 | my @fieldlines = map { | ||||||||||||||||||||||||||||||||||
| 190 | 115 | my ($main, @description) = @$_; | |||||||||||||||||||||||||||||||||
| 191 | 516 | (@description, $main); | |||||||||||||||||||||||||||||||||
| 192 | } make_fieldtuples($self->fields); | ||||||||||||||||||||||||||||||||||
| 193 | 115 | ▶ | my $implements = join ' & ', map $_->name, @{ $self->interfaces || [] }; | ||||||||||||||||||||||||||||||||
|
Condition50%1/2
$self->interfaces || []
MC/DC0%0/1
$self->interfaces || []
$self->interfaces
Truth table50%1/2
A
A= $self->interfaces
| |||||||||||||||||||||||||||||||||||
| 194 | 115 | ▶ | $implements &&= 'implements ' . $implements . ' '; | ||||||||||||||||||||||||||||||||
|
Condition100%2/2
$implements &&= 'implements ' . $implements . ' '
MC/DC100%1/1
$implements &&= 'implements ' . $implements . ' '
$implements
Truth table100%2/2
A
A= $implements
| |||||||||||||||||||||||||||||||||||
| 195 | 115 | return $self->{to_doc} = join '', map "$_\n", | |||||||||||||||||||||||||||||||||
| 196 | description_doc_lines($self->description), | ||||||||||||||||||||||||||||||||||
| 197 | 115 | ▶ | "type @{[$self->name]} $implements\{", | ||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||
| 198 | (map length() ? " $_" : "", @fieldlines), | ||||||||||||||||||||||||||||||||||
| 199 | "}"; | ||||||||||||||||||||||||||||||||||
| 200 | } | ||||||||||||||||||||||||||||||||||
| 201 | |||||||||||||||||||||||||||||||||||
| 202 | 62 | 1; | |||||||||||||||||||||||||||||||||
| 203 | |||||||||||||||||||||||||||||||||||
| 204 | __END__ | ||||||||||||||||||||||||||||||||||