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

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

Instance Attribute Summary collapse

Attributes inherited from AbstractNode

#col, #line

Instance Method Summary collapse

Methods inherited from AbstractNode

child_attributes, #children, #initialize, #position, #to_query_string

Constructor Details

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

Instance Attribute Details

#argumentsObject

Returns the value of attribute arguments.



156
157
158
# File 'lib/graphql/language/nodes.rb', line 156

def arguments
  @arguments
end

Instance Method Details

#initialize_node(arguments: []) ⇒ Object



159
160
161
# File 'lib/graphql/language/nodes.rb', line 159

def initialize_node(arguments: [])
  @arguments = arguments
end

#to_h(options = {}) ⇒ Object



163
164
165
166
167
168
169
# File 'lib/graphql/language/nodes.rb', line 163

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