graphql 2.6.14 → 2.6.15

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.
Files changed (122) hide show
  1. checksums.yaml +4 -4
  2. data/lib/generators/graphql/templates/graphql_controller.erb +7 -1
  3. data/lib/graphql/analysis/max_query_complexity.rb +2 -1
  4. data/lib/graphql/analysis/max_query_depth.rb +2 -1
  5. data/lib/graphql/analysis/query_complexity.rb +2 -1
  6. data/lib/graphql/analysis/query_depth.rb +1 -1
  7. data/lib/graphql/analysis/visitor.rb +14 -2
  8. data/lib/graphql/analysis.rb +4 -5
  9. data/lib/graphql/analysis_error.rb +1 -1
  10. data/lib/graphql/coercion_error.rb +1 -1
  11. data/lib/graphql/current.rb +5 -1
  12. data/lib/graphql/dashboard.rb +1 -1
  13. data/lib/graphql/date_encoding_error.rb +3 -1
  14. data/lib/graphql/duration_encoding_error.rb +3 -1
  15. data/lib/graphql/execution/directive_checks.rb +2 -1
  16. data/lib/graphql/execution/errors.rb +18 -7
  17. data/lib/graphql/execution/field_resolve_step.rb +3 -3
  18. data/lib/graphql/execution/input_values.rb +160 -120
  19. data/lib/graphql/execution/interpreter/runtime.rb +9 -5
  20. data/lib/graphql/execution/lookahead.rb +19 -8
  21. data/lib/graphql/execution/next.rb +1 -0
  22. data/lib/graphql/execution/runner.rb +19 -12
  23. data/lib/graphql/execution/selections_step.rb +1 -1
  24. data/lib/graphql/execution/variable_values.rb +248 -0
  25. data/lib/graphql/float_decoding_error.rb +3 -1
  26. data/lib/graphql/integer_decoding_error.rb +3 -1
  27. data/lib/graphql/introspection/base_object.rb +1 -1
  28. data/lib/graphql/introspection/directive_location_enum.rb +1 -1
  29. data/lib/graphql/introspection/directive_type.rb +3 -1
  30. data/lib/graphql/introspection/dynamic_fields.rb +3 -1
  31. data/lib/graphql/introspection/enum_value_type.rb +3 -1
  32. data/lib/graphql/introspection/field_type.rb +5 -1
  33. data/lib/graphql/introspection/type_kind_enum.rb +1 -1
  34. data/lib/graphql/introspection.rb +2 -1
  35. data/lib/graphql/language/comment.rb +2 -1
  36. data/lib/graphql/language/generation.rb +2 -1
  37. data/lib/graphql/language/lexer.rb +29 -21
  38. data/lib/graphql/language/parser.rb +10 -7
  39. data/lib/graphql/language.rb +1 -1
  40. data/lib/graphql/name_validator.rb +2 -1
  41. data/lib/graphql/pagination.rb +1 -1
  42. data/lib/graphql/query/fingerprint.rb +2 -1
  43. data/lib/graphql/query/partial.rb +4 -0
  44. data/lib/graphql/query.rb +8 -12
  45. data/lib/graphql/railtie.rb +1 -1
  46. data/lib/graphql/relay.rb +1 -1
  47. data/lib/graphql/rubocop.rb +1 -1
  48. data/lib/graphql/runtime_error.rb +1 -1
  49. data/lib/graphql/runtime_type_error.rb +1 -1
  50. data/lib/graphql/schema/always_visible.rb +3 -1
  51. data/lib/graphql/schema/base_64_encoder.rb +3 -1
  52. data/lib/graphql/schema/built_in_types.rb +2 -2
  53. data/lib/graphql/schema/directive/deprecated.rb +1 -1
  54. data/lib/graphql/schema/directive/include.rb +2 -1
  55. data/lib/graphql/schema/directive/skip.rb +2 -1
  56. data/lib/graphql/schema/directive/specified_by.rb +1 -1
  57. data/lib/graphql/schema/field/scope_extension.rb +2 -1
  58. data/lib/graphql/schema/field.rb +3 -0
  59. data/lib/graphql/schema/find_inherited_value.rb +5 -1
  60. data/lib/graphql/schema/member/graphql_type_names.rb +1 -1
  61. data/lib/graphql/schema/member/has_directives.rb +20 -22
  62. data/lib/graphql/schema/member/has_path.rb +2 -1
  63. data/lib/graphql/schema/member/has_unresolved_type_error.rb +2 -1
  64. data/lib/graphql/schema/member.rb +3 -2
  65. data/lib/graphql/schema/mutation.rb +6 -1
  66. data/lib/graphql/schema/object.rb +1 -1
  67. data/lib/graphql/schema/resolver.rb +2 -2
  68. data/lib/graphql/schema/type_expression.rb +3 -1
  69. data/lib/graphql/schema/validator/all_validator.rb +6 -3
  70. data/lib/graphql/static_validation/all_rules.rb +1 -1
  71. data/lib/graphql/static_validation/base_visitor.rb +125 -53
  72. data/lib/graphql/static_validation/definition_dependencies.rb +14 -2
  73. data/lib/graphql/static_validation/interpreter_visitor.rb +1 -1
  74. data/lib/graphql/static_validation/rules/argument_names_are_unique.rb +4 -1
  75. data/lib/graphql/static_validation/rules/directives_are_in_valid_locations.rb +2 -0
  76. data/lib/graphql/static_validation/rules/fields_are_defined_on_type.rb +8 -4
  77. data/lib/graphql/static_validation/rules/fragments_are_finite.rb +2 -1
  78. data/lib/graphql/static_validation/rules/fragments_are_named.rb +2 -1
  79. data/lib/graphql/static_validation/rules/fragments_are_named_error.rb +4 -1
  80. data/lib/graphql/static_validation/rules/fragments_are_on_composite_types.rb +6 -3
  81. data/lib/graphql/static_validation/rules/fragments_are_used.rb +2 -1
  82. data/lib/graphql/static_validation/rules/input_object_names_are_unique.rb +3 -1
  83. data/lib/graphql/static_validation/rules/mutation_root_exists.rb +3 -2
  84. data/lib/graphql/static_validation/rules/mutation_root_exists_error.rb +4 -1
  85. data/lib/graphql/static_validation/rules/no_definitions_are_present_error.rb +4 -1
  86. data/lib/graphql/static_validation/rules/not_single_subscription_error.rb +4 -1
  87. data/lib/graphql/static_validation/rules/one_of_input_objects_are_valid.rb +9 -2
  88. data/lib/graphql/static_validation/rules/query_root_exists.rb +3 -2
  89. data/lib/graphql/static_validation/rules/query_root_exists_error.rb +4 -1
  90. data/lib/graphql/static_validation/rules/required_input_object_attributes_are_present_error.rb +10 -4
  91. data/lib/graphql/static_validation/rules/subscription_root_exists_and_single_subscription_selection.rb +8 -6
  92. data/lib/graphql/static_validation/rules/subscription_root_exists_error.rb +4 -1
  93. data/lib/graphql/static_validation/rules/unique_directives_per_location.rb +5 -4
  94. data/lib/graphql/static_validation/rules/variable_default_values_are_correctly_typed.rb +2 -1
  95. data/lib/graphql/static_validation/rules/variable_names_are_unique.rb +2 -1
  96. data/lib/graphql/static_validation/rules/variable_usages_are_allowed.rb +1 -1
  97. data/lib/graphql/static_validation/rules/variables_are_input_types.rb +1 -1
  98. data/lib/graphql/static_validation/validation_context.rb +49 -14
  99. data/lib/graphql/static_validation/validation_timeout_error.rb +4 -1
  100. data/lib/graphql/static_validation.rb +1 -2
  101. data/lib/graphql/subscriptions/action_cable_subscriptions.rb +14 -13
  102. data/lib/graphql/testing.rb +1 -1
  103. data/lib/graphql/tracing/legacy_trace.rb +1 -1
  104. data/lib/graphql/tracing/null_trace.rb +1 -1
  105. data/lib/graphql/types/big_int.rb +4 -1
  106. data/lib/graphql/types/boolean.rb +3 -1
  107. data/lib/graphql/types/id.rb +3 -1
  108. data/lib/graphql/types/iso_8601_date.rb +1 -0
  109. data/lib/graphql/types/iso_8601_date_time.rb +6 -2
  110. data/lib/graphql/types/iso_8601_duration.rb +3 -0
  111. data/lib/graphql/types/relay/base_connection.rb +1 -1
  112. data/lib/graphql/types/relay/base_edge.rb +1 -1
  113. data/lib/graphql/types/relay/node.rb +1 -1
  114. data/lib/graphql/types/relay/page_info.rb +1 -1
  115. data/lib/graphql/types/relay/page_info_behaviors.rb +4 -1
  116. data/lib/graphql/types/relay.rb +1 -1
  117. data/lib/graphql/types/string.rb +1 -0
  118. data/lib/graphql/types.rb +1 -1
  119. data/lib/graphql/version.rb +2 -2
  120. metadata +3 -4
  121. data/lib/graphql/query/variables.rb +0 -99
  122. data/lib/graphql/static_validation/literal_validator.rb +0 -157
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 33d067b80170a8be730630eb60106962726899c114a50d397559d5ccbb274dd4
4
- data.tar.gz: 5d5d69c98b1461f7e9d50e45b615a6078155c3b15e1af0dfc51d46d49364064d
3
+ metadata.gz: 8207cb9fb1f93b3364a2866d4ad0113b9fb6711fed18173ab1b63a73c3b7004d
4
+ data.tar.gz: 170e3f0d0bb725d6d1bc6d21c2d086d3023d169544ea17bfc5d6765df57be66e
5
5
  SHA512:
6
- metadata.gz: b77a04ebe1d0da2e9edd7e5af4f8218f6c25676893af1985cde457b99696345751c620fd803fedd78910bf9a8978aa34418898014c7393ea2f0e35b36b22594e
7
- data.tar.gz: 3d3888e23a431bdbd67075eeacbdb082a461c46573946a8d46b228c2b53a686ccd5ba57f25919290e05240a60371063efa80eb8946459b5549c494e54fe5b407
6
+ metadata.gz: bb6cdc6648667c5547960a18ffd070cb8c6cb98360adbd47316b792f4c16e594b9a074ff62028c44e3f041d9e7f28860b7f2fd3e4bc42db73d9f43ce0e81ae53
7
+ data.tar.gz: cb4b25050266be8b405105144a5b52ee82602b6dd8e99d1f9c32d8d29443e96b19a8af283584c3d5e69ae85f6747348421bdc21693673ed2678d896c5375f6ea
@@ -48,7 +48,13 @@ class GraphqlController < ApplicationController
48
48
  logger.error e.message
49
49
  logger.error e.backtrace.join("\n")
50
50
 
51
- render json: { errors: [{ message: e.message, backtrace: e.backtrace }], data: {} }, status: 500
51
+ error_json = { errors: [{ message: e.message, backtrace: e.backtrace }], data: {} }
52
+ if response.committed?
53
+ # A streaming response (eg, with `@defer`) already started, so `render` would fail
54
+ response.stream.write(error_json.to_json)
55
+ else
56
+ render json: error_json, status: 500
57
+ end
52
58
  end
53
59
  end
54
60
  <% end -%>
@@ -1,10 +1,11 @@
1
1
  # frozen_string_literal: true
2
- # typed: true
2
+ # typed: strict
3
3
  module GraphQL
4
4
  module Analysis
5
5
  # Used under the hood to implement complexity validation,
6
6
  # See [Schema.max_complexity](rdoc-ref:GraphQL::Schema.max_complexity) and `Query#max_complexity`.
7
7
  class MaxQueryComplexity < QueryComplexity
8
+ #: -> GraphQL::AnalysisError?
8
9
  def result
9
10
  return if subject.max_complexity.nil?
10
11
 
@@ -1,8 +1,9 @@
1
1
  # frozen_string_literal: true
2
- # typed: true
2
+ # typed: strict
3
3
  module GraphQL
4
4
  module Analysis
5
5
  class MaxQueryDepth < QueryDepth
6
+ #: -> GraphQL::AnalysisError?
6
7
  def result
7
8
  configured_max_depth = if query
8
9
  query.max_depth
@@ -308,7 +308,8 @@ module GraphQL
308
308
  field_complexity(composite_scopes.last, max_complexity: field_cost, child_complexity: child_complexity)
309
309
  end
310
310
 
311
- total + field_cost
311
+ # Like `merged_max_complexity`, a field never reduces the cost of its siblings.
312
+ field_cost > 0 ? total + field_cost : total
312
313
  end
313
314
  end
314
315
  end
@@ -30,7 +30,7 @@ module GraphQL
30
30
  # ```
31
31
  class QueryDepth < Analyzer
32
32
  def initialize(query)
33
- @max_depth = 0
33
+ @max_depth = 0 #: Integer
34
34
  @current_depth = 0
35
35
  @count_introspection_fields = query.schema.count_introspection_fields
36
36
  super
@@ -25,6 +25,8 @@ module GraphQL
25
25
  @types = query.types
26
26
  @response_path = []
27
27
  @skip_stack = [false]
28
+ # For each selection set being visited, the fragments already inlined into it.
29
+ @inlined_fragments_stack = [{}]
28
30
  @timeout_time = if timeout
29
31
  Process.clock_gettime(Process::CLOCK_MONOTONIC, :float_second) + timeout
30
32
  else
@@ -129,9 +131,11 @@ module GraphQL
129
131
  object_type = @schema.root_type_for_operation(node.operation_type)
130
132
  @object_types.push(object_type)
131
133
  @path.push("#{node.operation_type}#{node.name ? " #{node.name}" : ""}")
134
+ @inlined_fragments_stack.push({})
132
135
  call_on_enter_operation_definition(node, parent)
133
136
  super
134
137
  call_on_leave_operation_definition(node, parent)
138
+ @inlined_fragments_stack.pop
135
139
  @object_types.pop
136
140
  @path.pop
137
141
  end
@@ -173,10 +177,12 @@ module GraphQL
173
177
  @skipping = @skip_stack.last || skip?(node)
174
178
  @skip_stack << @skipping
175
179
 
180
+ @inlined_fragments_stack.push({})
176
181
  call_on_enter_field(node, parent)
177
182
  super
178
183
  @skipping = @skip_stack.pop
179
184
  call_on_leave_field(node, parent)
185
+ @inlined_fragments_stack.pop
180
186
  @response_path.pop
181
187
  @field_definitions.pop
182
188
  @object_types.pop
@@ -226,10 +232,16 @@ module GraphQL
226
232
  @skip_stack << @skipping
227
233
 
228
234
  call_on_enter_fragment_spread(node, parent)
229
- enter_fragment_spread_inline(node)
235
+ # Spreading the same fragment again into this selection set adds no new selections, so don't visit it again.
236
+ inlined_fragments = @inlined_fragments_stack.last
237
+ inlined_key = [node.name, @object_types.last, @skipping]
238
+ if (inline_fragment = !inlined_fragments.key?(inlined_key))
239
+ inlined_fragments[inlined_key] = true
240
+ end
241
+ enter_fragment_spread_inline(node) if inline_fragment
230
242
  super
231
243
  @skipping = @skip_stack.pop
232
- leave_fragment_spread_inline(node)
244
+ leave_fragment_spread_inline(node) if inline_fragment
233
245
  call_on_leave_fragment_spread(node, parent)
234
246
  @path.pop
235
247
  end
@@ -97,17 +97,16 @@ module GraphQL
97
97
  EmptyObjects::EMPTY_ARRAY
98
98
  end
99
99
  end
100
- rescue TimeoutError => err
100
+ rescue GraphQL::ExecutionError => err
101
101
  [err]
102
- rescue GraphQL::UnauthorizedError, GraphQL::ExecutionError
103
- # This error was raised during analysis and will be returned the client before execution
104
- EmptyObjects::EMPTY_ARRAY
102
+ rescue GraphQL::UnauthorizedError => err
103
+ [GraphQL::AnalysisError.new(err.message)]
105
104
  end
106
105
 
107
106
  def analysis_errors(parent_errors, results)
108
107
  if !results.empty?
109
108
  results = results.flatten
110
- results.select! { |r| r.is_a?(GraphQL::AnalysisError) }
109
+ results.select! { |r| r.is_a?(GraphQL::ExecutionError) }
111
110
  end
112
111
 
113
112
  if parent_errors.empty?
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
- # typed: true
2
+ # typed: strict
3
3
  module GraphQL
4
4
  class AnalysisError < GraphQL::ExecutionError
5
5
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
- # typed: true
2
+ # typed: strict
3
3
  module GraphQL
4
4
  class CoercionError < GraphQL::ExecutionError
5
5
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
- # typed: true
2
+ # typed: strict
3
3
 
4
4
  module GraphQL
5
5
  # This module exposes Fiber-level runtime information.
@@ -32,6 +32,7 @@ module GraphQL
32
32
  #
33
33
  # :call-seq:
34
34
  # operation_name() -> String | nil
35
+ #: () -> String?
35
36
  def self.operation_name
36
37
  if (m = Fiber[:__graphql_current_multiplex])
37
38
  m.context[:__graphql_current_operation_name] ||= begin
@@ -55,6 +56,7 @@ module GraphQL
55
56
  #
56
57
  # :call-seq:
57
58
  # field() -> GraphQL::Field | nil
59
+ #: () -> GraphQL::Schema::Field?
58
60
  def self.field
59
61
  if (interpreter_info = Fiber[:__graphql_runtime_info])
60
62
  interpreter_info.values&.first&.current_field
@@ -71,6 +73,7 @@ module GraphQL
71
73
  #
72
74
  # :call-seq:
73
75
  # dataloader_source_class() -> Class | nil
76
+ #: () -> singleton(GraphQL::Dataloader::Source)?
74
77
  def self.dataloader_source_class
75
78
  Fiber[:__graphql_current_dataloader_source]&.class
76
79
  end
@@ -81,6 +84,7 @@ module GraphQL
81
84
  #
82
85
  # :call-seq:
83
86
  # dataloader_source() -> GraphQL::Dataloader::Source | nil
87
+ #: () -> GraphQL::Dataloader::Source?
84
88
  def self.dataloader_source
85
89
  Fiber[:__graphql_current_dataloader_source]
86
90
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
- # typed: true
2
+ # typed: strict
3
3
  require 'rails/engine'
4
4
  require 'action_controller'
5
5
  module Graphql
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
- # typed: true
2
+ # typed: strict
3
3
  module GraphQL
4
4
  # This error is raised when `Types::ISO8601Date` is asked to return a value
5
5
  # that cannot be parsed to a Ruby Date.
@@ -7,8 +7,10 @@ module GraphQL
7
7
  # See [GraphQL::Types::ISO8601Date](rdoc-ref:GraphQL::Types::ISO8601Date) which raises this error
8
8
  class DateEncodingError < GraphQL::RuntimeTypeError
9
9
  # The value which couldn't be encoded
10
+ #: untyped
10
11
  attr_reader :date_value
11
12
 
13
+ #: (untyped value) -> void
12
14
  def initialize(value)
13
15
  @date_value = value
14
16
  super("Date cannot be parsed: #{value}. \nDate must be able to be parsed as a Ruby Date object.")
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
- # typed: true
2
+ # typed: strict
3
3
  module GraphQL
4
4
  # This error is raised when `Types::ISO8601Duration` is asked to return a value
5
5
  # that cannot be parsed as an ISO8601-formatted duration by ActiveSupport::Duration.
@@ -7,8 +7,10 @@ module GraphQL
7
7
  # See [GraphQL::Types::ISO8601Duration](rdoc-ref:GraphQL::Types::ISO8601Duration) which raises this error
8
8
  class DurationEncodingError < GraphQL::RuntimeTypeError
9
9
  # The value which couldn't be encoded
10
+ #: untyped
10
11
  attr_reader :duration_value
11
12
 
13
+ #: (untyped value) -> void
12
14
  def initialize(value)
13
15
  @duration_value = value
14
16
  super("Duration cannot be parsed: #{value}. \nDuration must be an ISO8601-formatted duration.")
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
- # typed: true
2
+ # typed: strict
3
3
  module GraphQL
4
4
  module Execution
5
5
  # Boolean checks for how an AST node's directives should
@@ -16,6 +16,7 @@ module GraphQL
16
16
  #
17
17
  # :call-seq:
18
18
  # include?(directive_ast_nodes, query) -> bool
19
+ #: (Array[GraphQL::Language::Nodes::Directive] directive_ast_nodes, GraphQL::Query query) -> bool
19
20
  def include?(directive_ast_nodes, query)
20
21
  directive_ast_nodes.each do |directive_ast_node|
21
22
  name = directive_ast_node.name
@@ -1,9 +1,14 @@
1
1
  # frozen_string_literal: true
2
- # typed: true
2
+ # typed: strict
3
3
 
4
4
  module GraphQL
5
5
  module Execution
6
6
  class Errors
7
+ # One level of a schema's `rescue_from` index: the handler registered for `class` (if any),
8
+ # plus handlers for its subclasses, keyed by error class.
9
+ # (Sorbet doesn't support recursive type aliases, so the nested entries are `untyped`.)
10
+ #: type handler_entry = { class: singleton(Exception)?, handler: Proc?, subclass_handlers: Hash[singleton(Exception), untyped] }
11
+
7
12
  # Register this handler, updating the
8
13
  # internal handler index to maintain least-to-most specific.
9
14
  #
@@ -19,9 +24,10 @@ module GraphQL
19
24
  #
20
25
  # :call-seq:
21
26
  # register_rescue_from(Class[Exception] error_class, Hash error_handlers, Proc error_handler) -> void
27
+ #: (singleton(Exception) error_class, Hash[singleton(Exception), handler_entry] error_handlers, Proc error_handler) -> void
22
28
  def self.register_rescue_from(error_class, error_handlers, error_handler)
23
- subclasses_handlers = {}
24
- this_level_subclasses = []
29
+ subclasses_handlers = {} #: Hash[singleton(Exception), handler_entry]
30
+ this_level_subclasses = [] #: Array[singleton(Exception)]
25
31
  # During this traversal, do two things:
26
32
  # - Identify any already-registered subclasses of this error class
27
33
  # and gather them up to be inserted _under_ this class
@@ -46,7 +52,7 @@ module GraphQL
46
52
  # See if any keys in this hash are superclasses of this new class:
47
53
  next_index_point = error_handlers.find { |err_class, handler| error_class < err_class }
48
54
  if next_index_point
49
- error_handlers = next_index_point[1][:subclass_handlers]
55
+ error_handlers = next_index_point[1][:subclass_handlers] #: as Hash[singleton(Exception), handler_entry]
50
56
  else
51
57
  # this new handler doesn't belong to any sub-handlers,
52
58
  # so insert it in the current set of `handlers`
@@ -55,7 +61,8 @@ module GraphQL
55
61
  end
56
62
  # Having found the point at which to insert this handler,
57
63
  # register it and merge any subclass handlers back in at this point.
58
- this_class_handlers = error_handlers[error_class]
64
+ # `error_handlers` has a default proc, so this is never `nil`:
65
+ this_class_handlers = error_handlers[error_class] #: as !nil
59
66
  this_class_handlers[:handler] = error_handler
60
67
  this_class_handlers[:subclass_handlers].merge!(subclasses_handlers)
61
68
  nil
@@ -67,9 +74,10 @@ module GraphQL
67
74
  #
68
75
  # :call-seq:
69
76
  # find_handler_for(schema, error_class) -> Proc | nil
77
+ #: (singleton(GraphQL::Schema) schema, singleton(Exception) error_class) -> handler_entry?
70
78
  def self.find_handler_for(schema, error_class)
71
79
  handlers = schema.error_handlers[:subclass_handlers]
72
- handler = nil #: untyped
80
+ handler = nil #: handler_entry?
73
81
  while (handlers) do
74
82
  _err_class, next_handler = handlers.find { |err_class, handler| error_class <= err_class }
75
83
  if next_handler
@@ -84,7 +92,10 @@ module GraphQL
84
92
 
85
93
  # check for a handler from a parent class:
86
94
  if schema.superclass.respond_to?(:error_handlers)
87
- parent_handler = find_handler_for(schema.superclass, error_class)
95
+ parent_handler = find_handler_for(
96
+ schema.superclass, #: as singleton(GraphQL::Schema)
97
+ error_class,
98
+ )
88
99
  end
89
100
 
90
101
  # If the inherited handler is more specific than the one defined here,
@@ -184,7 +184,7 @@ module GraphQL
184
184
  field_name = @ast_node.name
185
185
  @field_definition = query.types.field(@parent_type, field_name) || raise(GraphQL::Error, "No field definition found for #{@parent_type.to_type_signature}.#{ast_node.name} (at #{@ast_node.position})")
186
186
  set_current_field
187
- @arguments, errors = @runner.input_values[query].argument_values(@field_definition, @ast_node.arguments, self) # rubocop:disable Development/ContextIsPassedCop
187
+ @arguments, errors = query.input_values.argument_values(@field_definition, @ast_node.arguments, self) # rubocop:disable Development/ContextIsPassedCop
188
188
  if errors
189
189
  build_errors_result(errors, nil)
190
190
  return
@@ -201,7 +201,7 @@ module GraphQL
201
201
  # Used for compatibility in Schema::Subscription
202
202
  def arguments_without_loads
203
203
  if @arguments_without_loads.nil?
204
- @arguments_without_loads, _errors = @runner.input_values[@selections_step.query].argument_values(@field_definition, ast_node.arguments, nil)
204
+ @arguments_without_loads, _errors = @selections_step.query.input_values.argument_values(@field_definition, ast_node.arguments, nil)
205
205
  end
206
206
  @arguments_without_loads
207
207
  end
@@ -550,7 +550,7 @@ module GraphQL
550
550
  if directives
551
551
  directives.each do |dir_node|
552
552
  if (dir_defn = @runner.runtime_directives[dir_node.name])
553
- dir_args, errors = @runner.input_values[query].argument_values(dir_defn, dir_node.arguments, self) # rubocop:disable Development/ContextIsPassedCop
553
+ dir_args, errors = query.input_values.argument_values(dir_defn, dir_node.arguments, self) # rubocop:disable Development/ContextIsPassedCop
554
554
  if errors
555
555
  @results.each { |r| r.delete(@key) }
556
556
  errors.each { |e| e.ast_node = dir_node }