From: Charles McGarvey Date: Wed, 30 Mar 2022 01:40:28 +0000 (-0600) Subject: Release GraphQL-Client 0.605 X-Git-Tag: v0.605^0 X-Git-Url: https://git.dogcows.com/gitweb?p=chaz%2Fgraphql-client;a=commitdiff_plain;h=HEAD;hp=d863e46a9b52a7320ec1fcef23eb4f91a76d471e Release GraphQL-Client 0.605 * Fix bug preventing use of transport headers with CLI. (thanks jwrightecs) --- diff --git a/.mailmap b/.mailmap new file mode 100644 index 0000000..4744c4b --- /dev/null +++ b/.mailmap @@ -0,0 +1 @@ +Charles McGarvey diff --git a/Changes b/Changes index 81b6bbd..e777a60 100644 --- a/Changes +++ b/Changes @@ -2,6 +2,9 @@ Revision history for GraphQL-Client. {{$NEXT}} +0.605 2022-03-29 19:39:31-06:00 America/Denver + * Fix bug preventing use of transport headers with CLI. (thanks jwrightecs) + 0.604 2020-03-22 03:44:44-06:00 MST7MDT * Add --filter JSONPATH argument to CLI. diff --git a/LICENSE b/LICENSE index f87adb0..108986c 100644 --- a/LICENSE +++ b/LICENSE @@ -292,21 +292,21 @@ Definitions: - "Package" refers to the collection of files distributed by the Copyright Holder, and derivatives of that collection of files created through - textual modification. + textual modification. - "Standard Version" refers to such a Package if it has not been modified, or has been modified in accordance with the wishes of the Copyright - Holder. + Holder. - "Copyright Holder" is whoever is named in the copyright or copyrights for - the package. + the package. - "You" is you, if you're thinking about copying or distributing this Package. - "Reasonable copying fee" is whatever you can justify on the basis of media cost, duplication charges, time of people involved, and so on. (You will not be required to justify it to the Copyright Holder, but only to the - computing community at large as a market that must bear the fee.) + computing community at large as a market that must bear the fee.) - "Freely Available" means that no fee is charged for the item itself, though there may be fees involved in handling the item. It also means that recipients of the item may redistribute it under the same conditions they - received it. + received it. 1. You may make and give away verbatim copies of the source form of the Standard Version of this Package without restriction, provided that you @@ -373,7 +373,7 @@ products derived from this software without specific prior written permission. 9. THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF -MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. The End diff --git a/README.md b/README.md index caebdfd..fd618b9 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ graphql - Command-line GraphQL client # VERSION -version 0.604 +version 0.605 # SYNOPSIS @@ -264,7 +264,11 @@ feature. # AUTHOR -Charles McGarvey +Charles McGarvey + +# CONTRIBUTOR + +jwright # COPYRIGHT AND LICENSE diff --git a/dist.ini b/dist.ini index 78e688a..d3a62db 100644 --- a/dist.ini +++ b/dist.ini @@ -1,6 +1,6 @@ name = GraphQL-Client main_module = bin/graphql -author = Charles McGarvey +author = Charles McGarvey copyright_holder = Charles McGarvey copyright_year = 2020 license = Perl_5 diff --git a/lib/GraphQL/Client/CLI.pm b/lib/GraphQL/Client/CLI.pm index c23e07f..8ddc78f 100644 --- a/lib/GraphQL/Client/CLI.pm +++ b/lib/GraphQL/Client/CLI.pm @@ -138,6 +138,7 @@ sub _get_options { my $transport = eval { _expand_vars($options{transport}) }; die "Two or more --transport keys are incompatible.\n" if $@; + $options{transport} = $transport if ref $transport eq 'HASH' && %$transport; if (ref $options{variables}) { $options{variables} = eval { _expand_vars($options{variables}) }; diff --git a/maint/fatpack.pl b/maint/fatpack.pl index 66497fa..71d436c 100755 --- a/maint/fatpack.pl +++ b/maint/fatpack.pl @@ -27,11 +27,12 @@ my $core_version = '5.010001'; my $plenv_version = '5.10.1'; my %blacklist_modules = map { $_ => 1 } ( 'perl', - 'Text::Table::ASV', # brought in by Text::Table::Any but not actually required - 'Unicode::GCString', # optional XS module + 'Text::Table::ASV', # brought in by Text::Table::Any but not actually required + 'Unicode::GCString', # optional XS module + 'JSON::Path::Evaluator', # requires perl 5.16 ); my @extra_modules = ( - 'Proc::Find::Parents', # used by Term::Detect::Software on some platforms + 'Proc::Find::Parents', # used by Term::Detect::Software on some platforms ); my $clean = 0; diff --git a/t/cli.t b/t/cli.t index a32af83..142f2e5 100755 --- a/t/cli.t +++ b/t/cli.t @@ -44,6 +44,29 @@ subtest 'get_options' => sub { } }; +subtest 'get_options_transport' => sub { + my $expected = { + format => 'json:pretty', + filter => undef, + help => undef, + manual => undef, + operation_name => undef, + outfile => undef, + query => 'bar', + transport => { headers => {'X-Test' => 'value', 'X-Test-2' => 'val2' } }, + unpack => 0, + url => 'foo', + variables => undef, + version => undef, + }; + + my $r = GraphQL::Client::CLI->_get_options(qw{--url foo --query bar --transport headers.X-Test=value --transport headers.X-Test-2=val2}); + is_deeply($r, $expected, '--url, --query set option and correctly expanded transport options') or diag explain $r; +}; + + + + subtest 'expand_vars' => sub { my $r = GraphQL::Client::CLI::_expand_vars({ 'foo.bar' => 'baz',