class GraphQL::Language::Nodes::Field

A single selection in a GraphQL query.

Attributes

alias[RW]
arguments[RW]
directives[RW]
name[RW]
selections[RW]

Public Instance Methods

children() click to toggle source
# File lib/graphql/language/nodes.rb, line 207
def children
  arguments + directives + selections
end
initialize_node(name: nil, arguments: [], directives: [], selections: [], **kwargs) click to toggle source

@!attribute selections

@return [Array<Nodes::Field>] Selections on this object (or empty array if this is a scalar field)
# File lib/graphql/language/nodes.rb, line 194
def initialize_node(name: nil, arguments: [], directives: [], selections: [], **kwargs)
  @name = name
  # oops, alias is a keyword:
  @alias = kwargs.fetch(:alias, nil)
  @arguments = arguments
  @directives = directives
  @selections = selections
end
scalars() click to toggle source
# File lib/graphql/language/nodes.rb, line 203
def scalars
  [name, self.alias]
end