--- /dev/null
+Charles McGarvey <ccm@cpan.org> <chazmcgarvey@brokenzipper.com>
{{$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.
- "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
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
# VERSION
-version 0.604
+version 0.605
# SYNOPSIS
# AUTHOR
-Charles McGarvey <chazmcgarvey@brokenzipper.com>
+Charles McGarvey <ccm@cpan.org>
+
+# CONTRIBUTOR
+
+jwright <jwright@ecstuning.com>
# COPYRIGHT AND LICENSE
name = GraphQL-Client
main_module = bin/graphql
-author = Charles McGarvey <chazmcgarvey@brokenzipper.com>
+author = Charles McGarvey <ccm@cpan.org>
copyright_holder = Charles McGarvey
copyright_year = 2020
license = Perl_5
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}) };
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;
}
};
+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',