Help us shape the future of Go! Take the 2026 Go Developer Survey

graph

package
v2.0.30 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2023 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FreeNode

func FreeNode(n *Node)

Types

type Arg

type Arg struct {
	Name string
	Val  *Node
}

type Directive

type Directive struct {
	Name string
	Args []Arg
}

type FPInfo

type FPInfo struct {
	Operation string
	Name      string
}

func FastParse

func FastParse(gql string) (h FPInfo, err error)

func FastParseBytes added in v2.0.19

func FastParseBytes(gql []byte) (h FPInfo, err error)

type Field

type Field struct {
	ID       int32
	ParentID int32
	Type     FieldType
	Name     string
	Alias    string
	Args     []Arg

	Directives []Directive
	Children   []int32
	// contains filtered or unexported fields
}

type FieldType

type FieldType int8
const (
	FieldUnion FieldType = iota + 1
	FieldMember
	FieldKeyword
)

func (FieldType) String

func (i FieldType) String() string

type Fragment

type Fragment struct {
	Name   string
	On     string
	Fields []Field
	Value  []byte
}

type MType

type MType int8

MType identifies the type of lex items.

func (MType) String

func (i MType) String() string

type Node

type Node struct {
	Type     ParserType
	Name     string
	Val      string
	Parent   *Node
	Children []*Node
	CMap     map[string]*Node
}

func ParseArgValue

func ParseArgValue(argVal string, json bool) (*Node, error)

func (*Node) Free

func (n *Node) Free()

func (*Node) Reset

func (n *Node) Reset()

type Operation

type Operation struct {
	Type   ParserType
	Name   string
	VarDef []VarDef
	Args   []Arg

	Directives []Directive
	Fields     []Field

	Query []byte
	Frags []Fragment
	// contains filtered or unexported fields
}

func Parse

func Parse(gql []byte) (op Operation, err error)

type Parser

type Parser struct {
	// contains filtered or unexported fields
}

type ParserType

type ParserType int8
const (
	OpQuery ParserType
	OpMutate
	OpSub
	NodeStr
	NodeNum
	NodeBool
	NodeObj
	NodeList
	NodeVar
	NodeLabel
)

func (ParserType) String

func (i ParserType) String() string

type Pos

type Pos int

Pos represents a byte position in the original input text from which this template was parsed.

type Schema added in v2.0.19

type Schema struct {
	Type    string
	Version string
	Schema  string
	Types   []Type
}

func ParseSchema added in v2.0.19

func ParseSchema(schema []byte) (s Schema, err error)

type Stack

type Stack struct {
	// contains filtered or unexported fields
}

func NewStack

func NewStack() *Stack

Create a new Stack

func (*Stack) Len

func (s *Stack) Len() int

Return the number of items in the Stack

func (*Stack) Peek

func (s *Stack) Peek() int32

View the top item on the Stack

func (*Stack) Pop

func (s *Stack) Pop() int32

Pop the top item of the Stack and return it

func (*Stack) Push

func (s *Stack) Push(value int32)

Push a value onto the top of the Stack

type TField added in v2.0.19

type TField struct {
	Name       string
	Type       string
	Required   bool
	List       bool
	Directives []Directive
}

type Type added in v2.0.19

type Type struct {
	Name       string
	Directives []Directive
	Fields     []TField
}

type VarDef added in v2.0.27

type VarDef struct {
	Name string
	Val  *Node
}

Jump to

Keyboard shortcuts

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