graphql 1.10.9 → 1.10.10

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: faf92321ef690867c10449792e3ac7a512b6c70a8cb98c4abe55701dbab68b5c
4
- data.tar.gz: c0d7c15c4f74ec0dff027d1e1dbc102d8e0a99973e7d856e2ccb0dfb90dcf9cb
3
+ metadata.gz: ec55133305287a9626164b06b4d87a97ee4d2b0fb75fb6c09c8964f34122c90f
4
+ data.tar.gz: 85dc4bae04dac609134141b4385414505bd6cf510259b1fadee7b50783eea0eb
5
5
  SHA512:
6
- metadata.gz: '0380579063581e40b9c94c64e7c040c0e654e36608ec20079a6d53e34015e8f7aac7a1f4a718c6c9f2200ee0f4a5ce0a1226cf5c1c838aafebb82d1819ca4bb5'
7
- data.tar.gz: 98a72e31dee880098191b2ad6e3fec2cacc459ee17d4a8e5dab380dd5bd9c2d08c7aa31b6164cce23999c557a78de02f7d0a2f3eb3e5a0ff007b46f032be3fea
6
+ metadata.gz: 45c3d9d7db094887e1f3a95aa43ed58f58889e25039351c6767f0b3134cbb56ff479fcf8c5325b137a063e604b63e9a1edf942ad5c5b132989f706b473ad52d0
7
+ data.tar.gz: 8736c31c021fbaf119b3d2ed07a3d3b38ad22afa60070e6e5df62e16d2d8fe65314942a555500312bb40f8c37c7fb59755bf28dce144e707f2408d378c8d6d65
@@ -77,7 +77,7 @@ module GraphQL
77
77
  end
78
78
 
79
79
  def call_after_hooks(instrumenters, object, after_hook_name, ex)
80
- instrumenters.reverse.each do |instrumenter|
80
+ instrumenters.reverse_each do |instrumenter|
81
81
  begin
82
82
  instrumenter.public_send(after_hook_name, object)
83
83
  rescue => e
@@ -88,7 +88,7 @@ module GraphQL
88
88
  interfaces.each do |iface|
89
89
  iface = BaseType.resolve_related_type(iface)
90
90
  if iface.is_a?(GraphQL::InterfaceType)
91
- type_memberships << iface.type_membership_class.new(iface, self, options)
91
+ type_memberships << iface.type_membership_class.new(iface, self, **options)
92
92
  end
93
93
  end
94
94
  end
@@ -672,6 +672,8 @@ module GraphQL
672
672
  else
673
673
  load_application_object(arg_defn, loads, value, field_ctx.query.context)
674
674
  end
675
+ elsif arg_defn.type.list? && value.is_a?(Array)
676
+ field_ctx.schema.after_any_lazies(value, &:itself)
675
677
  else
676
678
  value
677
679
  end
@@ -44,7 +44,8 @@ module GraphQL
44
44
  if value.nil?
45
45
  nil
46
46
  else
47
- ensure_array(value).map { |item| item.nil? ? item : of_type.coerce_input(item, ctx) }
47
+ coerced = ensure_array(value).map { |item| item.nil? ? item : of_type.coerce_input(item, ctx) }
48
+ ctx.schema.after_any_lazies(coerced, &:itself)
48
49
  end
49
50
  end
50
51
 
@@ -157,6 +157,7 @@ module GraphQL
157
157
  type: type_resolver.call(field_hash["type"]),
158
158
  description: field_hash["description"],
159
159
  null: true,
160
+ camelize: false,
160
161
  ) do
161
162
  if field_hash["args"].any?
162
163
  loader.build_arguments(self, field_hash["args"], type_resolver)
@@ -171,6 +172,8 @@ module GraphQL
171
172
  type: type_resolver.call(arg["type"]),
172
173
  description: arg["description"],
173
174
  required: false,
175
+ method_access: false,
176
+ camelize: false,
174
177
  }
175
178
 
176
179
  if arg["defaultValue"]
@@ -166,7 +166,13 @@ module GraphQL
166
166
  end
167
167
 
168
168
  def visible_field?(owner_type, field_defn)
169
- visible?(field_defn) && visible_type?(field_defn.type.unwrap) && field_on_visible_interface?(field_defn, owner_type)
169
+ # This field is visible in its own right
170
+ visible?(field_defn) &&
171
+ # This field's return type is visible
172
+ visible_type?(field_defn.type.unwrap) &&
173
+ # This field is either defined on this object type,
174
+ # or the interface it's inherited from is also visible
175
+ ((field_defn.respond_to?(:owner) && field_defn.owner == owner_type) || field_on_visible_interface?(field_defn, owner_type))
170
176
  end
171
177
 
172
178
  # We need this to tell whether a field was inherited by an interface
@@ -25,7 +25,7 @@ module GraphQL
25
25
  # @return [Date]
26
26
  def self.coerce_input(str_value, _ctx)
27
27
  Date.iso8601(str_value)
28
- rescue ArgumentError
28
+ rescue ArgumentError, TypeError
29
29
  # Invalid input
30
30
  nil
31
31
  end
@@ -40,9 +40,9 @@ module GraphQL
40
40
  when ::String
41
41
  return DateTime.parse(value).iso8601(time_precision)
42
42
  else
43
- # In case some other API-compliant thing is given:
43
+ # In case some other API-compliant thing is given:
44
44
  return value.iso8601(time_precision)
45
- end
45
+ end
46
46
  rescue StandardError => error
47
47
  raise GraphQL::Error, "An incompatible object (#{value.class}) was given to #{self}. Make sure that only Dates, DateTimes, and well-formatted Strings are used with this type. (#{error.message})"
48
48
  end
@@ -51,7 +51,7 @@ module GraphQL
51
51
  # @return [DateTime]
52
52
  def self.coerce_input(str_value, _ctx)
53
53
  DateTime.iso8601(str_value)
54
- rescue ArgumentError
54
+ rescue ArgumentError, TypeError
55
55
  # Invalid input
56
56
  nil
57
57
  end
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module GraphQL
3
- VERSION = "1.10.9"
3
+ VERSION = "1.10.10"
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.10.9
4
+ version: 1.10.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Robert Mosolgo
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-05-04 00:00:00.000000000 Z
11
+ date: 2020-05-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: benchmark-ips