graphql 1.13.16 → 1.13.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of graphql might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/lib/graphql/schema/field.rb +14 -2
- data/lib/graphql/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 06b422e884c0286eca2020124a83dbc02a1ac4dbf905b48f9d125fb4c2569eff
|
4
|
+
data.tar.gz: a4985d6e8e3cd0358f3afac1bd1d8023e24d4ed63e2be8f05557ec2822e69447
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e7f61649fd57f66798a84eb713058add79cdff52bb49ad7dfbdaa328111d0288fc5154b2ee991ddbd77914fb80e9d0bced518ffdc21d92f801ab1b68bbf4add2
|
7
|
+
data.tar.gz: abb11a3b18e52544af8726152fab0f145e214f88521121ac775ba2e0fb0e0f22c9988406548cfde267df314ca58063a4d4130d29f53b236170312e0b806c28d0
|
data/lib/graphql/schema/field.rb
CHANGED
@@ -258,6 +258,10 @@ module GraphQL
|
|
258
258
|
# TODO: I think non-string/symbol hash keys are wrongly normalized (eg `1` will not work)
|
259
259
|
method_name = method || hash_key || name_s
|
260
260
|
@dig_keys = dig
|
261
|
+
if hash_key
|
262
|
+
@hash_key = hash_key
|
263
|
+
end
|
264
|
+
|
261
265
|
resolver_method ||= name_s.to_sym
|
262
266
|
|
263
267
|
@method_str = -method_name.to_s
|
@@ -473,7 +477,13 @@ module GraphQL
|
|
473
477
|
case defined_complexity
|
474
478
|
when Proc
|
475
479
|
arguments = query.arguments_for(nodes.first, self)
|
476
|
-
|
480
|
+
if arguments.is_a?(GraphQL::ExecutionError)
|
481
|
+
return child_complexity
|
482
|
+
elsif arguments.respond_to?(:keyword_arguments)
|
483
|
+
arguments = arguments.keyword_arguments
|
484
|
+
end
|
485
|
+
|
486
|
+
defined_complexity.call(query.context, arguments, child_complexity)
|
477
487
|
when Numeric
|
478
488
|
defined_complexity + child_complexity
|
479
489
|
else
|
@@ -816,7 +826,7 @@ module GraphQL
|
|
816
826
|
# Find a way to resolve this field, checking:
|
817
827
|
#
|
818
828
|
# - A method on the type instance;
|
819
|
-
# - Hash keys, if the wrapped object is a hash
|
829
|
+
# - Hash keys, if the wrapped object is a hash or responds to `#[]`
|
820
830
|
# - A method on the wrapped object;
|
821
831
|
# - Or, raise not implemented.
|
822
832
|
#
|
@@ -838,6 +848,8 @@ module GraphQL
|
|
838
848
|
else
|
839
849
|
inner_object[@method_str]
|
840
850
|
end
|
851
|
+
elsif defined?(@hash_key) && obj.object.respond_to?(:[])
|
852
|
+
obj.object[@hash_key]
|
841
853
|
elsif obj.object.respond_to?(@method_sym)
|
842
854
|
method_to_call = @method_sym
|
843
855
|
method_receiver = obj.object
|
data/lib/graphql/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: graphql
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.13.
|
4
|
+
version: 1.13.18
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Robert Mosolgo
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-01-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: benchmark-ips
|
@@ -722,7 +722,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
722
722
|
- !ruby/object:Gem::Version
|
723
723
|
version: '0'
|
724
724
|
requirements: []
|
725
|
-
rubygems_version: 3.
|
725
|
+
rubygems_version: 3.3.3
|
726
726
|
signing_key:
|
727
727
|
specification_version: 4
|
728
728
|
summary: A GraphQL language and runtime for Ruby
|