class GraphQL::Language::Field

Overview

A single selection in a A single selection in a GraphQL query.

Defined in:

graphql/language/nodes.cr

Constant Summary

VALUES = [{name, String}, {_alias, ::Union(String, ::Nil)}, {arguments, Array(Argument)}, {directives, Array(Directive)}, {selections, Array(Selection)}] of Tuple(Symbol, Object.class)

A single selection in a A single selection in a GraphQL query.

VISITS = [{:children, [:arguments, :directives, :selections]}] of Tuple(Symbol, Array(Symbol))

A single selection in a A single selection in a GraphQL query.

Constructors

Class Method Summary

Instance Method Summary

Macro Summary

Instance methods inherited from class GraphQL::Language::ASTNode

==(other) ==, clone clone, values values

Class methods inherited from class GraphQL::Language::ASTNode

values values

Constructor Detail

def self.new(name, _alias, arguments, directives, selections, **rest) #

Class Method Detail

def self.values #

Instance Method Detail

def ==(other : GraphQL::Language::Field) #

def _alias : Union(String, Nil) #

def _alias=(_alias : Union(String, Nil)) #

def arguments : Array(Argument) #

def arguments=(arguments : Array(Argument)) #

def clone #

Returns a copy of self with all instance variables cloned.


def directives : Array(Directive) #

def directives=(directives : Array(Directive)) #

def map_children(&block : ASTNode -> _) #

def name : String #

def name=(name : String) #

def selections : Array(Selection) #

def selections=(selections : Array(Selection)) #

def values #

def visit(name, visited_ids = [] of UInt64, block = Proc(ASTNode, ASTNode | ::Nil).new do end) #

Recursively apply the given block to each node that gets visited with the given key which nodes get traverses for a given key can be set on a class via the: traverse :name, :child_1, :child2 macro. If no children are defined for a given traversal path name the block is invoked only with self.ode that gets visited with the given key which nodes get traverses for a given key can be set on a class via the: traverse :name, :child_1, :child2 macro. If no children are defined for a given traversal path name the block is invoked only with self.


Macro Detail

macro accessors(name, type, default) #

macro traverse(name, *values) #

macro values(args) #