class GraphQL::Language::Nodes::Argument
A key-value pair for a field’s inputs
Attributes
value
[R]
untyped
Returns
-
String, Float, Integer, Boolean, Array, InputObject, VariableIdentifier, Enum, NullValue— The value passed for this key
Public Class Methods
# File lib/graphql/language/nodes.rb, line 347 def self.from_a(filename, line, col, name, value, comment: nil) self.new(filename: filename, line: line, col: col, name: name, value: value) end
(?name: untyped, ?value: untyped, ?line: Integer?, ?col: Integer?, ?pos: Integer?, ?filename: String?, ?source: untyped) → void
Source
# File lib/graphql/language/nodes.rb, line 337 def initialize(name: nil, value: nil, line: nil, col: nil, pos: nil, filename: nil, source: nil) @line = line @col = col @pos = pos @filename = filename @source = source @name = name @value = value end
Public Instance Methods
Source
# File lib/graphql/language/nodes.rb, line 366 def children @children ||= Array(value).flatten.tap { _1.select! { |v| v.is_a?(AbstractNode) } } end
Source
# File lib/graphql/language/nodes.rb, line 351 def marshal_dump [ line, col, # use methods here to force them to be calculated @filename, @name, @value, ] end
Source
# File lib/graphql/language/nodes.rb, line 360 def marshal_load(values) @line, @col, @filename, @name, @value = values end
Source
# File lib/graphql/language/nodes.rb, line 332 def scalars @scalars ||= [@name, @value].freeze end
Source
# File lib/graphql/language/nodes.rb, line 316 def visit_method :on_argument end