Class: GraphQL::Language::Nodes::InputObject

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

Overview

A collection of key-value inputs which may be a field argument

Constant Summary

Constants inherited from AbstractNode

AbstractNode::NO_CHILDREN

Instance Attribute Summary collapse

Attributes inherited from AbstractNode

#col, #filename, #line

Instance Method Summary collapse

Methods inherited from AbstractNode

#children, #delete_child, #eql?, inherited, #initialize, #initialize_copy, #merge, #position, #replace_child, #scalars, #to_query_string, #visit_method

Constructor Details

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

Instance Attribute Details

#argumentsArray<Nodes::Argument>

Returns A list of key-value pairs inside this input object

Returns:

  • (Array<Nodes::Argument>)

    A list of key-value pairs inside this input object



# File 'lib/graphql/language/nodes.rb', line 427

Instance Method Details

#children_method_nameObject



439
440
441
# File 'lib/graphql/language/nodes.rb', line 439

def children_method_name
  :value
end

#to_h(options = {}) ⇒ Hash<String, Any>

Returns Recursively turn this input object into a Ruby Hash

Returns:

  • (Hash<String, Any>)

    Recursively turn this input object into a Ruby Hash



431
432
433
434
435
436
437
# File 'lib/graphql/language/nodes.rb', line 431

def to_h(options={})
  arguments.inject({}) do |memo, pair|
    v = pair.value
    memo[pair.name] = serialize_value_for_hash v
    memo
  end
end