graphql 1.10.2 → 1.10.3

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 (33) hide show
  1. checksums.yaml +4 -4
  2. data/lib/generators/graphql/core.rb +10 -2
  3. data/lib/generators/graphql/templates/schema.erb +1 -0
  4. data/lib/graphql/define/defined_object_proxy.rb +1 -1
  5. data/lib/graphql/define/instance_definable.rb +1 -1
  6. data/lib/graphql/execution/interpreter.rb +3 -0
  7. data/lib/graphql/execution/interpreter/handles_raw_value.rb +25 -0
  8. data/lib/graphql/execution/interpreter/runtime.rb +37 -121
  9. data/lib/graphql/field.rb +1 -1
  10. data/lib/graphql/language/nodes.rb +41 -83
  11. data/lib/graphql/language/parser.rb +96 -96
  12. data/lib/graphql/language/parser.y +96 -96
  13. data/lib/graphql/pagination/connections.rb +21 -5
  14. data/lib/graphql/query/null_context.rb +5 -1
  15. data/lib/graphql/query/variables.rb +9 -3
  16. data/lib/graphql/schema.rb +18 -2
  17. data/lib/graphql/schema/build_from_definition.rb +15 -1
  18. data/lib/graphql/schema/enum.rb +4 -1
  19. data/lib/graphql/schema/field.rb +11 -0
  20. data/lib/graphql/schema/field/connection_extension.rb +2 -1
  21. data/lib/graphql/schema/input_object.rb +21 -38
  22. data/lib/graphql/schema/member/base_dsl_methods.rb +11 -4
  23. data/lib/graphql/schema/member/has_arguments.rb +53 -2
  24. data/lib/graphql/schema/member/has_ast_node.rb +4 -1
  25. data/lib/graphql/schema/member/has_fields.rb +1 -1
  26. data/lib/graphql/schema/resolver.rb +2 -2
  27. data/lib/graphql/schema/resolver/has_payload_type.rb +3 -1
  28. data/lib/graphql/schema/warden.rb +10 -0
  29. data/lib/graphql/static_validation/rules/variable_default_values_are_correctly_typed.rb +0 -1
  30. data/lib/graphql/subscriptions.rb +14 -9
  31. data/lib/graphql/subscriptions/subscription_root.rb +2 -1
  32. data/lib/graphql/version.rb +1 -1
  33. metadata +4 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a34f1cf03ff3b9db3635c9380be3bfc1dde1c36827afe3e39526fac966220991
4
- data.tar.gz: e1202b5ec6a0fc79e4ce8d3b953959ec834b47f569b2e2bccc78abfe5b3227d5
3
+ metadata.gz: fe0e22214a3e9457d34ff1cd9aa506abec6431d6dad443f87d297a8c88bbfb0d
4
+ data.tar.gz: 194b1ce3ee16b95b880f7488ea7cfa44a977330f7d218d591a6a2d076aed049e
5
5
  SHA512:
6
- metadata.gz: df151b5b38a43ae0da73d4c7b23eb0651c70417c822394d40b4e1a19cea06d681e7072d63a9c7888d3c415de575fffc3f3b6ecad13dc639f7cbac291781510e7
7
- data.tar.gz: 7c5a7c2522fb30d951b8f43ea7c182e0cb1ab9793a6b1697537cd9128ae72765bbafdb895cd7c8931319f639f61037e98d391ce84f48f8136c3b0c9ac62fab03
6
+ metadata.gz: 58a7a7149f8f36e42689aa746ecc18d2567ca8fde473dd152c785f26207d750cbc8f1e770d59fa4fdca87cb9d05948afa89a783419fc2accaeacdd29e5a36ab9
7
+ data.tar.gz: 59baab3d2e8c20050ac3378b5f9749e4989e28086609717c406134e299bf7804ff0207c8d67646e36ac7fd572db1cf6b8b6cca62a88e0133cfd7f5071ab0c046
@@ -48,11 +48,19 @@ module Graphql
48
48
  if options[:schema]
49
49
  options[:schema]
50
50
  else
51
- require File.expand_path("config/application", destination_root)
52
- "#{Rails.application.class.parent_name}Schema"
51
+ "#{parent_name}Schema"
53
52
  end
54
53
  end
55
54
  end
55
+
56
+ def parent_name
57
+ require File.expand_path("config/application", destination_root)
58
+ if Rails.application.class.respond_to?(:module_parent_name)
59
+ Rails.application.class.module_parent_name
60
+ else
61
+ Rails.application.class.parent_name
62
+ end
63
+ end
56
64
  end
57
65
  end
58
66
  end
@@ -3,6 +3,7 @@ class <%= schema_name %> < GraphQL::Schema
3
3
 
4
4
  # Opt in to the new runtime (default in future graphql-ruby versions)
5
5
  use GraphQL::Execution::Interpreter
6
+ use GraphQL::Analysis::AST
6
7
 
7
8
  # Add built-in connections for pagination
8
9
  use GraphQL::Pagination::Connections
@@ -34,7 +34,6 @@ module GraphQL
34
34
  end
35
35
 
36
36
  # Lookup a function from the dictionary and call it if it's found.
37
- ruby2_keywords
38
37
  def method_missing(name, *args, &block)
39
38
  definition = @dictionary[name]
40
39
  if definition
@@ -44,6 +43,7 @@ module GraphQL
44
43
  raise NoDefinitionError, msg, caller
45
44
  end
46
45
  end
46
+ ruby2_keywords :method_missing
47
47
 
48
48
  def respond_to_missing?(name, include_private = false)
49
49
  @dictionary[name] || super
@@ -200,10 +200,10 @@ module GraphQL
200
200
  # Even though we're just using the first value here,
201
201
  # We have to add a splat here to use `ruby2_keywords`,
202
202
  # so that it will accept a `[{}]` input from the caller.
203
- ruby2_keywords
204
203
  def call(defn, *value)
205
204
  defn.public_send(@attr_assign_method, value.first)
206
205
  end
206
+ ruby2_keywords :call
207
207
  end
208
208
  end
209
209
  end
@@ -3,6 +3,7 @@ require "graphql/execution/interpreter/execution_errors"
3
3
  require "graphql/execution/interpreter/hash_response"
4
4
  require "graphql/execution/interpreter/runtime"
5
5
  require "graphql/execution/interpreter/resolve"
6
+ require "graphql/execution/interpreter/handles_raw_value"
6
7
 
7
8
  module GraphQL
8
9
  module Execution
@@ -22,6 +23,8 @@ module GraphQL
22
23
  schema_class.query_execution_strategy(GraphQL::Execution::Interpreter)
23
24
  schema_class.mutation_execution_strategy(GraphQL::Execution::Interpreter)
24
25
  schema_class.subscription_execution_strategy(GraphQL::Execution::Interpreter)
26
+
27
+ GraphQL::Schema::Object.include(HandlesRawValue)
25
28
  end
26
29
 
27
30
  def self.begin_multiplex(multiplex)
@@ -0,0 +1,25 @@
1
+ # frozen_string_literal: true
2
+
3
+ module GraphQL
4
+ module Execution
5
+ class Interpreter
6
+ # Wrapper for raw values
7
+ class RawValue
8
+ def initialize(obj = nil)
9
+ @object = obj
10
+ end
11
+
12
+ def resolve
13
+ @object
14
+ end
15
+ end
16
+
17
+ # Allows to return "raw" value from the resolver
18
+ module HandlesRawValue
19
+ def raw_value(obj)
20
+ RawValue.new(obj)
21
+ end
22
+ end
23
+ end
24
+ end
25
+ end
@@ -146,7 +146,6 @@ module GraphQL
146
146
  raise "Invariant: no field for #{owner_type}.#{field_name}"
147
147
  end
148
148
  end
149
-
150
149
  return_type = field_defn.type
151
150
 
152
151
  next_path = path.dup
@@ -222,7 +221,10 @@ module GraphQL
222
221
  end
223
222
  after_lazy(app_result, owner: owner_type, field: field_defn, path: next_path, scoped_context: context.scoped_context, owner_object: object, arguments: kwarg_arguments) do |inner_result|
224
223
  continue_value = continue_value(next_path, inner_result, field_defn, return_type.non_null?, ast_node)
225
- if HALT != continue_value
224
+ if RawValue === continue_value
225
+ # Write raw value directly to the response without resolving nested objects
226
+ write_in_response(next_path, continue_value.resolve)
227
+ elsif HALT != continue_value
226
228
  continue_field(next_path, continue_value, field_defn, return_type, ast_node, next_selections, false, object, kwarg_arguments)
227
229
  end
228
230
  end
@@ -336,8 +338,7 @@ module GraphQL
336
338
  set_type_at_path(next_path, inner_type)
337
339
  # This will update `response_list` with the lazy
338
340
  after_lazy(inner_value, owner: inner_type, path: next_path, scoped_context: scoped_context, field: field, owner_object: owner_object, arguments: arguments) do |inner_inner_value|
339
- # reset `is_non_null` here and below, because the inner type will have its own nullability constraint
340
- continue_value = continue_value(next_path, inner_inner_value, field, false, ast_node)
341
+ continue_value = continue_value(next_path, inner_inner_value, field, inner_type.non_null?, ast_node)
341
342
  if HALT != continue_value
342
343
  continue_field(next_path, continue_value, field, inner_type, ast_node, next_selections, false, owner_object, arguments)
343
344
  end
@@ -435,133 +436,48 @@ module GraphQL
435
436
  end
436
437
  end
437
438
 
438
- def each_argument_pair(ast_args_or_hash)
439
- case ast_args_or_hash
440
- when GraphQL::Language::Nodes::Field, GraphQL::Language::Nodes::InputObject, GraphQL::Language::Nodes::Directive
441
- ast_args_or_hash.arguments.each do |arg|
442
- yield(arg.name, arg.value)
443
- end
444
- when Hash
445
- ast_args_or_hash.each do |key, value|
446
- normalized_name = GraphQL::Schema::Member::BuildType.camelize(key.to_s)
447
- yield(normalized_name, value)
448
- end
449
- else
450
- raise "Invariant, unexpected #{ast_args_or_hash.inspect}"
451
- end
452
- end
439
+ NO_VALUE_GIVEN = Object.new
453
440
 
454
- def arguments(graphql_object, arg_owner, ast_node_or_hash)
455
- kwarg_arguments = {}
456
- arg_defns = arg_owner.arguments
457
- each_argument_pair(ast_node_or_hash) do |arg_name, arg_value|
458
- arg_defn = arg_defns[arg_name]
459
- # Need to distinguish between client-provided `nil`
460
- # and nothing-at-all
461
- is_present, value = arg_to_value(graphql_object, arg_defn.type, arg_value, already_arguments: false)
462
- if is_present
463
- # This doesn't apply to directives, which are legacy
464
- # Can remove this when Skip and Include use classes or something.
465
- if graphql_object
466
- value = arg_defn.prepare_value(graphql_object, value)
467
- end
468
- kwarg_arguments[arg_defn.keyword] = value
469
- end
470
- end
471
- arg_defns.each do |name, arg_defn|
472
- if arg_defn.default_value? && !kwarg_arguments.key?(arg_defn.keyword)
473
- _is_present, value = arg_to_value(graphql_object, arg_defn.type, arg_defn.default_value, already_arguments: false)
474
- kwarg_arguments[arg_defn.keyword] = value
475
- end
476
- end
477
- kwarg_arguments
478
- end
479
-
480
- # TODO CAN THIS USE `.coerce_input` ???
481
-
482
- # Get a Ruby-ready value from a client query.
483
- # @param graphql_object [Object] The owner of the field whose argument this is
484
- # @param arg_type [Class, GraphQL::Schema::NonNull, GraphQL::Schema::List]
485
- # @param ast_value [GraphQL::Language::Nodes::VariableIdentifier, String, Integer, Float, Boolean]
486
- # @param already_arguments [Boolean] if true, don't re-coerce these with `arguments(...)`
487
- # @return [Array(is_present, value)]
488
- def arg_to_value(graphql_object, arg_type, ast_value, already_arguments:)
489
- if ast_value.is_a?(GraphQL::Language::Nodes::VariableIdentifier)
490
- # If it's not here, it will get added later
491
- if query.variables.key?(ast_value.name)
492
- variable_value = query.variables[ast_value.name]
493
- arg_to_value(graphql_object, arg_type, variable_value, already_arguments: true)
494
- else
495
- return false, nil
441
+ def prepare_args_hash(ast_arg_or_hash_or_value)
442
+ case ast_arg_or_hash_or_value
443
+ when Hash
444
+ args_hash = {}
445
+ ast_arg_or_hash_or_value.each do |k, v|
446
+ args_hash[k] = prepare_args_hash(v)
496
447
  end
497
- elsif ast_value.is_a?(GraphQL::Language::Nodes::NullValue)
498
- return true, nil
499
- elsif arg_type.is_a?(GraphQL::Schema::NonNull)
500
- arg_to_value(graphql_object, arg_type.of_type, ast_value, already_arguments: already_arguments)
501
- elsif arg_type.is_a?(GraphQL::Schema::List)
502
- if ast_value.nil?
503
- return true, nil
504
- else
505
- # Treat a single value like a list
506
- arg_value = Array(ast_value)
507
- list = []
508
- arg_value.map do |inner_v|
509
- _present, value = arg_to_value(graphql_object, arg_type.of_type, inner_v, already_arguments: already_arguments)
510
- list << value
448
+ args_hash
449
+ when Array
450
+ ast_arg_or_hash_or_value.map { |v| prepare_args_hash(v) }
451
+ when GraphQL::Language::Nodes::Field, GraphQL::Language::Nodes::InputObject, GraphQL::Language::Nodes::Directive
452
+ args_hash = {}
453
+ ast_arg_or_hash_or_value.arguments.each do |arg|
454
+ v = prepare_args_hash(arg.value)
455
+ if v != NO_VALUE_GIVEN
456
+ args_hash[arg.name] = v
511
457
  end
512
- return true, list
513
458
  end
514
- elsif arg_type.is_a?(Class) && arg_type < GraphQL::Schema::InputObject
515
- if already_arguments
516
- # This came from a variable, already prepared.
517
- # But replace `nil` with `{}` like we would for `arg_type`
518
- if ast_value.nil?
519
- return false, nil
520
- else
521
- return true, ast_value
522
- end
459
+ args_hash
460
+ when GraphQL::Language::Nodes::VariableIdentifier
461
+ if query.variables.key?(ast_arg_or_hash_or_value.name)
462
+ variable_value = query.variables[ast_arg_or_hash_or_value.name]
463
+ prepare_args_hash(variable_value)
523
464
  else
524
- # For these, `prepare` is applied during `#initialize`.
525
- # Pass `nil` so it will be skipped in `#arguments`.
526
- # What a mess.
527
- args = arguments(nil, arg_type, ast_value)
528
- end
529
-
530
- input_obj = query.with_error_handling do
531
- # We're not tracking defaults_used, but for our purposes
532
- # we compare the value to the default value.
533
- arg_type.new(ruby_kwargs: args, context: context, defaults_used: nil)
465
+ NO_VALUE_GIVEN
534
466
  end
535
- return true, input_obj
467
+ when GraphQL::Language::Nodes::Enum
468
+ ast_arg_or_hash_or_value.name
469
+ when GraphQL::Language::Nodes::NullValue
470
+ nil
536
471
  else
537
- flat_value = if already_arguments
538
- # It was coerced by variable handling
539
- ast_value
540
- else
541
- v = flatten_ast_value(ast_value)
542
- arg_type.coerce_input(v, context)
543
- end
544
- return true, flat_value
472
+ ast_arg_or_hash_or_value
545
473
  end
546
474
  end
547
475
 
548
- def flatten_ast_value(v)
549
- case v
550
- when GraphQL::Language::Nodes::Enum
551
- v.name
552
- when GraphQL::Language::Nodes::InputObject
553
- h = {}
554
- v.arguments.each do |arg|
555
- h[arg.name] = flatten_ast_value(arg.value)
556
- end
557
- h
558
- when Array
559
- v.map { |v2| flatten_ast_value(v2) }
560
- when GraphQL::Language::Nodes::VariableIdentifier
561
- flatten_ast_value(query.variables[v.name])
562
- else
563
- v
564
- end
476
+ def arguments(graphql_object, arg_owner, ast_node_or_hash)
477
+ # First, normalize all AST or Ruby values to a plain Ruby hash
478
+ args_hash = prepare_args_hash(ast_node_or_hash)
479
+ # Then call into the schema to coerce those incoming values
480
+ arg_owner.coerce_arguments(graphql_object, args_hash, context)
565
481
  end
566
482
 
567
483
  def write_invalid_null_in_response(path, invalid_null_error)
@@ -154,7 +154,7 @@ module GraphQL
154
154
  end
155
155
 
156
156
  def name=(new_name)
157
- old_name = @name
157
+ old_name = defined?(@name) ? @name : nil
158
158
  @name = new_name
159
159
 
160
160
  if old_name != new_name && @resolve_proc.is_a?(Field::Resolve::NameResolve)
@@ -65,9 +65,8 @@ module GraphQL
65
65
  @query_string = nil
66
66
  end
67
67
 
68
- # @return [Symbol] the method to call on {Language::Visitor} for this node
69
- def visit_method
70
- raise GraphQL::RequiredImplementationMissingError, "#{self.class.name}#visit_method shold return a symbol"
68
+ def children_method_name
69
+ self.class.children_method_name
71
70
  end
72
71
 
73
72
  def position
@@ -147,9 +146,10 @@ module GraphQL
147
146
  :on_#{name_underscored}
148
147
  end
149
148
 
150
- def children_method_name
151
- :#{name_underscored}s
149
+ class << self
150
+ attr_accessor :children_method_name
152
151
  end
152
+ self.children_method_name = :#{name_underscored}s
153
153
  RUBY
154
154
  end
155
155
 
@@ -161,7 +161,7 @@ module GraphQL
161
161
  # - Add a persistent update method to add a child
162
162
  # - Generate a `#children` method
163
163
  def children_methods(children_of_type)
164
- if @children_methods
164
+ if defined?(@children_methods)
165
165
  raise "Can't re-call .children_methods for #{self} (already have: #{@children_methods})"
166
166
  else
167
167
  @children_methods = children_of_type
@@ -204,7 +204,11 @@ module GraphQL
204
204
  end
205
205
 
206
206
  if defined?(@scalar_methods)
207
- generate_initialize_node
207
+ if !method_defined?(:initialize_node)
208
+ generate_initialize_node
209
+ else
210
+ # This method was defined manually
211
+ end
208
212
  else
209
213
  raise "Can't generate_initialize_node because scalar_methods wasn't called; call it before children_methods"
210
214
  end
@@ -214,7 +218,7 @@ module GraphQL
214
218
  # - Add reader methods
215
219
  # - Add a `#scalars` method
216
220
  def scalar_methods(*method_names)
217
- if @scalar_methods
221
+ if defined?(@scalar_methods)
218
222
  raise "Can't re-call .scalar_methods for #{self} (already have: #{@scalar_methods})"
219
223
  else
220
224
  @scalar_methods = method_names
@@ -373,19 +377,11 @@ module GraphQL
373
377
  end
374
378
 
375
379
  # Override this because default is `:fields`
376
- def children_method_name
377
- :selections
378
- end
380
+ self.children_method_name = :selections
379
381
  end
380
382
 
381
383
  # A reusable fragment, defined at document-level.
382
384
  class FragmentDefinition < AbstractNode
383
- scalar_methods :name, :type
384
- children_methods({
385
- selections: GraphQL::Language::Nodes::Field,
386
- directives: GraphQL::Language::Nodes::Directive,
387
- })
388
-
389
385
  # @!attribute name
390
386
  # @return [String] the identifier for this fragment, which may be applied with `...#{name}`
391
387
 
@@ -398,9 +394,13 @@ module GraphQL
398
394
  @selections = selections
399
395
  end
400
396
 
401
- def children_method_name
402
- :definitions
403
- end
397
+ scalar_methods :name, :type
398
+ children_methods({
399
+ selections: GraphQL::Language::Nodes::Field,
400
+ directives: GraphQL::Language::Nodes::Directive,
401
+ })
402
+
403
+ self.children_method_name = :definitions
404
404
  end
405
405
 
406
406
  # Application of a named fragment in a selection
@@ -408,9 +408,7 @@ module GraphQL
408
408
  scalar_methods :name
409
409
  children_methods(directives: GraphQL::Language::Nodes::Directive)
410
410
 
411
- def children_method_name
412
- :selections
413
- end
411
+ self.children_method_name = :selections
414
412
 
415
413
  # @!attribute name
416
414
  # @return [String] The identifier of the fragment to apply, corresponds with {FragmentDefinition#name}
@@ -424,9 +422,7 @@ module GraphQL
424
422
  directives: GraphQL::Language::Nodes::Directive,
425
423
  })
426
424
 
427
- def children_method_name
428
- :selections
429
- end
425
+ self.children_method_name = :selections
430
426
 
431
427
  # @!attribute type
432
428
  # @return [String, nil] Name of the type this fragment applies to, or `nil` if this fragment applies to any type
@@ -449,9 +445,7 @@ module GraphQL
449
445
  end
450
446
  end
451
447
 
452
- def children_method_name
453
- :value
454
- end
448
+ self.children_method_name = :value
455
449
 
456
450
  private
457
451
 
@@ -519,9 +513,7 @@ module GraphQL
519
513
  # @!attribute name
520
514
  # @return [String, nil] The name for this operation, or `nil` if unnamed
521
515
 
522
- def children_method_name
523
- :definitions
524
- end
516
+ self.children_method_name = :definitions
525
517
  end
526
518
 
527
519
  # A type name, used for variable definitions
@@ -538,9 +530,7 @@ module GraphQL
538
530
  children_methods({
539
531
  directives: GraphQL::Language::Nodes::Directive,
540
532
  })
541
- def children_method_name
542
- :definitions
543
- end
533
+ self.children_method_name = :definitions
544
534
  end
545
535
 
546
536
  class SchemaExtension < AbstractNode
@@ -548,9 +538,7 @@ module GraphQL
548
538
  children_methods({
549
539
  directives: GraphQL::Language::Nodes::Directive,
550
540
  })
551
- def children_method_name
552
- :definitions
553
- end
541
+ self.children_method_name = :definitions
554
542
  end
555
543
 
556
544
  class ScalarTypeDefinition < AbstractNode
@@ -560,9 +548,7 @@ module GraphQL
560
548
  children_methods({
561
549
  directives: GraphQL::Language::Nodes::Directive,
562
550
  })
563
- def children_method_name
564
- :definitions
565
- end
551
+ self.children_method_name = :definitions
566
552
  end
567
553
 
568
554
  class ScalarTypeExtension < AbstractNode
@@ -570,9 +556,7 @@ module GraphQL
570
556
  children_methods({
571
557
  directives: GraphQL::Language::Nodes::Directive,
572
558
  })
573
- def children_method_name
574
- :definitions
575
- end
559
+ self.children_method_name = :definitions
576
560
  end
577
561
 
578
562
  class InputValueDefinition < AbstractNode
@@ -582,9 +566,7 @@ module GraphQL
582
566
  children_methods({
583
567
  directives: GraphQL::Language::Nodes::Directive,
584
568
  })
585
- def children_method_name
586
- :fields
587
- end
569
+ self.children_method_name = :fields
588
570
  end
589
571
 
590
572
  class FieldDefinition < AbstractNode
@@ -595,9 +577,7 @@ module GraphQL
595
577
  directives: GraphQL::Language::Nodes::Directive,
596
578
  arguments: GraphQL::Language::Nodes::InputValueDefinition,
597
579
  })
598
- def children_method_name
599
- :fields
600
- end
580
+ self.children_method_name = :fields
601
581
 
602
582
  # this is so that `children_method_name` of `InputValueDefinition` works properly
603
583
  # with `#replace_child`
@@ -618,9 +598,7 @@ module GraphQL
618
598
  directives: GraphQL::Language::Nodes::Directive,
619
599
  fields: GraphQL::Language::Nodes::FieldDefinition,
620
600
  })
621
- def children_method_name
622
- :definitions
623
- end
601
+ self.children_method_name = :definitions
624
602
  end
625
603
 
626
604
  class ObjectTypeExtension < AbstractNode
@@ -629,9 +607,7 @@ module GraphQL
629
607
  directives: GraphQL::Language::Nodes::Directive,
630
608
  fields: GraphQL::Language::Nodes::FieldDefinition,
631
609
  })
632
- def children_method_name
633
- :definitions
634
- end
610
+ self.children_method_name = :definitions
635
611
  end
636
612
 
637
613
  class InterfaceTypeDefinition < AbstractNode
@@ -642,9 +618,7 @@ module GraphQL
642
618
  directives: GraphQL::Language::Nodes::Directive,
643
619
  fields: GraphQL::Language::Nodes::FieldDefinition,
644
620
  })
645
- def children_method_name
646
- :definitions
647
- end
621
+ self.children_method_name = :definitions
648
622
  end
649
623
 
650
624
  class InterfaceTypeExtension < AbstractNode
@@ -653,9 +627,7 @@ module GraphQL
653
627
  directives: GraphQL::Language::Nodes::Directive,
654
628
  fields: GraphQL::Language::Nodes::FieldDefinition,
655
629
  })
656
- def children_method_name
657
- :definitions
658
- end
630
+ self.children_method_name = :definitions
659
631
  end
660
632
 
661
633
  class UnionTypeDefinition < AbstractNode
@@ -665,9 +637,7 @@ module GraphQL
665
637
  children_methods({
666
638
  directives: GraphQL::Language::Nodes::Directive,
667
639
  })
668
- def children_method_name
669
- :definitions
670
- end
640
+ self.children_method_name = :definitions
671
641
  end
672
642
 
673
643
  class UnionTypeExtension < AbstractNode
@@ -676,9 +646,7 @@ module GraphQL
676
646
  children_methods({
677
647
  directives: GraphQL::Language::Nodes::Directive,
678
648
  })
679
- def children_method_name
680
- :definitions
681
- end
649
+ self.children_method_name = :definitions
682
650
  end
683
651
 
684
652
  class EnumValueDefinition < AbstractNode
@@ -688,9 +656,7 @@ module GraphQL
688
656
  children_methods({
689
657
  directives: GraphQL::Language::Nodes::Directive,
690
658
  })
691
- def children_method_name
692
- :values
693
- end
659
+ self.children_method_name = :values
694
660
  end
695
661
 
696
662
  class EnumTypeDefinition < AbstractNode
@@ -701,9 +667,7 @@ module GraphQL
701
667
  directives: GraphQL::Language::Nodes::Directive,
702
668
  values: GraphQL::Language::Nodes::EnumValueDefinition,
703
669
  })
704
- def children_method_name
705
- :definitions
706
- end
670
+ self.children_method_name = :definitions
707
671
  end
708
672
 
709
673
  class EnumTypeExtension < AbstractNode
@@ -712,9 +676,7 @@ module GraphQL
712
676
  directives: GraphQL::Language::Nodes::Directive,
713
677
  values: GraphQL::Language::Nodes::EnumValueDefinition,
714
678
  })
715
- def children_method_name
716
- :definitions
717
- end
679
+ self.children_method_name = :definitions
718
680
  end
719
681
 
720
682
  class InputObjectTypeDefinition < AbstractNode
@@ -725,9 +687,7 @@ module GraphQL
725
687
  directives: GraphQL::Language::Nodes::Directive,
726
688
  fields: GraphQL::Language::Nodes::InputValueDefinition,
727
689
  })
728
- def children_method_name
729
- :definitions
730
- end
690
+ self.children_method_name = :definitions
731
691
  end
732
692
 
733
693
  class InputObjectTypeExtension < AbstractNode
@@ -736,9 +696,7 @@ module GraphQL
736
696
  directives: GraphQL::Language::Nodes::Directive,
737
697
  fields: GraphQL::Language::Nodes::InputValueDefinition,
738
698
  })
739
- def children_method_name
740
- :definitions
741
- end
699
+ self.children_method_name = :definitions
742
700
  end
743
701
  end
744
702
  end