Class: GraphQL::Language::Nodes::Field

Inherits:
AbstractNode show all
Defined in:
lib/graphql/language/nodes.rb

Overview

A single selection in a GraphQL query.

Instance Attribute Summary collapse

Attributes inherited from AbstractNode

#col, #line

Instance Method Summary collapse

Methods inherited from AbstractNode

child_attributes, #children, #eql?, inherited, #initialize, #position, scalar_attributes, #scalars, #to_query_string

Constructor Details

This class inherits a constructor from GraphQL::Language::Nodes::AbstractNode

Instance Attribute Details

#aliasObject

Returns the value of attribute alias


184
185
186
# File 'lib/graphql/language/nodes.rb', line 184

def alias
  @alias
end

#argumentsObject

Returns the value of attribute arguments


184
185
186
# File 'lib/graphql/language/nodes.rb', line 184

def arguments
  @arguments
end

#directivesObject

Returns the value of attribute directives


184
185
186
# File 'lib/graphql/language/nodes.rb', line 184

def directives
  @directives
end

#nameObject

Returns the value of attribute name


184
185
186
# File 'lib/graphql/language/nodes.rb', line 184

def name
  @name
end

#selectionsArray<Nodes::Field>


191
192
193
# File 'lib/graphql/language/nodes.rb', line 191

def selections
  @selections
end

Instance Method Details

#initialize_node(name: nil, arguments: [], directives: [], selections: [], **kwargs) ⇒ Object


191
192
193
194
195
196
197
198
# File 'lib/graphql/language/nodes.rb', line 191

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