class GraphQL::Language::Nodes::AbstractNode

def children

Returns:
  • (Array) - all nodes in the tree below this one
def children
  []
end

def eql?(other)

Returns:
  • (Boolean) - True if `self` is equivalent to `other`
def eql?(other)
  return true if equal?(other)
  other.is_a?(self.class) &&
    other.scalars.eql?(self.scalars) &&
    other.children.eql?(self.children)
end

def initialize(options={})

Parameters:
  • options (Hash) -- Initial attributes for this node
def initialize(options={})
  if options.key?(:position_source)
    position_source = options.delete(:position_source)
    @line, @col = position_source.line_and_column
  end
  @filename = options.delete(:filename)
  initialize_node(options)
end

def initialize_node(options={})

This is called with node-specific options
def initialize_node(options={})
  raise NotImplementedError
end

def position

def position
  [line, col]
end

def scalars

Returns:
  • (Array) - Scalar values attached to this node
def scalars
  []
end

def to_query_string(printer: GraphQL::Language::Printer.new)

def to_query_string(printer: GraphQL::Language::Printer.new)
  printer.print(self)
end