schema

package
v0.0.0-...-f420c12 Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2022 License: BSD-2-Clause Imports: 16 Imported by: 3

Documentation

Index

Constants

View Source
const (
	InvalidOperation OperationType = ""
	Query                          = "query"
	Mutation                       = "mutation"
	Subscription                   = "subscription"
)

Variables

This section is empty.

Functions

func FormatterToString

func FormatterToString(s Formatter) string

func StringListGet

func StringListGet(l []string, name string) *string

func StringListSelect

func StringListSelect(l []string, keep func(d string) bool) []string

Types

type Argument

type Argument struct {
	Name    string
	NameLoc Location
	Value   Literal
}

func (Argument) DeepCopy

func (from Argument) DeepCopy() Argument

func (*Argument) WriteTo

func (t *Argument) WriteTo(out io.StringWriter)

type ArgumentList

type ArgumentList []Argument

func ParseArguments

func ParseArguments(l *lexer.Lexer) ArgumentList

func (ArgumentList) DeepCopy

func (from ArgumentList) DeepCopy() (to ArgumentList)

func (ArgumentList) Get

func (l ArgumentList) Get(name string) (Literal, bool)

func (ArgumentList) MustGet

func (l ArgumentList) MustGet(name string) Literal

func (ArgumentList) ScanValue

func (l ArgumentList) ScanValue(vars map[string]interface{}, v interface{}) error

ScanValue stores the values of the argument list in the value pointed to by v. If v is nil or not a pointer, ScanValue returns an error.

func (ArgumentList) Value

func (l ArgumentList) Value(vars map[string]interface{}) map[string]interface{}

func (ArgumentList) WriteTo

func (t ArgumentList) WriteTo(out io.StringWriter)

type BasicLit

type BasicLit struct {
	Type rune
	Text string
	Loc  qerrors.Location
}

func ConsumeLiteral

func ConsumeLiteral(l *lexer.Lexer) *BasicLit

func (*BasicLit) DeepCopy

func (from *BasicLit) DeepCopy() Literal

func (*BasicLit) Evaluate

func (lit *BasicLit) Evaluate(vars map[string]interface{}) interface{}

func (*BasicLit) Location

func (lit *BasicLit) Location() qerrors.Location

func (*BasicLit) String

func (lit *BasicLit) String() string

func (*BasicLit) WriteTo

func (lit *BasicLit) WriteTo(out io.StringWriter)

type Description

type Description = lexer.Description

func NewDescription

func NewDescription(text string) Description

type Directive

type Directive struct {
	Name    string
	NameLoc Location
	Args    ArgumentList
}

func (*Directive) DeepCopy

func (from *Directive) DeepCopy() *Directive

func (*Directive) Sort

func (t *Directive) Sort()

func (*Directive) String

func (s *Directive) String() string

func (*Directive) WriteTo

func (t *Directive) WriteTo(out io.StringWriter)

type DirectiveDecl

type DirectiveDecl struct {
	Name string
	Desc Description
	Locs []string
	Args InputValueList
}

http://facebook.github.io/graphql/draft/#sec-Type-System.Directives

func (*DirectiveDecl) WriteTo

func (t *DirectiveDecl) WriteTo(out io.StringWriter)

type DirectiveList

type DirectiveList []*Directive

func ParseDirectives

func ParseDirectives(l *lexer.Lexer) DirectiveList

func (DirectiveList) AddIfMissing

func (t DirectiveList) AddIfMissing(to *Schema, from *Schema)

func (DirectiveList) DeepCopy

func (from DirectiveList) DeepCopy() (to DirectiveList)

func (DirectiveList) Get

func (l DirectiveList) Get(name string) *Directive

func (DirectiveList) Select

func (l DirectiveList) Select(keep func(d *Directive) bool) DirectiveList

func (DirectiveList) Sort

func (t DirectiveList) Sort()

func (DirectiveList) WriteTo

func (t DirectiveList) WriteTo(out io.StringWriter)

type Enum

type Enum struct {
	Name       string
	Values     EnumValueList // NOTE: the spec refers to this as `EnumValuesDefinition`.
	Desc       Description
	Directives DirectiveList
}

Enum types describe a set of possible values.

Like scalar types, Enum types also represent leaf values in a GraphQL type system.

http://facebook.github.io/graphql/draft/#sec-Enums

func (*Enum) AddIfMissing

func (t *Enum) AddIfMissing(to *Schema, from *Schema)

func (*Enum) Description

func (t *Enum) Description() string

func (*Enum) GetDirectives

func (t *Enum) GetDirectives() DirectiveList

func (*Enum) Kind

func (*Enum) Kind() string

func (*Enum) Sort

func (t *Enum) Sort()

func (*Enum) String

func (t *Enum) String() string

func (*Enum) TypeName

func (t *Enum) TypeName() string

func (*Enum) WriteTo

func (t *Enum) WriteTo(out io.StringWriter)

type EnumValue

type EnumValue struct {
	Name       string
	Directives DirectiveList
	Desc       Description
}

EnumValue types are unique values that may be serialized as a string: the name of the represented value.

http://facebook.github.io/graphql/draft/#EnumValueDefinition

func (*EnumValue) AddIfMissing

func (t *EnumValue) AddIfMissing(to *Schema, from *Schema)

func (*EnumValue) GetDirectives

func (t *EnumValue) GetDirectives() DirectiveList

func (*EnumValue) Kind

func (t *EnumValue) Kind() string

func (*EnumValue) Sort

func (t *EnumValue) Sort()

func (*EnumValue) String

func (t *EnumValue) String() string

func (*EnumValue) WriteTo

func (t *EnumValue) WriteTo(out io.StringWriter)

type EnumValueList

type EnumValueList []*EnumValue

func (EnumValueList) Sort

func (t EnumValueList) Sort()

type Field

type Field struct {
	Name       string         `json:"name"`
	Args       InputValueList `json:"args"` // NOTE: the spec refers to this as `ArgumentsDefinition`.
	Type       Type
	Directives DirectiveList
	Desc       Description `json:"desc"`
	Extension  interface{} `json:"-"`
}

Field is a conceptual function which yields values. http://facebook.github.io/graphql/draft/#FieldDefinition

func (*Field) AddIfMissing

func (t *Field) AddIfMissing(to *Schema, from *Schema)

func (*Field) GetDirectives

func (t *Field) GetDirectives() DirectiveList

func (*Field) Kind

func (*Field) Kind() string

func (*Field) Sort

func (t *Field) Sort()

func (*Field) String

func (t *Field) String() string

func (*Field) WriteTo

func (t *Field) WriteTo(out io.StringWriter)

type FieldList

type FieldList []*Field

FieldsList is a list of an Object's Fields.

http://facebook.github.io/graphql/draft/#FieldsDefinition

func (FieldList) AddIfMissing

func (t FieldList) AddIfMissing(to *Schema, from *Schema)

func (FieldList) Get

func (l FieldList) Get(name string) *Field

Get iterates over the field list, returning a pointer-to-Field when the field name matches the provided `name` argument. Returns nil when no field was found by that name.

func (FieldList) Names

func (l FieldList) Names() []string

Names returns a string slice of the field names in the FieldList.

func (FieldList) Select

func (l FieldList) Select(keep func(d *Field) bool) FieldList

func (FieldList) Sort

func (t FieldList) Sort()

type FieldSchema

type FieldSchema struct {
	Field  *Field
	Parent NamedType
}

type FieldSelection

type FieldSelection struct {
	Alias           string
	AliasLoc        Location
	Name            string
	NameLoc         Location
	Arguments       ArgumentList
	Directives      DirectiveList
	Selections      SelectionList
	SelectionSetLoc qerrors.Location
	Schema          *FieldSchema
	Extension       interface{}
}

func (*FieldSelection) DeepCopy

func (from *FieldSelection) DeepCopy() Selection

func (FieldSelection) GetSelections

func (t FieldSelection) GetSelections(doc *QueryDocument) SelectionList

func (FieldSelection) Location

func (t FieldSelection) Location() qerrors.Location

func (*FieldSelection) SetSelections

func (t *FieldSelection) SetSelections(doc *QueryDocument, v SelectionList)

func (*FieldSelection) WriteTo

func (t *FieldSelection) WriteTo(out io.StringWriter)

type Formatter

type Formatter interface {
	WriteTo(out io.StringWriter)
}

type Fragment

type Fragment struct {
	On         TypeName
	Selections SelectionList
}

type FragmentDecl

type FragmentDecl struct {
	Fragment
	Name       string
	NameLoc    Location
	Directives DirectiveList
	Loc        qerrors.Location
}

func (*FragmentDecl) DeepCopy

func (from *FragmentDecl) DeepCopy() *FragmentDecl

func (*FragmentDecl) WriteTo

func (o *FragmentDecl) WriteTo(out io.StringWriter)

type FragmentList

type FragmentList []*FragmentDecl

func (FragmentList) DeepCopy

func (from FragmentList) DeepCopy() (to FragmentList)

func (FragmentList) Get

func (l FragmentList) Get(name string) *FragmentDecl

type FragmentSpread

type FragmentSpread struct {
	Name       string
	NameLoc    Location
	Directives DirectiveList
	Loc        qerrors.Location
}

func (*FragmentSpread) DeepCopy

func (from *FragmentSpread) DeepCopy() Selection

func (FragmentSpread) GetSelections

func (t FragmentSpread) GetSelections(doc *QueryDocument) SelectionList

func (FragmentSpread) Location

func (t FragmentSpread) Location() qerrors.Location

func (*FragmentSpread) SetSelections

func (t *FragmentSpread) SetSelections(doc *QueryDocument, v SelectionList)

func (*FragmentSpread) WriteTo

func (t *FragmentSpread) WriteTo(out io.StringWriter)

type HasDirectives

type HasDirectives interface {
	Type
	GetDirectives() DirectiveList
}

type InlineFragment

type InlineFragment struct {
	Fragment
	Directives DirectiveList
	Loc        qerrors.Location
}

func (*InlineFragment) DeepCopy

func (from *InlineFragment) DeepCopy() Selection

func (InlineFragment) GetSelections

func (t InlineFragment) GetSelections(doc *QueryDocument) SelectionList

func (InlineFragment) Location

func (t InlineFragment) Location() qerrors.Location

func (*InlineFragment) SetSelections

func (t *InlineFragment) SetSelections(doc *QueryDocument, v SelectionList)

func (*InlineFragment) WriteTo

func (t *InlineFragment) WriteTo(out io.StringWriter)

type InputObject

type InputObject struct {
	Name       string
	Desc       Description
	Fields     InputValueList
	Directives DirectiveList
}

InputObject types define a set of input fields; the input fields are either scalars, enums, or other input objects.

This allows arguments to accept arbitrarily complex structs.

http://facebook.github.io/graphql/draft/#sec-Input-Objects

func (*InputObject) AddIfMissing

func (t *InputObject) AddIfMissing(to *Schema, from *Schema)

func (*InputObject) Description

func (t *InputObject) Description() string

func (*InputObject) GetDirectives

func (t *InputObject) GetDirectives() DirectiveList

func (*InputObject) Kind

func (*InputObject) Kind() string

func (*InputObject) Sort

func (t *InputObject) Sort()

func (*InputObject) String

func (t *InputObject) String() string

func (*InputObject) TypeName

func (t *InputObject) TypeName() string

func (*InputObject) WriteTo

func (t *InputObject) WriteTo(out io.StringWriter)

type InputValue

type InputValue struct {
	Loc        qerrors.Location
	Name       string
	NameLoc    Location
	Type       Type
	TypeLoc    qerrors.Location
	Default    Literal
	Desc       Description
	Directives DirectiveList
}

http://facebook.github.io/graphql/draft/#InputValueDefinition

func ParseInputValue

func ParseInputValue(l *lexer.Lexer) *InputValue

func (*InputValue) AddIfMissing

func (t *InputValue) AddIfMissing(to *Schema, from *Schema)

func (*InputValue) DeepCopy

func (from *InputValue) DeepCopy() *InputValue

func (*InputValue) GetDirectives

func (t *InputValue) GetDirectives() DirectiveList

func (*InputValue) Kind

func (t *InputValue) Kind() string

func (*InputValue) Sort

func (t *InputValue) Sort()

func (*InputValue) String

func (t *InputValue) String() string

func (*InputValue) WriteTo

func (t *InputValue) WriteTo(out io.StringWriter)

type InputValueList

type InputValueList []*InputValue

func (InputValueList) AddIfMissing

func (t InputValueList) AddIfMissing(to *Schema, from *Schema)

func (InputValueList) DeepCopy

func (from InputValueList) DeepCopy() (to InputValueList)

func (InputValueList) Get

func (l InputValueList) Get(name string) *InputValue

func (InputValueList) Sort

func (t InputValueList) Sort()

func (InputValueList) WriteTo

func (t InputValueList) WriteTo(out io.StringWriter)

type Interface

type Interface struct {
	Name          string
	PossibleTypes []*Object
	Fields        FieldList // NOTE: the spec refers to this as `FieldsDefinition`.
	Desc          Description
	Directives    DirectiveList
}

Interface types represent a list of named fields and their arguments.

GraphQL objects can then implement these interfaces which requires that the object type will define all fields defined by those interfaces.

http://facebook.github.io/graphql/draft/#sec-Interfaces

func (*Interface) AddIfMissing

func (t *Interface) AddIfMissing(to *Schema, from *Schema)

func (*Interface) Description

func (t *Interface) Description() string

func (*Interface) GetDirectives

func (t *Interface) GetDirectives() DirectiveList

func (*Interface) Kind

func (*Interface) Kind() string

func (*Interface) Sort

func (t *Interface) Sort()

func (*Interface) String

func (t *Interface) String() string

func (*Interface) TypeName

func (t *Interface) TypeName() string

func (*Interface) WriteTo

func (t *Interface) WriteTo(out io.StringWriter)

type InterfaceList

type InterfaceList []*Interface

func (InterfaceList) Get

func (l InterfaceList) Get(name string) *Interface

func (InterfaceList) Select

func (l InterfaceList) Select(keep func(d *Interface) bool) InterfaceList

type List

type List struct {
	OfType Type
}

func (*List) AddIfMissing

func (t *List) AddIfMissing(to *Schema, from *Schema)

func (*List) Kind

func (*List) Kind() string

func (*List) String

func (t *List) String() string

func (*List) WriteTo

func (t *List) WriteTo(out io.StringWriter)

type ListLit

type ListLit struct {
	Entries []Literal
	Loc     qerrors.Location
}

func (*ListLit) DeepCopy

func (from *ListLit) DeepCopy() Literal

func (*ListLit) Evaluate

func (lit *ListLit) Evaluate(vars map[string]interface{}) interface{}

func (*ListLit) Location

func (lit *ListLit) Location() qerrors.Location

func (*ListLit) String

func (lit *ListLit) String() string

func (*ListLit) WriteTo

func (lit *ListLit) WriteTo(out io.StringWriter)

type Literal

type Literal interface {
	Evaluate(vars map[string]interface{}) interface{}
	String() string
	Location() qerrors.Location
	WriteTo(out io.StringWriter)
}

func DeepCopyLiteral

func DeepCopyLiteral(from Literal) Literal

func ParseLiteral

func ParseLiteral(l *lexer.Lexer, constOnly bool) Literal

func ToLiteral

func ToLiteral(v interface{}) Literal

type Location

type Location = lexer.Location

type NamedType

type NamedType interface {
	Type
	TypeName() string
	Description() string
}

NamedType represents a type with a name.

http://facebook.github.io/graphql/draft/#NamedType

type NonNull

type NonNull struct {
	OfType Type
}

func (*NonNull) AddIfMissing

func (t *NonNull) AddIfMissing(to *Schema, from *Schema)

func (*NonNull) Kind

func (*NonNull) Kind() string

func (*NonNull) String

func (t *NonNull) String() string

func (*NonNull) WriteTo

func (t *NonNull) WriteTo(out io.StringWriter)

type NullLit

type NullLit struct {
	Loc qerrors.Location
}

func (*NullLit) DeepCopy

func (from *NullLit) DeepCopy() Literal

func (*NullLit) Evaluate

func (lit *NullLit) Evaluate(vars map[string]interface{}) interface{}

func (*NullLit) Location

func (lit *NullLit) Location() qerrors.Location

func (*NullLit) String

func (lit *NullLit) String() string

func (*NullLit) WriteTo

func (lit *NullLit) WriteTo(out io.StringWriter)

type Object

type Object struct {
	Name       string
	Interfaces InterfaceList
	Fields     FieldList `json:"fields"`
	Desc       Description
	Directives DirectiveList

	InterfaceNames []string
}

Object types represent a list of named fields, each of which yield a value of a specific type.

GraphQL queries are hierarchical and composed, describing a tree of information. While Scalar types describe the leaf values of these hierarchical types, Objects describe the intermediate levels.

http://facebook.github.io/graphql/draft/#sec-Objects

func (*Object) AddIfMissing

func (t *Object) AddIfMissing(to *Schema, from *Schema)

func (*Object) Description

func (t *Object) Description() string

func (*Object) GetDirectives

func (t *Object) GetDirectives() DirectiveList

func (*Object) Kind

func (*Object) Kind() string

func (*Object) Sort

func (t *Object) Sort()

Sortable implementations

func (*Object) String

func (t *Object) String() string

func (*Object) TypeName

func (t *Object) TypeName() string

func (*Object) WriteTo

func (t *Object) WriteTo(out io.StringWriter)

type ObjectLit

type ObjectLit struct {
	Fields []*ObjectLitField
	Loc    qerrors.Location
}

func (*ObjectLit) DeepCopy

func (from *ObjectLit) DeepCopy() Literal

func (*ObjectLit) Evaluate

func (lit *ObjectLit) Evaluate(vars map[string]interface{}) interface{}

func (*ObjectLit) Location

func (lit *ObjectLit) Location() qerrors.Location

func (*ObjectLit) String

func (lit *ObjectLit) String() string

func (*ObjectLit) WriteTo

func (t *ObjectLit) WriteTo(out io.StringWriter)

type ObjectLitField

type ObjectLitField struct {
	Name    string
	NameLoc Location
	Value   Literal
}

func (*ObjectLitField) DeepCopy

func (from *ObjectLitField) DeepCopy() *ObjectLitField

type Operation

type Operation struct {
	Type       OperationType
	Name       string
	NameLoc    Location
	Vars       InputValueList
	Selections SelectionList
	Directives DirectiveList
	Loc        qerrors.Location
}

func (*Operation) DeepCopy

func (from *Operation) DeepCopy() *Operation

func (Operation) GetSelections

func (t Operation) GetSelections(doc *QueryDocument) SelectionList

func (Operation) Location

func (t Operation) Location() qerrors.Location

func (*Operation) SetSelections

func (t *Operation) SetSelections(doc *QueryDocument, v SelectionList)

func (*Operation) WriteTo

func (o *Operation) WriteTo(out io.StringWriter)

type OperationList

type OperationList []*Operation

func (OperationList) DeepCopy

func (from OperationList) DeepCopy() (to OperationList)

func (OperationList) Get

func (l OperationList) Get(name string) *Operation

type OperationType

type OperationType string

func GetOperationType

func GetOperationType(v string) OperationType

type QueryDocument

type QueryDocument struct {
	Operations OperationList
	Fragments  FragmentList
}

func (*QueryDocument) Close

func (d *QueryDocument) Close()

func (*QueryDocument) DeepCopy

func (from *QueryDocument) DeepCopy() *QueryDocument

func (*QueryDocument) GetOperation

func (d *QueryDocument) GetOperation(operationName string) (*Operation, error)

func (*QueryDocument) Parse

func (doc *QueryDocument) Parse(queryString string) error

func (*QueryDocument) ParseWithDescriptions

func (doc *QueryDocument) ParseWithDescriptions(queryString string) error

func (*QueryDocument) String

func (s *QueryDocument) String() string

func (*QueryDocument) WriteTo

func (s *QueryDocument) WriteTo(out io.StringWriter)

type Resolver

type Resolver func(name string) Type

type Scalar

type Scalar struct {
	Name       string
	Desc       Description
	Directives DirectiveList
}

Scalar types represent primitive leaf values (e.g. a string or an integer) in a GraphQL type system.

GraphQL responses take the form of a hierarchical tree; the leaves on these trees are GraphQL scalars.

http://facebook.github.io/graphql/draft/#sec-Scalars

func (*Scalar) AddIfMissing

func (t *Scalar) AddIfMissing(to *Schema, from *Schema)

func (*Scalar) Description

func (t *Scalar) Description() string

func (*Scalar) GetDirectives

func (t *Scalar) GetDirectives() DirectiveList

func (*Scalar) Kind

func (*Scalar) Kind() string

func (*Scalar) String

func (t *Scalar) String() string

func (*Scalar) TypeName

func (t *Scalar) TypeName() string

func (*Scalar) WriteTo

func (t *Scalar) WriteTo(out io.StringWriter)

type Schema

type Schema struct {

	// These are directives applied to the schema.
	Directives DirectiveList

	// EntryPoints determines the place in the type system where `query`, `mutation`, and
	// `subscription` operations begin.
	//
	// http://facebook.github.io/graphql/draft/#sec-Root-Operation-Types
	//
	// NOTE: The specification refers to this concept as "Root Operation Types".
	// TODO: Rename the `EntryPoints` field to `RootOperationTypes` to align with spec terminology.
	EntryPoints map[OperationType]NamedType

	// Types are the fundamental unit of any GraphQL schema.
	// There are six kinds of named types, and two wrapping types.
	//
	// http://facebook.github.io/graphql/draft/#sec-Types
	Types map[string]NamedType

	// Directives are used to annotate various parts of a GraphQL document as an indicator that they
	// should be evaluated differently by a validator, executor, or client tool such as a code
	// generator.
	//
	// http://facebook.github.io/graphql/draft/#sec-Type-System.Directives
	DeclaredDirectives map[string]*DirectiveDecl

	EntryPointNames map[OperationType]string
}

Schema represents a GraphQL service's collective type system capabilities. A schema is defined in terms of the types and directives it supports as well as the root operation types for each kind of operation: `query`, `mutation`, and `subscription`.

For a more formal definition, read the relevant section in the specification:

http://facebook.github.io/graphql/draft/#sec-Schema

var Meta *Schema

func New

func New() *Schema

New initializes an instance of Schema.

func (*Schema) AddIfMissing

func (t *Schema) AddIfMissing(to *Schema, from *Schema)

func (*Schema) GetDirectives

func (t *Schema) GetDirectives() DirectiveList

func (*Schema) Kind

func (*Schema) Kind() string

func (*Schema) Parse

func (s *Schema) Parse(schemaString string) error

Parse the schema string.

func (*Schema) RenameTypes

func (s *Schema) RenameTypes(renamer func(string) string)

func (*Schema) Resolve

func (s *Schema) Resolve(name string) Type

Resolve a named type in the schema by its name.

func (*Schema) ResolveTypes

func (s *Schema) ResolveTypes() error

func (*Schema) String

func (s *Schema) String() string

func (*Schema) VisitDirective

func (s *Schema) VisitDirective(directiveDecl *DirectiveDecl, visitor func(directive *Directive, parents ...HasDirectives) error) error

*

func (*Schema) WriteTo

func (s *Schema) WriteTo(out io.StringWriter)

type Selection

type Selection interface {
	Formatter
	GetSelections(doc *QueryDocument) SelectionList
	SetSelections(doc *QueryDocument, v SelectionList)
	Location() qerrors.Location
}

func DeepCopySelection

func DeepCopySelection(from Selection) Selection

type SelectionList

type SelectionList []Selection

func (SelectionList) DeepCopy

func (from SelectionList) DeepCopy() (to SelectionList)

func (SelectionList) WriteTo

func (o SelectionList) WriteTo(out io.StringWriter)

type Sortable

type Sortable interface {
	Sort()
}

type Type

type Type interface {
	Kind() string
	String() string
	AddIfMissing(to *Schema, from *Schema)
	Formatter
}

func DeepestType

func DeepestType(t Type) Type

func OfType

func OfType(t Type) Type

func ParseType

func ParseType(l *lexer.Lexer) Type

func ResolveType

func ResolveType(t Type, resolver Resolver) (Type, *qerrors.Error)

type TypeName

type TypeName struct {
	Name    string
	NameLoc Location
}

func (*TypeName) AddIfMissing

func (t *TypeName) AddIfMissing(to *Schema, from *Schema)

func (*TypeName) Kind

func (*TypeName) Kind() string

func (*TypeName) String

func (t *TypeName) String() string

func (*TypeName) WriteTo

func (t *TypeName) WriteTo(out io.StringWriter)

type Union

type Union struct {
	Name          string
	PossibleTypes []*Object // NOTE: the spec refers to this as `UnionMemberTypes`.
	Desc          Description
	TypeNames     []string
	Directives    DirectiveList
}

Union types represent objects that could be one of a list of GraphQL object types, but provides no guaranteed fields between those types.

They also differ from interfaces in that object types declare what interfaces they implement, but are not aware of what unions contain them.

http://facebook.github.io/graphql/draft/#sec-Unions

func (*Union) AddIfMissing

func (t *Union) AddIfMissing(to *Schema, from *Schema)

func (*Union) Description

func (t *Union) Description() string

func (*Union) GetDirectives

func (t *Union) GetDirectives() DirectiveList

func (*Union) Kind

func (*Union) Kind() string

func (*Union) Sort

func (t *Union) Sort()

func (*Union) String

func (t *Union) String() string

func (*Union) TypeName

func (t *Union) TypeName() string

func (*Union) WriteTo

func (t *Union) WriteTo(out io.StringWriter)

type Variable

type Variable struct {
	Name string
	Loc  qerrors.Location
}

func (*Variable) DeepCopy

func (from *Variable) DeepCopy() Literal

func (Variable) Evaluate

func (v Variable) Evaluate(vars map[string]interface{}) interface{}

func (*Variable) Location

func (v *Variable) Location() qerrors.Location

func (Variable) String

func (v Variable) String() string

func (*Variable) WriteTo

func (lit *Variable) WriteTo(out io.StringWriter)

Jump to

Keyboard shortcuts

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