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, field_alias, name, arguments, directives, selections) ⇒ Object
rubocop:disable Metrics/ParameterLists.
Instance Method Summary collapse
-
#initialize(name: nil, arguments: NONE, directives: NONE, selections: NONE, field_alias: nil, line: nil, col: nil, pos: nil, filename: nil, source: nil) ⇒ Field
constructor
A new instance of Field.
Methods inherited from AbstractNode
#==, #children, #children_method_name, children_of_type, #col, #definition_line, #delete_child, inherited, #initialize_copy, #line, #merge, #position, #replace_child, #scalars, #to_query_string
Constructor Details
#initialize(name: nil, arguments: NONE, directives: NONE, selections: NONE, field_alias: nil, line: nil, col: nil, pos: nil, filename: nil, source: nil) ⇒ Field
Returns a new instance of Field.
382 383 384 385 386 387 388 389 390 391 392 393 394 |
# File 'lib/graphql/language/nodes.rb', line 382 def initialize(name: nil, arguments: NONE, directives: NONE, selections: NONE, field_alias: nil, line: nil, col: nil, pos: nil, filename: nil, source: nil) @name = name @arguments = arguments || NONE @directives = directives || NONE @selections = selections || NONE # oops, alias is a keyword: @alias = field_alias @line = line @col = col @pos = pos @filename = filename @source = source end |
Instance Attribute Details
#selections ⇒ Array<Nodes::Field>
Returns Selections on this object (or empty array if this is a scalar field).
382 383 384 385 386 387 388 389 390 391 392 393 394 |
# File 'lib/graphql/language/nodes.rb', line 382 def initialize(name: nil, arguments: NONE, directives: NONE, selections: NONE, field_alias: nil, line: nil, col: nil, pos: nil, filename: nil, source: nil) @name = name @arguments = arguments || NONE @directives = directives || NONE @selections = selections || NONE # oops, alias is a keyword: @alias = field_alias @line = line @col = col @pos = pos @filename = filename @source = source end |
Class Method Details
.from_a(filename, line, col, field_alias, name, arguments, directives, selections) ⇒ Object
rubocop:disable Metrics/ParameterLists
396 397 398 |
# File 'lib/graphql/language/nodes.rb', line 396 def self.from_a(filename, line, col, field_alias, name, arguments, directives, selections) # rubocop:disable Metrics/ParameterLists self.new(filename: filename, line: line, col: col, field_alias: field_alias, name: name, arguments: arguments, directives: directives, selections: selections) end |