graphql 2.3.1 → 2.3.2

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: 566d6d5c49b331b3f38e2f4d338c635bae02a86b14a004ff55f1eccccb973181
4
- data.tar.gz: 0a8a048f8644e933252ca30459386e2049ac8c3093731709d344bf898f884731
3
+ metadata.gz: 573ce6f5423ca2d9eb0ca3dab40f01869501f834c3b48d5cac7f7c06fbf36da9
4
+ data.tar.gz: c3b1f0393d2838a2478a36a43cec88560832c220a3896f2ee4c715d013d1758c
5
5
  SHA512:
6
- metadata.gz: 12136553e963ed98012887215d1f21efd31c2a3bacd40ada6836ca3884680cb4ac6a8c7a1fabaa7fc8699c0ba6db9f20418ae068a74694daef8db1d13e506933
7
- data.tar.gz: 1faab9e89cf122660fb277df551ba026685cefeaa2fba9d83b590a5a18d4c4dc1202712ecf404c2998eb12c27a1219bd548944ef5f65daaad79371163ca66b43
6
+ metadata.gz: 14d6c96c20c8fdb56ecddf0279e24e83c862d4133c72b3cebc44dca9e40e1c684b4f4a4c45fca81451d48d1bb97a4e6c3ae13499a40e12a76926e679a12a13f2
7
+ data.tar.gz: 44157aaa761da8c9f82afa9e31533ee3c87cdf4257256ec84f70f0e30dff8dc1830486c2ff02b4464a67e8815518466451ae598eabc12249cf2edaad6a9371f1
@@ -362,6 +362,7 @@ module GraphQL
362
362
  arguments: Nodes::Argument,
363
363
  locations: Nodes::DirectiveLocation,
364
364
  )
365
+ self.children_method_name = :definitions
365
366
  end
366
367
 
367
368
  # An enum value. The string is available as {#name}.
@@ -206,8 +206,8 @@ module GraphQL
206
206
  # Used by the runtime.
207
207
  # @api private
208
208
  def prepare_value(obj, value, context: nil)
209
- if value.is_a?(GraphQL::Schema::InputObject)
210
- value = value.prepare
209
+ if type.unwrap.kind.input_object?
210
+ value = recursively_prepare_input_object(value, type)
211
211
  end
212
212
 
213
213
  Schema::Validator.validate!(validators, obj, context, value)
@@ -373,6 +373,21 @@ module GraphQL
373
373
 
374
374
  private
375
375
 
376
+ def recursively_prepare_input_object(value, type)
377
+ if type.non_null?
378
+ type = type.of_type
379
+ end
380
+
381
+ if type.list? && !value.nil?
382
+ inner_type = type.of_type
383
+ value.map { |v| recursively_prepare_input_object(v, inner_type) }
384
+ elsif value.is_a?(GraphQL::Schema::InputObject)
385
+ value.prepare
386
+ else
387
+ value
388
+ end
389
+ end
390
+
376
391
  def validate_input_type(input_type)
377
392
  if input_type.is_a?(String) || input_type.is_a?(GraphQL::Schema::LateBoundType)
378
393
  # Do nothing; assume this will be validated later
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module GraphQL
3
- VERSION = "2.3.1"
3
+ VERSION = "2.3.2"
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: 2.3.1
4
+ version: 2.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Robert Mosolgo
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-04-22 00:00:00.000000000 Z
11
+ date: 2024-04-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: base64