| 1 | package GraphQL::Houtou::Role::Abstract; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 3 | 21 | ▶ | use 5.014; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 4 | 21 | ▶ | use strict; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 5 | 21 | ▶ | use warnings; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 6 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 7 | 21 | ▶ | use Role::Tiny; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 8 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 9 | 21 | ▶ | use GraphQL::Houtou::Error (); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 10 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 11 | # Runtime completion helpers for interfaces and unions. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 12 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 13 | 0 | ▶ | sub _complete_value { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_complete_value: not called CC=1 SCAR=6.9
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 14 | 0 | my ($self) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 15 | 0 | die "Abstract::_complete_value is part of the removed legacy execution path; use GraphQL::Houtou::Schema->build_runtime or ->build_native_runtime for abstract completion on '@{[$self->name]}'.\n"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 16 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 17 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 18 | 0 | ▶ | sub _ensure_valid_runtime_type { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_ensure_valid_runtime_type: not called CC=7 SCAR=40.3
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 19 | 0 | my ($self, $runtime_type_or_name, $context, $nodes, $info, $result) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 20 | my $runtime_type = ref($runtime_type_or_name) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 21 | ? $runtime_type_or_name | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 22 | 0 | ▶ | : $context->{schema}->name2type->{$runtime_type_or_name}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 23 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 24 | 0 | ▶ | die GraphQL::Houtou::Error->new( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/6
$runtime_type and $runtime_type->isa("GraphQL::Houtou::Type::Object") || $runtime_type->isa("GraphQL::Type::Object")
$runtime_type->isa("GraphQL::Houtou::Type::Object") or $runtime_type->isa("GraphQL::Type::Object")
MC/DC0%0/3
$runtime_type and $runtime_type->isa("GraphQL::Houtou::Type::Object") || $runtime_type->isa("GraphQL::Type::Object")
$runtime_type
$runtime_type->isa("GraphQL::Houtou::Type::Object")
$runtime_type->isa("GraphQL::Type::Object")
Truth table0%0/4
A and B or C
A= $runtime_typeB= $runtime_type->isa("GraphQL::Houtou::Type::Object")C= $runtime_type->isa("GraphQL::Type::Object")
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 25 | 0 | message => "Abstract type @{[$self->name]} must resolve to an " . | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 26 | 0 | "Object type at runtime for field @{[$info->{parent_type}->name]}." . | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 27 | 0 | ▶ | "@{[$info->{field_name}]} with value $result, received '" . | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 28 | ($runtime_type ? $runtime_type->name : 'undef') . "'.", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 29 | nodes => [ $nodes ], | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 30 | ) if !$runtime_type | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 31 | || !($runtime_type->isa('GraphQL::Houtou::Type::Object') | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 32 | || $runtime_type->isa('GraphQL::Type::Object')); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 33 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 34 | die GraphQL::Houtou::Error->new( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 35 | 0 | message => "Runtime Object type '@{[$runtime_type->name]}' is not a possible type for " . | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 36 | 0 | "'@{[$self->name]}'.", | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 37 | nodes => [ $nodes ], | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 38 | 0 | ▶ | ) if !$context->{schema}->is_possible_type($self, $runtime_type); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 39 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 40 | 0 | return $runtime_type; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 41 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 42 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 43 | 0 | ▶ | sub _default_resolve_type { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_default_resolve_type: not called CC=19 SCAR=59.4
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 44 | 0 | my ($value, $context, $info, $abstract_type) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 45 | 0 | ▶ | my $schema = ($info && $info->{schema}) || $context->{schema}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/6
$info && $info->{'schema'} || $context->{'schema'}
$info and $info->{"schema"}
MC/DC0%0/3
$info && $info->{'schema'} || $context->{'schema'}
$info
$info->{"schema"}
$context->{'schema'}
Truth table0%0/5
A and B || C
A= $infoB= $info->{"schema"}C= $context->{'schema'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 46 | 0 | ▶ | my $tag_resolver = $abstract_type->can('tag_resolver') ? $abstract_type->tag_resolver : undef; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 47 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 48 | 0 | ▶ | if ($tag_resolver) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 49 | 0 | my $tag = $tag_resolver->($value, $context, $abstract_type); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 50 | 0 | ▶ | if (defined $tag) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 51 | 0 | ▶ | my $declared_tag_map = $abstract_type->can('tag_map') ? $abstract_type->tag_map : undef; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 52 | return $declared_tag_map->{$tag} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 53 | 0 | ▶ | if $declared_tag_map && exists $declared_tag_map->{$tag}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$declared_tag_map and exists $declared_tag_map->{$tag}
MC/DC0%0/2
$declared_tag_map and exists $declared_tag_map->{$tag}
$declared_tag_map
exists $declared_tag_map->{$tag}
Truth table0%0/3
A and B
A= $declared_tag_mapB= exists $declared_tag_map->{$tag}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 54 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 55 | 0 | ▶ | my $runtime_cache = ($info && $info->{runtime_cache}) || $schema->runtime_cache || $schema->prepare_runtime; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/9
$info && $info->{'runtime_cache'} || $schema->runtime_cache || $schema->prepare_runtime
$info and $info->{"runtime_cache"} or $schema->runtime_cache
$info and $info->{"runtime_cache"}
MC/DC0%0/4
$info && $info->{'runtime_cache'} || $schema->runtime_cache || $schema->prepare_runtime
$info
$info->{"runtime_cache"}
$schema->runtime_cache
$schema->prepare_runtime
Truth table0%0/7
A and B or C || D
A= $infoB= $info->{"runtime_cache"}C= $schema->runtime_cacheD= $schema->prepare_runtime
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 56 | 0 | ▶ | my $tag_map = ($runtime_cache->{runtime_tag_map} || {})->{ $abstract_type->name } || {}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/4
($runtime_cache->{'runtime_tag_map'} || {})->{$abstract_type->name} || {}
$runtime_cache->{'runtime_tag_map'} || {}
MC/DC0%0/1
($runtime_cache->{'runtime_tag_map'} || {})->{$abstract_type->name} || {}
$runtime_cache->{'runtime_tag_map'}
Truth table0%0/2
A
A= $runtime_cache->{'runtime_tag_map'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 57 | 0 | ▶ | return $tag_map->{$tag} if exists $tag_map->{$tag}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 58 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 59 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 60 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 61 | 0 | ▶ | my $runtime_cache = ($info && $info->{runtime_cache}) || $schema->runtime_cache || $schema->prepare_runtime; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/9
$info && $info->{'runtime_cache'} || $schema->runtime_cache || $schema->prepare_runtime
$info and $info->{"runtime_cache"} or $schema->runtime_cache
$info and $info->{"runtime_cache"}
MC/DC0%0/4
$info && $info->{'runtime_cache'} || $schema->runtime_cache || $schema->prepare_runtime
$info
$info->{"runtime_cache"}
$schema->runtime_cache
$schema->prepare_runtime
Truth table0%0/7
A and B or C || D
A= $infoB= $info->{"runtime_cache"}C= $schema->runtime_cacheD= $schema->prepare_runtime
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 62 | 0 | ▶ | my @possibles = @{ $runtime_cache->{possible_types}{ $abstract_type->name } || $schema->get_possible_types($abstract_type) }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/3
$runtime_cache->{'possible_types'}{$abstract_type->name} || $schema->get_possible_types($abstract_type)
MC/DC0%0/2
$runtime_cache->{'possible_types'}{$abstract_type->name} || $schema->get_possible_types($abstract_type)
$runtime_cache->{'possible_types'}{$abstract_type->name}
$schema->get_possible_types($abstract_type)
Truth table0%0/3
A || B
A= $runtime_cache->{'possible_types'}{$abstract_type->name}B= $schema->get_possible_types($abstract_type)
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 63 | 0 | return (grep { $_->is_type_of->($value, $context, $info) } grep { $_->is_type_of } @possibles)[0]; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 64 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 65 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 66 | 21 | 1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||