Class: GraphQL::Language::Nodes::InputObject
- Inherits:
-
AbstractNode
- Object
- AbstractNode
- GraphQL::Language::Nodes::InputObject
- Defined in:
- lib/graphql/language/nodes.rb
Overview
A collection of key-value inputs which may be a field argument
Instance Attribute Summary collapse
-
#arguments ⇒ Array<Nodes::Argument>
(also: #children)
A list of key-value pairs inside this input object.
Attributes inherited from AbstractNode
Instance Method Summary collapse
-
#initialize_node(arguments: []) ⇒ Object
-
#to_h(options = {}) ⇒ Hash<String, Any>
Recursively turn this input object into a Ruby Hash.
Methods inherited from AbstractNode
#eql?, #initialize, #position, #scalars, #to_query_string
Constructor Details
This class inherits a constructor from GraphQL::Language::Nodes::AbstractNode
Instance Attribute Details
#arguments ⇒ Array<Nodes::Argument> Also known as: children
Returns A list of key-value pairs inside this input object
282 283 284 |
# File 'lib/graphql/language/nodes.rb', line 282 def arguments @arguments end |
Instance Method Details
#initialize_node(arguments: []) ⇒ Object
282 283 284 |
# File 'lib/graphql/language/nodes.rb', line 282 def initialize_node(arguments: []) @arguments = arguments end |
#to_h(options = {}) ⇒ Hash<String, Any>
Returns Recursively turn this input object into a Ruby Hash
287 288 289 290 291 292 293 |
# File 'lib/graphql/language/nodes.rb', line 287 def to_h(={}) arguments.inject({}) do |memo, pair| v = pair.value memo[pair.name] = serialize_value_for_hash v memo end end |