Class: GraphQL::Language::Nodes::VariableDefinition

Inherits:
AbstractNode
  • Object
show all
Defined in:
lib/graphql/language/nodes.rb

Overview

An operation-level query variable

Instance Attribute Summary collapse

Attributes inherited from AbstractNode

#col, #filename, #line

Instance Method Summary collapse

Methods inherited from AbstractNode

#children, #eql?, #initialize, #position, #to_query_string

Constructor Details

This class inherits a constructor from GraphQL::Language::Nodes::AbstractNode

Instance Attribute Details

#default_valueString, ...

Returns A Ruby value to use if no other value is provided

Returns:

  • (String, Integer, Float, Boolean, Array, NullValue)

    A Ruby value to use if no other value is provided



364
365
366
# File 'lib/graphql/language/nodes.rb', line 364

def default_value
  @default_value
end

#nameString

Returns The identifier for this variable, without $

Returns:

  • (String)

    The identifier for this variable, without $



373
374
375
# File 'lib/graphql/language/nodes.rb', line 373

def name
  @name
end

#typeTypeName, ...

Returns The expected type of this value

Returns:



367
368
369
# File 'lib/graphql/language/nodes.rb', line 367

def type
  @type
end

Instance Method Details

#initialize_node(name: nil, type: nil, default_value: nil) ⇒ Object



373
374
375
376
377
# File 'lib/graphql/language/nodes.rb', line 373

def initialize_node(name: nil, type: nil, default_value: nil)
  @name = name
  @type = type
  @default_value = default_value
end

#scalarsObject



379
380
381
# File 'lib/graphql/language/nodes.rb', line 379

def scalars
  [name, type, default_value]
end