graphql 1.13.17 → 1.13.18

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6a026aa1c0479073cf5ab5a306644eba7aad3ed90029b843ada2223758cc80bb
4
- data.tar.gz: '05851e52f3cfe034ee8f50b12cb3cd9d31185b6737868230aee88fa4ad911814'
3
+ metadata.gz: 06b422e884c0286eca2020124a83dbc02a1ac4dbf905b48f9d125fb4c2569eff
4
+ data.tar.gz: a4985d6e8e3cd0358f3afac1bd1d8023e24d4ed63e2be8f05557ec2822e69447
5
5
  SHA512:
6
- metadata.gz: c552afdbecebded43cc1e95c51a644259198ebd464ea0439404a7b3bece415b4af60bacd5e25cef6ead8e8ad64ec00f8f0361dfbd5f7dfe4447a292a63856d8c
7
- data.tar.gz: d7bc2037a7601d565ae0e0c5a9c086849ca8667b9eba48d5add6effb7f59df12adeed520e75c3220af6b781ffe1084256266afc726b0f232270747dc6fd7c6e9
6
+ metadata.gz: e7f61649fd57f66798a84eb713058add79cdff52bb49ad7dfbdaa328111d0288fc5154b2ee991ddbd77914fb80e9d0bced518ffdc21d92f801ab1b68bbf4add2
7
+ data.tar.gz: abb11a3b18e52544af8726152fab0f145e214f88521121ac775ba2e0fb0e0f22c9988406548cfde267df314ca58063a4d4130d29f53b236170312e0b806c28d0
@@ -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
@@ -822,7 +826,7 @@ module GraphQL
822
826
  # Find a way to resolve this field, checking:
823
827
  #
824
828
  # - A method on the type instance;
825
- # - Hash keys, if the wrapped object is a hash;
829
+ # - Hash keys, if the wrapped object is a hash or responds to `#[]`
826
830
  # - A method on the wrapped object;
827
831
  # - Or, raise not implemented.
828
832
  #
@@ -844,6 +848,8 @@ module GraphQL
844
848
  else
845
849
  inner_object[@method_str]
846
850
  end
851
+ elsif defined?(@hash_key) && obj.object.respond_to?(:[])
852
+ obj.object[@hash_key]
847
853
  elsif obj.object.respond_to?(@method_sym)
848
854
  method_to_call = @method_sym
849
855
  method_receiver = obj.object
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module GraphQL
3
- VERSION = "1.13.17"
3
+ VERSION = "1.13.18"
4
4
  end
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.17
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: 2022-11-17 00:00:00.000000000 Z
11
+ date: 2023-01-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: benchmark-ips