There are two different styles for handling errors.
-If L</unpack> is 0 (off), every response -- whether success or failure -- is enveloped like this:
+If L</unpack> is 0 (off, the default), every response -- whether success or failure -- is enveloped
+like this:
{
data => {...},
my $data = eval { $graphql->execute(...) };
if (my $error = $@) {
+ my $resp = $error->{response};
# handle errors
}
else {
authorization => 'Bearer s3cr3t',
},
};
- my $response = $client->execute($request, $options);
+ my $response = $transport->execute($request, $options);
=head1 DESCRIPTION