Branch Coverage

blib/lib/Mojolicious/Plugin/GraphQL.pm
Criterion Covered Total %
branch 41 52 78.8


line true false branch
22 1 0 &is_Promise($_) ? :
66 3 2 $subscribe_resolver ? :
83 3 1 if (($c->req->headers->header('Accept') // '') =~ m[^text/html\b]u and not defined $c->req->query_params->param('raw'))
89 1 2 $use_subscription ? :
114 1 11 if $@
121 1 6 if $@
130 1 4 unless $decode_ok
132 3 1 unless &is_Promise($data)
145 0 0 $context->{'connected'} ? :
0 7 unless $decode_ok
148 3 4 if ($msg_type eq {GQL_COMPLETE => 'complete', GQL_CONNECTION_ACK => 'connection_ack', GQL_CONNECTION_ERROR => 'connection_error', GQL_CONNECTION_INIT => 'connection_init', GQL_CONNECTION_KEEP_ALIVE => 'ka', GQL_CONNECTION_TERMINATE => 'connection_terminate', GQL_DATA => 'data', GQL_ERROR => 'error', GQL_START => 'start', GQL_STOP => 'stop'}->{'GQL_CONNECTION_INIT'}) { }
3 1 elsif ($msg_type eq {GQL_COMPLETE => 'complete', GQL_CONNECTION_ACK => 'connection_ack', GQL_CONNECTION_ERROR => 'connection_error', GQL_CONNECTION_INIT => 'connection_init', GQL_CONNECTION_KEEP_ALIVE => 'ka', GQL_CONNECTION_TERMINATE => 'connection_terminate', GQL_DATA => 'data', GQL_ERROR => 'error', GQL_START => 'start', GQL_STOP => 'stop'}->{'GQL_START'}) { }
1 0 elsif ($msg_type eq {GQL_COMPLETE => 'complete', GQL_CONNECTION_ACK => 'connection_ack', GQL_CONNECTION_ERROR => 'connection_error', GQL_CONNECTION_INIT => 'connection_init', GQL_CONNECTION_KEEP_ALIVE => 'ka', GQL_CONNECTION_TERMINATE => 'connection_terminate', GQL_DATA => 'data', GQL_ERROR => 'error', GQL_START => 'start', GQL_STOP => 'stop'}->{'GQL_STOP'}) { }
153 1 2 if ($context->{'keepalive'})
156 0 2 unless $c->tx and $context->{'keepalive'}
172 0 3 unless &is_Promise($data)
176 0 3 unless (&is_AsyncIterator($result))
197 1 4 if not $promise
214 1 0 if $context->{'async_iterator'}
227 0 3 if $sec_websocket_protocol
232 2 1 if $context{'async_iterator'}
240 3 3 if ($conf->{'convert'})
247 0 6 unless $conf->{'schema'}
253 1 5 unless grep(($_ eq 'Mojolicious::Plugin::GraphQL'), @{$app->renderer->classes;})
256 2 4 if $conf->{'graphiql'}
258 2 4 if ($conf->{'schema'}->subscription)