ast

package
Version: v0.0.0-...-f795d1e Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 29, 2021 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Inspect

func Inspect(node Node, f func(Node) bool)

Inspect traverses the given AST, invoking f for each node. If f returns true, Inspect will recursively inspect the nodes referenced by the given node.

func IsNullValue

func IsNullValue(v Value) bool

Types

type Argument

type Argument struct {
	Name  *Name
	Value Value
}

func (*Argument) Position

func (n *Argument) Position() token.Position

type BooleanValue

type BooleanValue struct {
	Value   bool
	Literal token.Position
}

func (*BooleanValue) IsValue

func (*BooleanValue) IsValue() bool

func (*BooleanValue) Position

func (n *BooleanValue) Position() token.Position

type Definition

type Definition interface {
	Node
}

OperationDefinition or FragmentDefinition

type Directive

type Directive struct {
	Name      *Name
	Arguments []*Argument
	At        token.Position
}

func (*Directive) Position

func (n *Directive) Position() token.Position

type Document

type Document struct {
	Definitions []Definition
}

func (*Document) Position

func (*Document) Position() token.Position

type EnumValue

type EnumValue struct {
	Value   string
	Literal token.Position
}

func (*EnumValue) IsValue

func (*EnumValue) IsValue() bool

func (*EnumValue) Position

func (n *EnumValue) Position() token.Position

type Field

type Field struct {
	Alias        *Name
	Name         *Name
	Arguments    []*Argument
	Directives   []*Directive
	SelectionSet *SelectionSet
}

func (*Field) Position

func (n *Field) Position() token.Position

func (*Field) SelectionDirectives

func (s *Field) SelectionDirectives() []*Directive

type FloatValue

type FloatValue struct {
	Value   string
	Literal token.Position
}

func (*FloatValue) IsValue

func (*FloatValue) IsValue() bool

func (*FloatValue) Position

func (n *FloatValue) Position() token.Position

type FragmentDefinition

type FragmentDefinition struct {
	Fragment      token.Position
	Name          *Name
	TypeCondition *NamedType
	Directives    []*Directive
	SelectionSet  *SelectionSet
}

func (*FragmentDefinition) Position

func (n *FragmentDefinition) Position() token.Position

type FragmentSpread

type FragmentSpread struct {
	FragmentName *Name
	Directives   []*Directive
	Ellipsis     token.Position
}

func (*FragmentSpread) Position

func (n *FragmentSpread) Position() token.Position

func (*FragmentSpread) SelectionDirectives

func (s *FragmentSpread) SelectionDirectives() []*Directive

type InlineFragment

type InlineFragment struct {
	TypeCondition *NamedType
	Directives    []*Directive
	SelectionSet  *SelectionSet
	Ellipsis      token.Position
}

func (*InlineFragment) Position

func (n *InlineFragment) Position() token.Position

func (*InlineFragment) SelectionDirectives

func (s *InlineFragment) SelectionDirectives() []*Directive

type IntValue

type IntValue struct {
	Value   string
	Literal token.Position
}

func (*IntValue) IsValue

func (*IntValue) IsValue() bool

func (*IntValue) Position

func (n *IntValue) Position() token.Position

type ListType

type ListType struct {
	Type    Type
	Opening token.Position
	Closing token.Position
}

func (*ListType) Position

func (n *ListType) Position() token.Position

type ListValue

type ListValue struct {
	Values  []Value
	Opening token.Position
	Closing token.Position
}

func (*ListValue) IsValue

func (*ListValue) IsValue() bool

func (*ListValue) Position

func (n *ListValue) Position() token.Position

type Name

type Name struct {
	Name         string
	NamePosition token.Position
}

func (*Name) Position

func (n *Name) Position() token.Position

type NamedType

type NamedType struct {
	Name *Name
}

func (*NamedType) Position

func (n *NamedType) Position() token.Position

type Node

type Node interface {
	Position() token.Position
}

type NonNullType

type NonNullType struct {
	Type Type
}

func (*NonNullType) Position

func (n *NonNullType) Position() token.Position

type NullValue

type NullValue struct {
	Literal token.Position
}

func (*NullValue) IsValue

func (*NullValue) IsValue() bool

func (*NullValue) Position

func (n *NullValue) Position() token.Position

type ObjectField

type ObjectField struct {
	Name  *Name
	Value Value
}

func (*ObjectField) Position

func (n *ObjectField) Position() token.Position

type ObjectValue

type ObjectValue struct {
	Fields  []*ObjectField
	Opening token.Position
	Closing token.Position
}

func (*ObjectValue) IsValue

func (*ObjectValue) IsValue() bool

func (*ObjectValue) Position

func (n *ObjectValue) Position() token.Position

type OperationDefinition

type OperationDefinition struct {
	OperationType       *OperationType
	Name                *Name
	VariableDefinitions []*VariableDefinition
	Directives          []*Directive
	SelectionSet        *SelectionSet
}

func (*OperationDefinition) Position

func (n *OperationDefinition) Position() token.Position

type OperationType

type OperationType struct {
	Value         string
	ValuePosition token.Position
}

func (*OperationType) Position

func (n *OperationType) Position() token.Position

type Selection

type Selection interface {
	Node
	SelectionDirectives() []*Directive
}

Field, FragmentSpread, or InlineFragment

type SelectionSet

type SelectionSet struct {
	Selections []Selection
	Opening    token.Position
	Closing    token.Position
}

func (*SelectionSet) Position

func (n *SelectionSet) Position() token.Position

type StringValue

type StringValue struct {
	// Value is the actual, unquoted value.
	Value string

	Literal token.Position
}

func (*StringValue) IsValue

func (*StringValue) IsValue() bool

func (*StringValue) Position

func (n *StringValue) Position() token.Position

type Type

type Type interface {
	Node
}

NamedType, ListType, or NonNullType

type Value

type Value interface {
	Node
	IsValue() bool
}

Variable, IntValue, FloatValue, StringValue, BooleanValue, NullValue, EnumValue, ListValue, or ObjectValue

type Variable

type Variable struct {
	Name   *Name
	Dollar token.Position
}

func (*Variable) IsValue

func (*Variable) IsValue() bool

func (*Variable) Position

func (n *Variable) Position() token.Position

type VariableDefinition

type VariableDefinition struct {
	Variable     *Variable
	Type         Type
	DefaultValue Value
}

func (*VariableDefinition) Position

func (n *VariableDefinition) Position() token.Position

Source Files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL