graphql 2.0.30 → 2.3.6
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.
- checksums.yaml +4 -4
- data/lib/generators/graphql/install/mutation_root_generator.rb +2 -2
- data/lib/generators/graphql/install/templates/base_mutation.erb +2 -0
- data/lib/generators/graphql/install/templates/mutation_type.erb +2 -0
- data/lib/generators/graphql/install_generator.rb +3 -0
- data/lib/generators/graphql/templates/base_argument.erb +2 -0
- data/lib/generators/graphql/templates/base_connection.erb +2 -0
- data/lib/generators/graphql/templates/base_edge.erb +2 -0
- data/lib/generators/graphql/templates/base_enum.erb +2 -0
- data/lib/generators/graphql/templates/base_field.erb +2 -0
- data/lib/generators/graphql/templates/base_input_object.erb +2 -0
- data/lib/generators/graphql/templates/base_interface.erb +2 -0
- data/lib/generators/graphql/templates/base_object.erb +2 -0
- data/lib/generators/graphql/templates/base_resolver.erb +6 -0
- data/lib/generators/graphql/templates/base_scalar.erb +2 -0
- data/lib/generators/graphql/templates/base_union.erb +2 -0
- data/lib/generators/graphql/templates/graphql_controller.erb +2 -0
- data/lib/generators/graphql/templates/loader.erb +2 -0
- data/lib/generators/graphql/templates/mutation.erb +2 -0
- data/lib/generators/graphql/templates/node_type.erb +2 -0
- data/lib/generators/graphql/templates/query_type.erb +2 -0
- data/lib/generators/graphql/templates/schema.erb +5 -0
- data/lib/graphql/analysis/analyzer.rb +89 -0
- data/lib/graphql/analysis/field_usage.rb +82 -0
- data/lib/graphql/analysis/max_query_complexity.rb +20 -0
- data/lib/graphql/analysis/max_query_depth.rb +20 -0
- data/lib/graphql/analysis/query_complexity.rb +183 -0
- data/lib/graphql/analysis/query_depth.rb +58 -0
- data/lib/graphql/analysis/visitor.rb +282 -0
- data/lib/graphql/analysis.rb +92 -1
- data/lib/graphql/backtrace/inspect_result.rb +0 -12
- data/lib/graphql/backtrace/trace.rb +12 -15
- data/lib/graphql/coercion_error.rb +1 -9
- data/lib/graphql/dataloader/async_dataloader.rb +88 -0
- data/lib/graphql/dataloader/null_dataloader.rb +1 -1
- data/lib/graphql/dataloader/request.rb +5 -0
- data/lib/graphql/dataloader/source.rb +11 -3
- data/lib/graphql/dataloader.rb +112 -142
- data/lib/graphql/duration_encoding_error.rb +16 -0
- data/lib/graphql/execution/interpreter/argument_value.rb +5 -1
- data/lib/graphql/execution/interpreter/runtime/graphql_result.rb +175 -0
- data/lib/graphql/execution/interpreter/runtime.rb +163 -365
- data/lib/graphql/execution/interpreter.rb +92 -158
- data/lib/graphql/execution/lookahead.rb +88 -21
- data/lib/graphql/introspection/dynamic_fields.rb +1 -1
- data/lib/graphql/introspection/entry_points.rb +11 -5
- data/lib/graphql/introspection/schema_type.rb +3 -1
- data/lib/graphql/language/block_string.rb +34 -18
- data/lib/graphql/language/definition_slice.rb +1 -1
- data/lib/graphql/language/document_from_schema_definition.rb +38 -38
- data/lib/graphql/language/lexer.rb +305 -193
- data/lib/graphql/language/nodes.rb +113 -66
- data/lib/graphql/language/parser.rb +787 -1986
- data/lib/graphql/language/printer.rb +303 -146
- data/lib/graphql/language/sanitized_printer.rb +20 -22
- data/lib/graphql/language/static_visitor.rb +167 -0
- data/lib/graphql/language/visitor.rb +20 -81
- data/lib/graphql/language.rb +61 -0
- data/lib/graphql/load_application_object_failed_error.rb +5 -1
- data/lib/graphql/pagination/array_connection.rb +6 -6
- data/lib/graphql/pagination/connection.rb +28 -1
- data/lib/graphql/pagination/mongoid_relation_connection.rb +1 -2
- data/lib/graphql/query/context/scoped_context.rb +101 -0
- data/lib/graphql/query/context.rb +66 -131
- data/lib/graphql/query/null_context.rb +4 -11
- data/lib/graphql/query/validation_pipeline.rb +4 -4
- data/lib/graphql/query/variables.rb +3 -3
- data/lib/graphql/query.rb +17 -26
- data/lib/graphql/railtie.rb +9 -6
- data/lib/graphql/rake_task.rb +3 -12
- data/lib/graphql/rubocop/graphql/base_cop.rb +1 -1
- data/lib/graphql/schema/addition.rb +21 -11
- data/lib/graphql/schema/argument.rb +43 -8
- data/lib/graphql/schema/base_64_encoder.rb +3 -5
- data/lib/graphql/schema/build_from_definition.rb +9 -12
- data/lib/graphql/schema/directive/one_of.rb +12 -0
- data/lib/graphql/schema/directive/specified_by.rb +14 -0
- data/lib/graphql/schema/directive.rb +3 -1
- data/lib/graphql/schema/enum.rb +3 -3
- data/lib/graphql/schema/field/connection_extension.rb +1 -15
- data/lib/graphql/schema/field/scope_extension.rb +8 -1
- data/lib/graphql/schema/field.rb +49 -35
- data/lib/graphql/schema/has_single_input_argument.rb +157 -0
- data/lib/graphql/schema/input_object.rb +4 -4
- data/lib/graphql/schema/interface.rb +10 -10
- data/lib/graphql/schema/introspection_system.rb +4 -2
- data/lib/graphql/schema/late_bound_type.rb +4 -0
- data/lib/graphql/schema/list.rb +2 -2
- data/lib/graphql/schema/loader.rb +2 -3
- data/lib/graphql/schema/member/base_dsl_methods.rb +2 -1
- data/lib/graphql/schema/member/has_arguments.rb +63 -73
- data/lib/graphql/schema/member/has_directives.rb +1 -1
- data/lib/graphql/schema/member/has_fields.rb +8 -5
- data/lib/graphql/schema/member/has_interfaces.rb +23 -9
- data/lib/graphql/schema/member/relay_shortcuts.rb +1 -1
- data/lib/graphql/schema/member/scoped.rb +19 -0
- data/lib/graphql/schema/member/type_system_helpers.rb +1 -2
- data/lib/graphql/schema/member/validates_input.rb +3 -3
- data/lib/graphql/schema/mutation.rb +7 -0
- data/lib/graphql/schema/object.rb +8 -0
- data/lib/graphql/schema/printer.rb +8 -7
- data/lib/graphql/schema/relay_classic_mutation.rb +6 -128
- data/lib/graphql/schema/resolver.rb +27 -13
- data/lib/graphql/schema/scalar.rb +3 -3
- data/lib/graphql/schema/subscription.rb +11 -4
- data/lib/graphql/schema/union.rb +1 -1
- data/lib/graphql/schema/unique_within_type.rb +1 -1
- data/lib/graphql/schema/warden.rb +96 -95
- data/lib/graphql/schema.rb +323 -102
- data/lib/graphql/static_validation/all_rules.rb +1 -1
- data/lib/graphql/static_validation/base_visitor.rb +1 -1
- data/lib/graphql/static_validation/literal_validator.rb +2 -3
- data/lib/graphql/static_validation/rules/fields_will_merge.rb +2 -2
- data/lib/graphql/static_validation/rules/required_arguments_are_present.rb +1 -1
- data/lib/graphql/static_validation/rules/required_input_object_attributes_are_present.rb +2 -2
- data/lib/graphql/static_validation/validation_context.rb +5 -5
- data/lib/graphql/static_validation/validator.rb +3 -0
- data/lib/graphql/static_validation.rb +0 -1
- data/lib/graphql/subscriptions/action_cable_subscriptions.rb +4 -3
- data/lib/graphql/subscriptions/broadcast_analyzer.rb +1 -1
- data/lib/graphql/subscriptions/event.rb +8 -2
- data/lib/graphql/subscriptions/serialize.rb +2 -0
- data/lib/graphql/subscriptions.rb +15 -13
- data/lib/graphql/testing/helpers.rb +151 -0
- data/lib/graphql/testing.rb +2 -0
- data/lib/graphql/tracing/appoptics_trace.rb +2 -2
- data/lib/graphql/tracing/appoptics_tracing.rb +2 -2
- data/lib/graphql/tracing/legacy_hooks_trace.rb +74 -0
- data/lib/graphql/tracing/platform_tracing.rb +3 -1
- data/lib/graphql/tracing/{prometheus_tracing → prometheus_trace}/graphql_collector.rb +3 -1
- data/lib/graphql/tracing/prometheus_trace.rb +9 -9
- data/lib/graphql/tracing/sentry_trace.rb +112 -0
- data/lib/graphql/tracing/trace.rb +1 -0
- data/lib/graphql/tracing.rb +3 -1
- data/lib/graphql/type_kinds.rb +1 -1
- data/lib/graphql/types/iso_8601_duration.rb +77 -0
- data/lib/graphql/types/relay/connection_behaviors.rb +32 -2
- data/lib/graphql/types/relay/edge_behaviors.rb +7 -0
- data/lib/graphql/types.rb +1 -0
- data/lib/graphql/version.rb +1 -1
- data/lib/graphql.rb +13 -13
- data/readme.md +12 -2
- metadata +33 -26
- data/lib/graphql/analysis/ast/analyzer.rb +0 -84
- data/lib/graphql/analysis/ast/field_usage.rb +0 -57
- data/lib/graphql/analysis/ast/max_query_complexity.rb +0 -22
- data/lib/graphql/analysis/ast/max_query_depth.rb +0 -22
- data/lib/graphql/analysis/ast/query_complexity.rb +0 -230
- data/lib/graphql/analysis/ast/query_depth.rb +0 -55
- data/lib/graphql/analysis/ast/visitor.rb +0 -276
- data/lib/graphql/analysis/ast.rb +0 -81
- data/lib/graphql/deprecation.rb +0 -9
- data/lib/graphql/filter.rb +0 -59
- data/lib/graphql/language/parser.y +0 -560
- data/lib/graphql/schema/base_64_bp.rb +0 -26
- data/lib/graphql/static_validation/type_stack.rb +0 -216
- data/lib/graphql/subscriptions/instrumentation.rb +0 -28
|
@@ -16,30 +16,33 @@ module GraphQL
|
|
|
16
16
|
# @return [Integer] The first line of the definition (not the description)
|
|
17
17
|
attr_reader :definition_line
|
|
18
18
|
|
|
19
|
-
def initialize(
|
|
20
|
-
@definition_line =
|
|
21
|
-
super(
|
|
19
|
+
def initialize(definition_line: nil, **_rest)
|
|
20
|
+
@definition_line = definition_line
|
|
21
|
+
super(**_rest)
|
|
22
22
|
end
|
|
23
|
-
end
|
|
24
23
|
|
|
25
|
-
|
|
24
|
+
def marshal_dump
|
|
25
|
+
super << @definition_line
|
|
26
|
+
end
|
|
26
27
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
def initialize(options = {})
|
|
31
|
-
if options.key?(:position_source)
|
|
32
|
-
position_source = options.delete(:position_source)
|
|
33
|
-
@line = position_source[1]
|
|
34
|
-
@col = position_source[2]
|
|
35
|
-
else
|
|
36
|
-
@line = options.delete(:line)
|
|
37
|
-
@col = options.delete(:col)
|
|
28
|
+
def marshal_load(values)
|
|
29
|
+
@definition_line = values.pop
|
|
30
|
+
super
|
|
38
31
|
end
|
|
32
|
+
end
|
|
39
33
|
|
|
40
|
-
|
|
34
|
+
attr_reader :filename
|
|
41
35
|
|
|
42
|
-
|
|
36
|
+
def line
|
|
37
|
+
@line ||= @source.line_at(@pos)
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
def col
|
|
41
|
+
@col ||= @source.column_at(@pos)
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
def definition_line
|
|
45
|
+
@definition_line ||= (@source && @definition_pos) ? @source.line_at(@definition_pos) : nil
|
|
43
46
|
end
|
|
44
47
|
|
|
45
48
|
# Value equality
|
|
@@ -196,8 +199,8 @@ module GraphQL
|
|
|
196
199
|
module_eval <<-RUBY, __FILE__, __LINE__
|
|
197
200
|
# Singular method: create a node with these options
|
|
198
201
|
# and return a new `self` which includes that node in this list.
|
|
199
|
-
def merge_#{method_name.to_s.sub(/s$/, "")}(node_opts)
|
|
200
|
-
merge(#{method_name}: #{method_name} + [#{node_type.name}.new(node_opts)])
|
|
202
|
+
def merge_#{method_name.to_s.sub(/s$/, "")}(**node_opts)
|
|
203
|
+
merge(#{method_name}: #{method_name} + [#{node_type.name}.new(**node_opts)])
|
|
201
204
|
end
|
|
202
205
|
RUBY
|
|
203
206
|
end
|
|
@@ -226,13 +229,14 @@ module GraphQL
|
|
|
226
229
|
end
|
|
227
230
|
|
|
228
231
|
if defined?(@scalar_methods)
|
|
229
|
-
if
|
|
230
|
-
|
|
232
|
+
if !@initialize_was_generated
|
|
233
|
+
@initialize_was_generated = true
|
|
234
|
+
generate_initialize
|
|
231
235
|
else
|
|
232
236
|
# This method was defined manually
|
|
233
237
|
end
|
|
234
238
|
else
|
|
235
|
-
raise "Can't
|
|
239
|
+
raise "Can't generate_initialize because scalar_methods wasn't called; call it before children_methods"
|
|
236
240
|
end
|
|
237
241
|
end
|
|
238
242
|
|
|
@@ -261,7 +265,17 @@ module GraphQL
|
|
|
261
265
|
end
|
|
262
266
|
end
|
|
263
267
|
|
|
264
|
-
|
|
268
|
+
DEFAULT_INITIALIZE_OPTIONS = [
|
|
269
|
+
"line: nil",
|
|
270
|
+
"col: nil",
|
|
271
|
+
"pos: nil",
|
|
272
|
+
"filename: nil",
|
|
273
|
+
"source: nil",
|
|
274
|
+
]
|
|
275
|
+
|
|
276
|
+
def generate_initialize
|
|
277
|
+
return if method_defined?(:marshal_load, false) # checking for `:initialize` doesn't work right
|
|
278
|
+
|
|
265
279
|
scalar_method_names = @scalar_methods
|
|
266
280
|
# TODO: These probably should be scalar methods, but `types` returns an array
|
|
267
281
|
[:types, :description].each do |extra_method|
|
|
@@ -270,29 +284,54 @@ module GraphQL
|
|
|
270
284
|
end
|
|
271
285
|
end
|
|
272
286
|
|
|
273
|
-
|
|
287
|
+
children_method_names = @children_methods.keys
|
|
288
|
+
|
|
289
|
+
all_method_names = scalar_method_names + children_method_names
|
|
274
290
|
if all_method_names.include?(:alias)
|
|
275
291
|
# Rather than complicating this special case,
|
|
276
292
|
# let it be overridden (in field)
|
|
277
293
|
return
|
|
278
294
|
else
|
|
279
295
|
arguments = scalar_method_names.map { |m| "#{m}: nil"} +
|
|
280
|
-
|
|
296
|
+
children_method_names.map { |m| "#{m}: NO_CHILDREN" } +
|
|
297
|
+
DEFAULT_INITIALIZE_OPTIONS
|
|
281
298
|
|
|
282
299
|
assignments = scalar_method_names.map { |m| "@#{m} = #{m}"} +
|
|
283
|
-
|
|
300
|
+
children_method_names.map { |m| "@#{m} = #{m}.freeze" }
|
|
301
|
+
|
|
302
|
+
if name.end_with?("Definition") && name != "FragmentDefinition"
|
|
303
|
+
arguments << "definition_pos: nil"
|
|
304
|
+
assignments << "@definition_pos = definition_pos"
|
|
305
|
+
end
|
|
284
306
|
|
|
285
307
|
keywords = scalar_method_names.map { |m| "#{m}: #{m}"} +
|
|
286
|
-
|
|
308
|
+
children_method_names.map { |m| "#{m}: #{m}" }
|
|
287
309
|
|
|
288
310
|
module_eval <<-RUBY, __FILE__, __LINE__
|
|
289
|
-
def
|
|
311
|
+
def initialize(#{arguments.join(", ")})
|
|
312
|
+
@line = line
|
|
313
|
+
@col = col
|
|
314
|
+
@pos = pos
|
|
315
|
+
@filename = filename
|
|
316
|
+
@source = source
|
|
290
317
|
#{assignments.join("\n")}
|
|
291
318
|
end
|
|
292
319
|
|
|
293
|
-
def self.from_a(filename, line, col, #{
|
|
320
|
+
def self.from_a(filename, line, col, #{all_method_names.join(", ")})
|
|
294
321
|
self.new(filename: filename, line: line, col: col, #{keywords.join(", ")})
|
|
295
322
|
end
|
|
323
|
+
|
|
324
|
+
def marshal_dump
|
|
325
|
+
[
|
|
326
|
+
line, col, # use methods here to force them to be calculated
|
|
327
|
+
@filename,
|
|
328
|
+
#{all_method_names.map { |n| "@#{n}," }.join}
|
|
329
|
+
]
|
|
330
|
+
end
|
|
331
|
+
|
|
332
|
+
def marshal_load(values)
|
|
333
|
+
@line, @col, @filename #{all_method_names.map { |n| ", @#{n}"}.join} = values
|
|
334
|
+
end
|
|
296
335
|
RUBY
|
|
297
336
|
end
|
|
298
337
|
end
|
|
@@ -323,7 +362,7 @@ module GraphQL
|
|
|
323
362
|
# @return [String, Float, Integer, Boolean, Array, InputObject, VariableIdentifier] The value passed for this key
|
|
324
363
|
|
|
325
364
|
def children
|
|
326
|
-
@children ||= Array(value).flatten.select { |v| v.is_a?(AbstractNode) }
|
|
365
|
+
@children ||= Array(value).flatten.tap { _1.select! { |v| v.is_a?(AbstractNode) } }
|
|
327
366
|
end
|
|
328
367
|
end
|
|
329
368
|
|
|
@@ -336,13 +375,13 @@ module GraphQL
|
|
|
336
375
|
end
|
|
337
376
|
|
|
338
377
|
class DirectiveDefinition < AbstractNode
|
|
339
|
-
include DefinitionNode
|
|
340
378
|
attr_reader :description
|
|
341
379
|
scalar_methods :name, :repeatable
|
|
342
380
|
children_methods(
|
|
343
381
|
arguments: Nodes::Argument,
|
|
344
382
|
locations: Nodes::DirectiveLocation,
|
|
345
383
|
)
|
|
384
|
+
self.children_method_name = :definitions
|
|
346
385
|
end
|
|
347
386
|
|
|
348
387
|
# An enum value. The string is available as {#name}.
|
|
@@ -355,6 +394,32 @@ module GraphQL
|
|
|
355
394
|
|
|
356
395
|
# A single selection in a GraphQL query.
|
|
357
396
|
class Field < AbstractNode
|
|
397
|
+
def initialize(name: nil, arguments: NONE, directives: NONE, selections: NONE, field_alias: nil, line: nil, col: nil, pos: nil, filename: nil, source: nil)
|
|
398
|
+
@name = name
|
|
399
|
+
@arguments = arguments || NONE
|
|
400
|
+
@directives = directives || NONE
|
|
401
|
+
@selections = selections || NONE
|
|
402
|
+
# oops, alias is a keyword:
|
|
403
|
+
@alias = field_alias
|
|
404
|
+
@line = line
|
|
405
|
+
@col = col
|
|
406
|
+
@pos = pos
|
|
407
|
+
@filename = filename
|
|
408
|
+
@source = source
|
|
409
|
+
end
|
|
410
|
+
|
|
411
|
+
def self.from_a(filename, line, col, field_alias, name, arguments, directives, selections) # rubocop:disable Metrics/ParameterLists
|
|
412
|
+
self.new(filename: filename, line: line, col: col, field_alias: field_alias, name: name, arguments: arguments, directives: directives, selections: selections)
|
|
413
|
+
end
|
|
414
|
+
|
|
415
|
+
def marshal_dump
|
|
416
|
+
[line, col, @filename, @name, @arguments, @directives, @selections, @alias]
|
|
417
|
+
end
|
|
418
|
+
|
|
419
|
+
def marshal_load(values)
|
|
420
|
+
@line, @col, @filename, @name, @arguments, @directives, @selections, @alias = values
|
|
421
|
+
end
|
|
422
|
+
|
|
358
423
|
scalar_methods :name, :alias
|
|
359
424
|
children_methods({
|
|
360
425
|
arguments: GraphQL::Language::Nodes::Argument,
|
|
@@ -362,44 +427,36 @@ module GraphQL
|
|
|
362
427
|
directives: GraphQL::Language::Nodes::Directive,
|
|
363
428
|
})
|
|
364
429
|
|
|
365
|
-
# @!attribute selections
|
|
366
|
-
# @return [Array<Nodes::Field>] Selections on this object (or empty array if this is a scalar field)
|
|
367
|
-
|
|
368
|
-
def initialize_node(attributes)
|
|
369
|
-
@name = attributes[:name]
|
|
370
|
-
@arguments = attributes[:arguments] || NONE
|
|
371
|
-
@directives = attributes[:directives] || NONE
|
|
372
|
-
@selections = attributes[:selections] || NONE
|
|
373
|
-
# oops, alias is a keyword:
|
|
374
|
-
@alias = attributes[:alias]
|
|
375
|
-
end
|
|
376
|
-
|
|
377
|
-
def self.from_a(filename, line, col, graphql_alias, name, arguments, directives, selections) # rubocop:disable Metrics/ParameterLists
|
|
378
|
-
self.new(filename: filename, line: line, col: col, alias: graphql_alias, name: name, arguments: arguments, directives: directives, selections: selections)
|
|
379
|
-
end
|
|
380
|
-
|
|
381
430
|
# Override this because default is `:fields`
|
|
382
431
|
self.children_method_name = :selections
|
|
383
432
|
end
|
|
384
433
|
|
|
385
434
|
# A reusable fragment, defined at document-level.
|
|
386
435
|
class FragmentDefinition < AbstractNode
|
|
387
|
-
|
|
388
|
-
# @return [String] the identifier for this fragment, which may be applied with `...#{name}`
|
|
389
|
-
|
|
390
|
-
# @!attribute type
|
|
391
|
-
# @return [String] the type condition for this fragment (name of type which it may apply to)
|
|
392
|
-
def initialize_node(name: nil, type: nil, directives: [], selections: [])
|
|
436
|
+
def initialize(name: nil, type: nil, directives: NONE, selections: NONE, filename: nil, pos: nil, source: nil, line: nil, col: nil)
|
|
393
437
|
@name = name
|
|
394
438
|
@type = type
|
|
395
439
|
@directives = directives
|
|
396
440
|
@selections = selections
|
|
441
|
+
@filename = filename
|
|
442
|
+
@pos = pos
|
|
443
|
+
@source = source
|
|
444
|
+
@line = line
|
|
445
|
+
@col = col
|
|
397
446
|
end
|
|
398
447
|
|
|
399
448
|
def self.from_a(filename, line, col, name, type, directives, selections)
|
|
400
449
|
self.new(filename: filename, line: line, col: col, name: name, type: type, directives: directives, selections: selections)
|
|
401
450
|
end
|
|
402
451
|
|
|
452
|
+
def marshal_dump
|
|
453
|
+
[line, col, @filename, @name, @type, @directives, @selections]
|
|
454
|
+
end
|
|
455
|
+
|
|
456
|
+
def marshal_load(values)
|
|
457
|
+
@line, @col, @filename, @name, @type, @directives, @selections = values
|
|
458
|
+
end
|
|
459
|
+
|
|
403
460
|
scalar_methods :name, :type
|
|
404
461
|
children_methods({
|
|
405
462
|
selections: GraphQL::Language::Nodes::Field,
|
|
@@ -484,7 +541,7 @@ module GraphQL
|
|
|
484
541
|
# An operation-level query variable
|
|
485
542
|
class VariableDefinition < AbstractNode
|
|
486
543
|
scalar_methods :name, :type, :default_value
|
|
487
|
-
children_methods
|
|
544
|
+
children_methods(directives: Directive)
|
|
488
545
|
# @!attribute default_value
|
|
489
546
|
# @return [String, Integer, Float, Boolean, Array, NullValue] A Ruby value to use if no other value is provided
|
|
490
547
|
|
|
@@ -535,7 +592,7 @@ module GraphQL
|
|
|
535
592
|
# @example Creating a custom string from a document
|
|
536
593
|
# class VariableScrubber < GraphQL::Language::Printer
|
|
537
594
|
# def print_argument(arg)
|
|
538
|
-
# "#{arg.name}: <HIDDEN>"
|
|
595
|
+
# print_string("#{arg.name}: <HIDDEN>")
|
|
539
596
|
# end
|
|
540
597
|
# end
|
|
541
598
|
#
|
|
@@ -562,7 +619,6 @@ module GraphQL
|
|
|
562
619
|
end
|
|
563
620
|
|
|
564
621
|
class SchemaDefinition < AbstractNode
|
|
565
|
-
include DefinitionNode
|
|
566
622
|
scalar_methods :query, :mutation, :subscription
|
|
567
623
|
children_methods({
|
|
568
624
|
directives: GraphQL::Language::Nodes::Directive,
|
|
@@ -579,7 +635,6 @@ module GraphQL
|
|
|
579
635
|
end
|
|
580
636
|
|
|
581
637
|
class ScalarTypeDefinition < AbstractNode
|
|
582
|
-
include DefinitionNode
|
|
583
638
|
attr_reader :description
|
|
584
639
|
scalar_methods :name
|
|
585
640
|
children_methods({
|
|
@@ -597,7 +652,6 @@ module GraphQL
|
|
|
597
652
|
end
|
|
598
653
|
|
|
599
654
|
class InputValueDefinition < AbstractNode
|
|
600
|
-
include DefinitionNode
|
|
601
655
|
attr_reader :description
|
|
602
656
|
scalar_methods :name, :type, :default_value
|
|
603
657
|
children_methods({
|
|
@@ -607,7 +661,6 @@ module GraphQL
|
|
|
607
661
|
end
|
|
608
662
|
|
|
609
663
|
class FieldDefinition < AbstractNode
|
|
610
|
-
include DefinitionNode
|
|
611
664
|
attr_reader :description
|
|
612
665
|
scalar_methods :name, :type
|
|
613
666
|
children_methods({
|
|
@@ -628,7 +681,6 @@ module GraphQL
|
|
|
628
681
|
end
|
|
629
682
|
|
|
630
683
|
class ObjectTypeDefinition < AbstractNode
|
|
631
|
-
include DefinitionNode
|
|
632
684
|
attr_reader :description
|
|
633
685
|
scalar_methods :name, :interfaces
|
|
634
686
|
children_methods({
|
|
@@ -648,7 +700,6 @@ module GraphQL
|
|
|
648
700
|
end
|
|
649
701
|
|
|
650
702
|
class InterfaceTypeDefinition < AbstractNode
|
|
651
|
-
include DefinitionNode
|
|
652
703
|
attr_reader :description
|
|
653
704
|
scalar_methods :name
|
|
654
705
|
children_methods({
|
|
@@ -670,7 +721,6 @@ module GraphQL
|
|
|
670
721
|
end
|
|
671
722
|
|
|
672
723
|
class UnionTypeDefinition < AbstractNode
|
|
673
|
-
include DefinitionNode
|
|
674
724
|
attr_reader :description, :types
|
|
675
725
|
scalar_methods :name
|
|
676
726
|
children_methods({
|
|
@@ -689,7 +739,6 @@ module GraphQL
|
|
|
689
739
|
end
|
|
690
740
|
|
|
691
741
|
class EnumValueDefinition < AbstractNode
|
|
692
|
-
include DefinitionNode
|
|
693
742
|
attr_reader :description
|
|
694
743
|
scalar_methods :name
|
|
695
744
|
children_methods({
|
|
@@ -699,7 +748,6 @@ module GraphQL
|
|
|
699
748
|
end
|
|
700
749
|
|
|
701
750
|
class EnumTypeDefinition < AbstractNode
|
|
702
|
-
include DefinitionNode
|
|
703
751
|
attr_reader :description
|
|
704
752
|
scalar_methods :name
|
|
705
753
|
children_methods({
|
|
@@ -719,7 +767,6 @@ module GraphQL
|
|
|
719
767
|
end
|
|
720
768
|
|
|
721
769
|
class InputObjectTypeDefinition < AbstractNode
|
|
722
|
-
include DefinitionNode
|
|
723
770
|
attr_reader :description
|
|
724
771
|
scalar_methods :name
|
|
725
772
|
children_methods({
|