- If unpack is 1 (on), then "execute" will return just the data if there
- were no errors, otherwise it will throw an exception. So your code
- would instead look like this:
+ If the response cannot be formatted, the default format will be used
+ instead, an error message will be printed to STDERR, and the program
+ will exit 3.
+
+ Table formatting can be done by one of several different modules, each
+ with its own features and bugs. The default module is
+ Text::Table::Tiny, but this can be overridden using the PERL_TEXT_TABLE
+ environment variable if desired, like this:
+
+ PERL_TEXT_TABLE=Text::Table::HTML graphql ... -f table
+
+ The list of supported modules is at "@BACKENDS" in Text::Table::Any.
+
+EXAMPLES
+
+ Different ways to provide the query/mutation to execute:
+
+ graphql http://myserver/graphql {hello}
+
+ echo {hello} | graphql http://myserver/graphql
+
+ graphql http://myserver/graphql <<END
+ > {hello}
+ > END
+
+ graphql http://myserver/graphql
+ Interactive mode engaged! Waiting for a query on <STDIN>...
+ {hello}
+ ^D
+
+ Execute a query with variables:
+
+ graphql http://myserver/graphql <<END --var episode=JEDI
+ > query HeroNameAndFriends($episode: Episode) {
+ > hero(episode: $episode) {
+ > name
+ > friends {
+ > name
+ > }
+ > }
+ > }
+ > END
+
+ graphql http://myserver/graphql --vars '{"episode":"JEDI"}'
+
+ Configure the transport:
+
+ graphql http://myserver/graphql {hello} -t headers.authorization='Basic s3cr3t'
+
+ This example shows the effect of "--unpack":