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
Class Method Summary collapse
-
.from_a(filename, line, col, graphql_alias, name, arguments, directives, selections) ⇒ Object
rubocop:disable Metrics/ParameterLists.
Instance Method Summary collapse
Methods inherited from AbstractNode
#==, #children, #children_method_name, children_of_type, #delete_child, inherited, #initialize, #initialize_copy, #merge, #position, #replace_child, #scalars, #to_query_string
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).
368 369 370 371 372 373 374 375 |
# File 'lib/graphql/language/nodes.rb', line 368 def initialize_node(attributes) @name = attributes[:name] @arguments = attributes[:arguments] || NONE @directives = attributes[:directives] || NONE @selections = attributes[:selections] || NONE # oops, alias is a keyword: @alias = attributes[:alias] end |
Class Method Details
.from_a(filename, line, col, graphql_alias, name, arguments, directives, selections) ⇒ Object
rubocop:disable Metrics/ParameterLists
377 378 379 |
# File 'lib/graphql/language/nodes.rb', line 377 def self.from_a(filename, line, col, graphql_alias, name, arguments, directives, selections) # rubocop:disable Metrics/ParameterLists self.new(filename: filename, line: line, col: col, alias: graphql_alias, name: name, arguments: arguments, directives: directives, selections: selections) end |
Instance Method Details
#initialize_node(attributes) ⇒ Object
368 369 370 371 372 373 374 375 |
# File 'lib/graphql/language/nodes.rb', line 368 def initialize_node(attributes) @name = attributes[:name] @arguments = attributes[:arguments] || NONE @directives = attributes[:directives] || NONE @selections = attributes[:selections] || NONE # oops, alias is a keyword: @alias = attributes[:alias] end |