Class: GraphQL::Language::Nodes::Argument
- Inherits:
-
AbstractNode
- Object
- AbstractNode
- GraphQL::Language::Nodes::Argument
- Defined in:
- lib/graphql/language/nodes.rb
Overview
A key-value pair for a field’s inputs
Instance Attribute Summary collapse
-
#name ⇒ String
The key for this argument.
-
#value ⇒ String, ...
The value passed for this key.
Attributes inherited from AbstractNode
Instance Method Summary collapse
Methods inherited from AbstractNode
#eql?, #initialize, #position, #to_query_string
Constructor Details
This class inherits a constructor from GraphQL::Language::Nodes::AbstractNode
Instance Attribute Details
#name ⇒ String
Returns the key for this argument
98 99 100 |
# File 'lib/graphql/language/nodes.rb', line 98 def name @name end |
#value ⇒ String, ...
Returns The value passed for this key
104 105 106 |
# File 'lib/graphql/language/nodes.rb', line 104 def value @value end |
Instance Method Details
#children ⇒ Object
113 114 115 |
# File 'lib/graphql/language/nodes.rb', line 113 def children [value].flatten.select { |v| v.is_a?(AbstractNode) } end |
#initialize_node(name: nil, value: nil) ⇒ Object
104 105 106 107 |
# File 'lib/graphql/language/nodes.rb', line 104 def initialize_node(name: nil, value: nil) @name = name @value = value end |
#scalars ⇒ Object
109 110 111 |
# File 'lib/graphql/language/nodes.rb', line 109 def scalars [name, value] end |