X-Git-Url: https://git.dogcows.com/gitweb?p=chaz%2Fgraphql-client;a=blobdiff_plain;f=lib%2FGraphQL%2FClient.pm;fp=lib%2FGraphQL%2FClient.pm;h=d2dd652b4dbc75bdc69a259641107eb66b81cc35;hp=ff8f720cd88d4545f668b79e9c9dd3c5a411d6d5;hb=fa1f0d33745578823db4d393dbabe889058bb8c0;hpb=90a93eb2cbbd8656fd5a2284dfc7110bc3267da6 diff --git a/lib/GraphQL/Client.pm b/lib/GraphQL/Client.pm index ff8f720..d2dd652 100644 --- a/lib/GraphQL/Client.pm +++ b/lib/GraphQL/Client.pm @@ -272,7 +272,8 @@ By default this is automatically constructed based on L or L is 0 (off), every response -- whether success or failure -- is enveloped like this: +If L is 0 (off, the default), every response -- whether success or failure -- is enveloped +like this: { data => {...}, @@ -298,6 +299,7 @@ otherwise it will throw an exception. So your code would instead look like this: my $data = eval { $graphql->execute(...) }; if (my $error = $@) { + my $resp = $error->{response}; # handle errors } else {