* Rename "class" attribute to "transport_class".
* Minor pod fixups.
+0.601 2020-03-15 20:38:38-06:00 MST7MDT
+ * Rename "class" attribute to "transport_class".
+ * Minor pod fixups.
+
0.600 2020-03-15 18:08:57-06:00 MST7MDT
0.600 2020-03-15 18:08:57-06:00 MST7MDT
- * Initial public release
+ * Initial public release.
`GraphQL::Client` provides a simple way to execute [GraphQL](https://graphql.org/) queries and
mutations on a server.
`GraphQL::Client` provides a simple way to execute [GraphQL](https://graphql.org/) queries and
mutations on a server.
-This module is the programmatic interface. There is also a [graphql](#cli-program).
+This module is the programmatic interface. There is also a ["CLI program"](https://metacpan.org/pod/graphql).
GraphQL servers are usually served over HTTP. The provided transport, [GraphQL::Client::http](https://metacpan.org/pod/GraphQL%3A%3AClient%3A%3Ahttp), lets
you plug in your own user agent, so this client works naturally with [HTTP::Tiny](https://metacpan.org/pod/HTTP%3A%3ATiny),
GraphQL servers are usually served over HTTP. The provided transport, [GraphQL::Client::http](https://metacpan.org/pod/GraphQL%3A%3AClient%3A%3Ahttp), lets
you plug in your own user agent, so this client works naturally with [HTTP::Tiny](https://metacpan.org/pod/HTTP%3A%3ATiny),
The URL of a GraphQL endpoint, e.g. `"http://myapiserver/graphql"`.
The URL of a GraphQL endpoint, e.g. `"http://myapiserver/graphql"`.
-The package name of a transport.
+Whether or not to "unpack" the response, which enables a different style for error-handling.
-By default this is automatically determined from the protocol portion of the ["url"](#url).
+See ["ERROR HANDLING"](#error-handling).
-By default this is automatically constructed based on the ["class"](#class).
+The package name of a transport.
+This is optional if the correct transport can be correctly determined from the ["url"](#url).
-Whether or not to "unpack" the response, which enables a different style for error-handling.
-See ["ERROR HANDLING"](#error-handling).
+By default this is automatically constructed based on ["transport\_class"](#transport_class) or ["url"](#url).
There are two different styles for handling errors.
There are two different styles for handling errors.
-If ["unpack"](#unpack) is 0 (off), every response -- whether success or failure -- is enveloped like this:
+If ["unpack"](#unpack) is 0 (off, the default), every response -- whether success or failure -- is enveloped
+like this:
my $data = eval { $graphql->execute(...) };
if (my $error = $@) {
my $data = eval { $graphql->execute(...) };
if (my $error = $@) {
+ my $resp = $error->{response};