Class: GraphQL::Language::Nodes::Field
- Inherits:
-
AbstractNode
- Object
- AbstractNode
- GraphQL::Language::Nodes::Field
- Defined in:
- lib/graphql/language/nodes.rb
Overview
A single selection in a GraphQL query.
Constant Summary
Constants inherited from AbstractNode
Instance Attribute Summary collapse
-
#selections ⇒ Array<Nodes::Field>
Selections on this object (or empty array if this is a scalar field).
Attributes inherited from AbstractNode
Instance Method Summary collapse
-
#children_method_name ⇒ Object
Override this because default is
:fields
. -
#initialize_node(name: nil, arguments: [], directives: [], selections: [], **kwargs) ⇒ Object
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
#selections ⇒ Array<Nodes::Field>
Returns Selections on this object (or empty array if this is a scalar field)
363 364 365 366 367 368 369 370 |
# File 'lib/graphql/language/nodes.rb', line 363 def initialize_node(name: nil, arguments: [], directives: [], selections: [], **kwargs) @name = name @arguments = arguments @directives = directives @selections = selections # oops, alias is a keyword: @alias = kwargs.fetch(:alias, nil) end |
Instance Method Details
#children_method_name ⇒ Object
Override this because default is :fields
373 374 375 |
# File 'lib/graphql/language/nodes.rb', line 373 def children_method_name :selections end |
#initialize_node(name: nil, arguments: [], directives: [], selections: [], **kwargs) ⇒ Object
363 364 365 366 367 368 369 370 |
# File 'lib/graphql/language/nodes.rb', line 363 def initialize_node(name: nil, arguments: [], directives: [], selections: [], **kwargs) @name = name @arguments = arguments @directives = directives @selections = selections # oops, alias is a keyword: @alias = kwargs.fetch(:alias, nil) end |