ast

package
v0.0.0-...-1559108 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2024 License: MIT Imports: 11 Imported by: 4

Documentation

Index

Constants

View Source
const (
	QUERY_OP opType = 1 << iota
	MUTATION_OP
	SUBSCRIPTION_OP
)

Variables

View Source
var DirectiveErr error = errors.New("not a valid name for directive")
type Name_ struct {
	Name NameValue_
	Loc  *Loc_
}
View Source
var DirectiveLocationMap map[DirectiveLoc]string

Type cache - each type and its associated AST is held in the cache.

Functions

func BaseType

func BaseType(t GQLTypeProvider) string

func InitCache

func InitCache(size int)

func IsGLType

func IsGLType(t GQLTypeProvider) string

func IsInputType

func IsInputType(t *GQLtype) bool

func IsOutputType

func IsOutputType(t *GQLtype) bool

func ValidateName

func ValidateName(name string, errS *[]error, loc *Loc_)

Types

type ArgumentAppender

type ArgumentAppender interface {
	String() string
	AppendArgument(s *ArgumentT)
}

type ArgumentS

type ArgumentS []*ArgumentT // same as type ObjectVals []*ArgumentT

func (ArgumentS) String

func (a ArgumentS) String() string

type ArgumentT

type ArgumentT struct {
	//( name : value ) e.g. picture(size: 300): Url    where Name_ is size and Value is 300
	Name_
	//Type  *GQLtype - not necessary
	Value *InputValue_
}

func (*ArgumentT) StmtType

func (a *ArgumentT) StmtType() string

func (*ArgumentT) String

func (a *ArgumentT) String(last bool) string

type Arguments_

type Arguments_ struct {
	Arguments []*ArgumentT
}

func (*Arguments_) AppendArgument

func (a *Arguments_) AppendArgument(ss *ArgumentT)

func (*Arguments_) SolicitAbstractTypes

func (a *Arguments_) SolicitAbstractTypes(unresolved UnresolvedMap)

func (*Arguments_) String

func (a *Arguments_) String() string

type AssignTyper

type AssignTyper interface {
	AssignType(t *GQLtype)
}

===============================================================

type Bool_

type Bool_ bool //bool

func (Bool_) IsType

func (b Bool_) IsType() TypeFlag_

func (Bool_) String

func (b Bool_) String() string

func (Bool_) ValueNode

func (b Bool_) ValueNode()

type DirectiveAppender

type DirectiveAppender interface {
	AppendDirective(s *DirectiveT) error
}

Directives[Const]

Directive[?Const]list

Directive[Const] :

@ Name Arguments[?Const]opt ...

used as type for argument into parseFragment(f DirectiveAppender)

called using .parseDirectives(stmt) . where stmt has embedded DirectiveT field as anonymous

type DirectiveLoc

type DirectiveLoc uint8

Directive Locations

const (
	SCHEMA_DL DirectiveLoc
	SCALAR_DL
	OBJECT_DL
	FIELD_DEFINITION_DL
	ARGUMENT_DEFINITION_DL
	INTERFACE_DL
	UNION_DL
	ENUM_DL
	ENUM_VALUE_DL
	INPUT_OBJECT_DL
	INPUT_FIELD_DEFINITION_DL
	//
	QUERY_DL
	MUTATION_DL
	SUBSCRIPTION_DL
	FIELD_DL
	FRAGMENT_DEFINITION_DL
	FRAGMENT_SPREAD_DL
	INLINE_FRAGMENT_DL
)

Directive Locations

type DirectiveT

type DirectiveT struct {
	Name_
	Arguments_ // inherit Arguments field and d.Arguments d.AppendArgument()

}

func (*DirectiveT) CoerceDirectiveName

func (d *DirectiveT) CoerceDirectiveName()

func (*DirectiveT) String

func (d *DirectiveT) String() string

type Directive_

type Directive_ struct {
	Desc         string
	Name_                       // no need to hold Location as its stored in InputValue, parent of this object
	ArgumentDefs InputValueDefs //TODO consider making InputValueDefs an embedded type ie. an anonymous field
	Location     []DirectiveLoc
}

func (*Directive_) AppendField

func (d *Directive_) AppendField(f_ *InputValueDef, err *[]error)

func (*Directive_) AssignName

func (d *Directive_) AssignName(input string, loc *Loc_, err *[]error)

func (*Directive_) CheckDirectiveLocation

func (d *Directive_) CheckDirectiveLocation(err *[]error)

func (*Directive_) CheckDirectiveRef

func (d *Directive_) CheckDirectiveRef(dir NameValue_, err *[]error)

func (*Directive_) CheckInputValueType

func (d *Directive_) CheckInputValueType(err *[]error)

func (*Directive_) CheckIsInputType

func (d *Directive_) CheckIsInputType(err *[]error)

func (*Directive_) CoerceDirectiveName

func (d *Directive_) CoerceDirectiveName()

func (*Directive_) SolicitAbstractTypes

func (d *Directive_) SolicitAbstractTypes(unresolved UnresolvedMap)

func (d *Directive_) ValueNode() {}

func (*Directive_) String

func (d *Directive_) String() string

func (*Directive_) Type

func (d *Directive_) Type() string

func (*Directive_) TypeName

func (d *Directive_) TypeName() NameValue_

func (*Directive_) TypeSystemNode

func (d *Directive_) TypeSystemNode()

type Directives_

type Directives_ struct {
	Directives []*DirectiveT
}

Directives_, attribute in many GQLtype e.g EnumValue, Interface, Union, Input,... do not confuse with the Directive definition (statement)

func (*Directives_) AppendDirective

func (d *Directives_) AppendDirective(s *DirectiveT) error

func (*Directives_) CheckDirectiveRef

func (d *Directives_) CheckDirectiveRef(dir NameValue_, err *[]error)

func (*Directives_) CheckInputValueType

func (d *Directives_) CheckInputValueType(err *[]error)

func (*Directives_) Len

func (d *Directives_) Len() int

func (*Directives_) SolicitAbstractTypes

func (d *Directives_) SolicitAbstractTypes(unresolved UnresolvedMap)

these are not directive definitions, they are instances of directives which have no type specification just data.

func (*Directives_) String

func (d *Directives_) String() string

type Document

type Document struct {
	Statements    []GQLTypeProvider
	StatementsMap map[NameValue_]GQLTypeProvider
	ErrorMap      map[NameValue_][]error
}

func (Document) String

func (d Document) String() string

type EnumValue_

type EnumValue_ struct {
	Desc string
	Name_
	Directives_
	// contains filtered or unexported fields
}

EnumValueDefinition

Description-opt EnumValue Directives-const-opt

func (*EnumValue_) AssignName

func (e *EnumValue_) AssignName(s string, l *Loc_, unresolved *[]error)

func (*EnumValue_) CheckDirectiveLocation

func (e *EnumValue_) CheckDirectiveLocation(err *[]error)

func (*EnumValue_) CheckEnumValue

func (e *EnumValue_) CheckEnumValue(a *GQLtype, err *[]error)

CheckEnumValue checks the ENUM value (as Argument in Field object) is a member of the ENUM Type.

func (*EnumValue_) CheckInputValueType

func (e *EnumValue_) CheckInputValueType(err *[]error)

func (*EnumValue_) IsType

func (e *EnumValue_) IsType() TypeFlag_

func (*EnumValue_) SolicitAbstractTypes

func (e *EnumValue_) SolicitAbstractTypes(unresolved UnresolvedMap)

func (*EnumValue_) String

func (e *EnumValue_) String() string

func (*EnumValue_) Type

func (e *EnumValue_) Type() string

func (*EnumValue_) TypeName

func (e *EnumValue_) TypeName() NameValue_

func (*EnumValue_) TypeSystemNode

func (e *EnumValue_) TypeSystemNode()

func (*EnumValue_) ValueNode

func (e *EnumValue_) ValueNode()

type Enum_

type Enum_ struct {
	Desc string
	Name_
	Directives_
	Values []*EnumValue_
}

Enum

Descriptio-nopt enum Name Directives-const-opt EnumValuesDefinition-opt
	EnumValuesDefinition
	{EnumValueDefinitionlist}

func (*Enum_) CheckDirectiveLocation

func (e *Enum_) CheckDirectiveLocation(err *[]error)

func (*Enum_) CheckInputValueType

func (e *Enum_) CheckInputValueType(err *[]error)

func (*Enum_) SolicitAbstractTypes

func (e *Enum_) SolicitAbstractTypes(unresolved UnresolvedMap)

func (*Enum_) String

func (e *Enum_) String() string

func (*Enum_) Type

func (e *Enum_) Type() string

func (*Enum_) TypeName

func (e *Enum_) TypeName() NameValue_

func (*Enum_) TypeSystemNode

func (e *Enum_) TypeSystemNode()

type FieldAppender

type FieldAppender interface {
	AppendField(f_ *Field_) error
}

type FieldArgAppender

type FieldArgAppender interface {
	AppendField(f_ *InputValueDef, unresolved *[]error)
}

type FieldSet

type FieldSet []*Field_

func (*FieldSet) AppendField

func (fs *FieldSet) AppendField(f_ *Field_) error

func (*FieldSet) CheckInputValueType

func (fs *FieldSet) CheckInputValueType(err *[]error)

func (*FieldSet) SolicitAbstractTypes

func (fs *FieldSet) SolicitAbstractTypes(unresolved UnresolvedMap)

func (*FieldSet) String

func (f *FieldSet) String() string

type Field_

type Field_ struct {
	Desc string
	Name_
	ArgumentDefs InputValueDefs //[]*InputValueDef []*ObjectVal
	// :
	Type *GQLtype
	Directives_
}

==================== Field_ ================================ instance of Object Field FieldDefinition

Description-opt	Name	ArgumentsDefinition-opt	:	Type	Directives-opt

func (*Field_) AppendField

func (f *Field_) AppendField(f_ *InputValueDef, unresolved *[]error)

func (*Field_) AssignName

func (f *Field_) AssignName(s string, loc *Loc_, unresolved *[]error)

use following method to override the promoted methods from Name_ and Directives_ fields. Forces use of Name_ method.

func (*Field_) AssignType

func (f *Field_) AssignType(t *GQLtype)

func (*Field_) CheckDirectiveLocation

func (f *Field_) CheckDirectiveLocation(err *[]error)

func (*Field_) CheckDirectiveRef

func (f *Field_) CheckDirectiveRef(dir NameValue_, err *[]error)

func (*Field_) CheckInputValueType

func (f *Field_) CheckInputValueType(err *[]error)

func (*Field_) SolicitAbstractTypes

func (f *Field_) SolicitAbstractTypes(unresolved UnresolvedMap)

func (*Field_) String

func (f *Field_) String() string

type Float_

type Float_ string //float64

func (Float_) IsType

func (f Float_) IsType() TypeFlag_

func (Float_) String

func (f Float_) String() string

func (Float_) ValueNode

func (f Float_) ValueNode()

type GQLTypeProvider

type GQLTypeProvider interface {
	TypeSystemNode()
	TypeName() NameValue_
	SolicitAbstractTypes(UnresolvedMap) // while not all Types contain nested types that need to be resolved e.g scalar must still include this method
	CheckDirectiveRef(dir NameValue_, err *[]error)
	CheckDirectiveLocation(err *[]error)
	CheckInputValueType(err *[]error)
	String() string
	Type() string // used to print type in error message
}

GQLTypeProvider reperesents all the GraphQL types, SCALAR (user defined), OBJECTS, UNIONS, INTERFACES, ENUMS, INPUTOBJECTS, LISTS

type GQLtype

type GQLtype struct {
	Constraint byte            // each bit from right represents not-null constraint applied e.g. in nested list type [type]! is 00000010, [type!]! is 00000011, type! 00000001, [type]! 00000010
	AST        GQLTypeProvider // AST instance of type. WHen would this be used??. Used for non-Scalar types. AST in cache(typeName), then in GQLtype(typeName). If not in GQLtype, check cache, then DB.
	Depth      uint8           // depth of nested List e.g. depth 2 would be [[type]]. Depth 0 implies non-list type, depth > 0 is a list type
	Name_                      // type name. inherit AssignName(). Use Name_ to access AST via cache lookup. ALternatively, use AST above or TypeFlag_ instead of string.
	Base       string          // base type e.g. Name_ = "Episode" has Base = E(num)
	sync.Mutex
}

type DepthT uint8 - didn't work. Compiler issues with conversions from DepthT to int. GQLtype represents the generic type metadata. The specific details of the type is held in the AST attribute. All GQL types are GQLtype.

func (*GQLtype) Equals

func (a *GQLtype) Equals(b *GQLtype) bool

func (*GQLtype) IsList

func (t *GQLtype) IsList() bool

func (*GQLtype) IsNullable

func (t *GQLtype) IsNullable() bool

func (*GQLtype) IsNullableAtDepth

func (t *GQLtype) IsNullableAtDepth(depth uint8) (bool, error)

func (*GQLtype) IsScalar

func (t *GQLtype) IsScalar() bool

func (*GQLtype) IsType

func (t *GQLtype) IsType() TypeFlag_

func (*GQLtype) IsType2

func (t *GQLtype) IsType2() TypeFlag_

func (GQLtype) String

func (t GQLtype) String() string

func (GQLtype) TypeName

func (t GQLtype) TypeName() string
func (t *GQLtype) TypeName() string {
	return t.Name.String()
}

TODO what is using non-pointer receiver?

type ID_

type ID_ string //float64

func (ID_) IsType

func (f ID_) IsType() TypeFlag_

func (ID_) String

func (f ID_) String() string

func (ID_) ValueNode

func (f ID_) ValueNode()

type InputValueDef

type InputValueDef struct {
	Desc string
	Name_
	Type       *GQLtype
	DefaultVal *InputValue_
	Directives_
}

==================== . InputValueDef . ============================ ArgumentsDefinition

(InputValueDefinitionlist)

InputValueDefinition

Description-opt  Name : Type  =  DefaultValue-opt   Directives-opt

func (*InputValueDef) AssignName

func (fa *InputValueDef) AssignName(input string, loc *Loc_, unresolved *[]error)

func (*InputValueDef) AssignType

func (fa *InputValueDef) AssignType(t *GQLtype)

func (*InputValueDef) CheckDirectiveLocation

func (fa *InputValueDef) CheckDirectiveLocation(err *[]error)

func (*InputValueDef) CheckDirectiveRef

func (fa *InputValueDef) CheckDirectiveRef(dir NameValue_, err *[]error)

func (*InputValueDef) CheckInputValueType

func (a *InputValueDef) CheckInputValueType(err *[]error)

func (*InputValueDef) SolicitAbstractTypes

func (fa *InputValueDef) SolicitAbstractTypes(unresolved UnresolvedMap)

func (*InputValueDef) String

func (fa *InputValueDef) String() string

type InputValueDefs

type InputValueDefs []*InputValueDef

==================== ArgumentDefs ================================ Slice of *InputValueDef

func (*InputValueDefs) AppendField

func (fa *InputValueDefs) AppendField(f *InputValueDef, unresolved *[]error)

func (*InputValueDefs) CheckDirectiveLocation

func (fa *InputValueDefs) CheckDirectiveLocation(err *[]error)

func (InputValueDefs) CheckDirectiveRef

func (fa InputValueDefs) CheckDirectiveRef(dirName NameValue_, err *[]error)

func (InputValueDefs) CheckInputValueType

func (fa InputValueDefs) CheckInputValueType(err *[]error)

func (InputValueDefs) CheckIsInputType

func (fa InputValueDefs) CheckIsInputType(err *[]error)

func (InputValueDefs) SolicitAbstractTypes

func (fa InputValueDefs) SolicitAbstractTypes(unresolved UnresolvedMap)

func (*InputValueDefs) String

func (fa *InputValueDefs) String(encl [2]token.TokenType) string

type InputValueProvider

type InputValueProvider interface {
	ValueNode()
	IsType() TypeFlag_
	String() string
}

InputValueProvider represents the Graph QL Input Value types (see parseInputValue:) &Int_, &Float_,...,&Enum_, &List_, &ObjectVals

type InputValue_

type InputValue_ struct {
	InputValueProvider
	Loc *Loc_
}

input values used for "default values" in arguments in type, field arguments and input objects.

func (*InputValue_) AtPosition

func (iv *InputValue_) AtPosition() string

func (*InputValue_) CheckInputValueType

func (a *InputValue_) CheckInputValueType(refType *GQLtype, nm Name_, err *[]error)

CheckInputValueType called from graphql package to validate input values as well as during type creation, for the following circumstances: * default values of variables in operational stmt, field argument definition, directive argument definition i.e. at the specification stage * field arguments in query stmts (checking name and value against definition) during validation/execution * directive arguments in query stmts (checking name and value against its definition from the directive stmt) during validation/execution

refType is the reference type (i.e. for directive arguments, the directive stmt def, for field args the Object stmt def) the value of the InputValue_ must match nm is the name of the associated argument or input - used for its Loc value err contains all errors caught during validation

func (*InputValue_) IsScalar

func (iv *InputValue_) IsScalar() bool

func (*InputValue_) String

func (iv *InputValue_) String() string

type Input_

type Input_ struct {
	Desc string
	Name_
	Directives_
	InputValueDefs // []*InputValueDef
}

====================== Input_ ========================= InputObjectTypeDefinition

Description-opt	input	Name	DirectivesConst-opt	InputFieldsDefinition-opt

func (*Input_) CheckDirectiveLocation

func (i *Input_) CheckDirectiveLocation(err *[]error)

func (*Input_) CheckDirectiveRef

func (i *Input_) CheckDirectiveRef(dir NameValue_, err *[]error)

func (*Input_) CheckInputValueType

func (i *Input_) CheckInputValueType(err *[]error)

func (*Input_) IsType

func (e *Input_) IsType() TypeFlag_

func (*Input_) SolicitAbstractTypes

func (e *Input_) SolicitAbstractTypes(unresolved UnresolvedMap)

func (e *Input_) ValueNode() {}// commented out 19/3/2020

func (*Input_) String

func (u *Input_) String() string

func (*Input_) Type

func (e *Input_) Type() string

func (*Input_) TypeName

func (i *Input_) TypeName() NameValue_

func (*Input_) TypeSystemNode

func (e *Input_) TypeSystemNode()

type Int_

type Int_ string //int

func (Int_) IsType

func (n Int_) IsType() TypeFlag_

func (Int_) String

func (i Int_) String() string

func (Int_) ValueNode

func (i Int_) ValueNode()

type Interface_

type Interface_ struct {
	Desc string
	Name_
	Directives_
	FieldSet
}

InterfaceTypeDefinition

Description-opt interface Name Directives-opt FieldsDefinition-opt

func (*Interface_) AssignName

func (i *Interface_) AssignName(input string, loc *Loc_, unresolved *[]error)

func (i *Interface_) AssignUnresolvedTypes(ast TypeRepo) error {}

func (*Interface_) CheckDirectiveLocation

func (i *Interface_) CheckDirectiveLocation(err *[]error)

func (*Interface_) CheckFieldMembers

func (i *Interface_) CheckFieldMembers(err *[]error)

func (*Interface_) CheckInputValueType

func (i *Interface_) CheckInputValueType(err *[]error)

func (*Interface_) Conform

func (i *Interface_) Conform(obj GQLTypeProvider) bool

func (*Interface_) GetSelectionSet

func (i *Interface_) GetSelectionSet() FieldSet

func (*Interface_) SolicitAbstractTypes

func (i *Interface_) SolicitAbstractTypes(unresolved UnresolvedMap)

func (*Interface_) String

func (i *Interface_) String() string

func (*Interface_) Type

func (i *Interface_) Type() string

func (*Interface_) TypeName

func (i *Interface_) TypeName() NameValue_

func (*Interface_) TypeSystemNode

func (i *Interface_) TypeSystemNode()

type List_

type List_ []*InputValue_

func (List_) Exists

func (l List_) Exists() bool

func (List_) IsType

func (l List_) IsType() TypeFlag_

func (List_) String

func (l List_) String() string

func (List_) TypeName

func (l List_) TypeName() string

func (List_) ValidateListValues

func (l List_) ValidateListValues(iv *GQLtype, d *uint8, maxd *uint8, err *[]error)

func (List_) ValueNode

func (l List_) ValueNode()

type Loc_

type Loc_ struct {
	Line   int
	Column int
}

func (Loc_) String

func (l Loc_) String() string

type NameAssigner

type NameAssigner interface {
	AssignName(name string, loc *Loc_, errS *[]error)
}

type NameS

type NameS []Name_

================================================================= Slice of Name_

func (NameS) SolicitAbstractTypes

func (f NameS) SolicitAbstractTypes(unresolved UnresolvedMap)

SolicitAbstractTypes is typically promoted to type that embedds the NameS type.

type NameValue_

type NameValue_ string

func (NameValue_) EqualString

func (a NameValue_) EqualString(b string) bool

func (NameValue_) Equals

func (a NameValue_) Equals(b NameValue_) bool

func (NameValue_) String

func (n NameValue_) String() string

type Name_

type Name_ struct {
	Name NameValue_
	Loc  *Loc_
}

func (*Name_) AssignName

func (n *Name_) AssignName(s string, loc *Loc_, errS *[]error)

func (Name_) AtPosition

func (n Name_) AtPosition() string

func (Name_) EqualString

func (a Name_) EqualString(b string) bool

func (Name_) Equals

func (a Name_) Equals(b Name_) bool

func (Name_) Exists

func (n Name_) Exists() bool

func (Name_) String

func (n Name_) String() string

type Null_

type Null_ bool // moved from Scalar to it's own type. No obvious reason why - no obvious advantage at this stage

func (Null_) IsType

func (n Null_) IsType() TypeFlag_

func (Null_) String

func (n Null_) String() string

func (Null_) ValueNode

func (n Null_) ValueNode()

type ObjectVals

type ObjectVals []*ArgumentT

func (ObjectVals) AppendArgument

func (a ObjectVals) AppendArgument(ss *ArgumentT)

func (ObjectVals) Exists

func (o ObjectVals) Exists() bool

func (ObjectVals) IsType

func (o ObjectVals) IsType() TypeFlag_

func (ObjectVals) String

func (o ObjectVals) String() string

func (ObjectVals) Type

func (o ObjectVals) Type() string

func (ObjectVals) TypeSystemNode

func (o ObjectVals) TypeSystemNode()

func (ObjectVals) ValidateObjectValues

func (o ObjectVals) ValidateObjectValues(ref *GQLtype, err *[]error)

ValidateObjectValues compares the value of the objectVal ie. value in { name:value name:value ... } against the TYPE (ref) from the type definition Object/Input . e.g. {name:"Ross", age:33} ==> root type "Person" {name: String, age: Int}

func (ObjectVals) ValueNode

func (o ObjectVals) ValueNode()

type Object_

type Object_ struct {
	Desc        string
	Name_             // instane name of Object_ type e.g. Person, Pet. inherits fields and method, AssignName from Name_. Overidden
	Implements  NameS //TODO  = create type NameS []*Name_ and add method AppendField to NameS and then embedded this type in Object_ struct
	Directives_       // inherits AssignName  (from Name_) + others. Overidden
	//	Fields      FieldSet // TODO - embed anonymous this FieldSet in Object_
	FieldSet
}

========================= Object_ =============================== object definition:

type Person {
  name: String
  age: Int
  picture: Url
}

Description-opt TYPE Name ImplementsInterfaces-opt Directives-Const-opt FieldsDefinition-opt

		{FieldDefinition-list}
        FieldDefinition:
			Description-opt Name ArgumentsDefinition- opt : Type Directives-Con

func (*Object_) AssignName

func (f *Object_) AssignName(s string, loc *Loc_, unresolved *[]error)

use following method to disambiguate the promoted AssignName method from Name_ and Directives_ fields. Forces use of Name_ method.

func (*Object_) CheckDirectiveLocation

func (o *Object_) CheckDirectiveLocation(err *[]error)

func (*Object_) CheckDirectiveRef

func (o *Object_) CheckDirectiveRef(dirName NameValue_, err *[]error)

func (*Object_) CheckImplements

func (f *Object_) CheckImplements(err *[]error)

func (*Object_) CheckInputValueType

func (f *Object_) CheckInputValueType(err *[]error)

func (*Object_) CheckIsInputType

func (f *Object_) CheckIsInputType(err *[]error)

func (*Object_) CheckIsOutputType

func (f *Object_) CheckIsOutputType(err *[]error)

func (*Object_) GetSelectionSet

func (o *Object_) GetSelectionSet() FieldSet

func (*Object_) SolicitAbstractTypes

func (o *Object_) SolicitAbstractTypes(unresolved UnresolvedMap)

func (*Object_) String

func (f *Object_) String() string

func (*Object_) Type

func (o *Object_) Type() string

func (*Object_) TypeName

func (o *Object_) TypeName() NameValue_

func (o *Object_) ValueNode() {}

func (*Object_) TypeSystemNode

func (o *Object_) TypeSystemNode()

type RawString_

type RawString_ string

func (RawString_) IsType

func (s RawString_) IsType() TypeFlag_

func (RawString_) String

func (s RawString_) String() string

func (RawString_) ValueNode

func (s RawString_) ValueNode()

type SDLSelectionSetter

type SDLSelectionSetter interface {
	GetSelectionSet() FieldSet
	TypeName() NameValue_
}

type ScalarProvider

type ScalarProvider interface {
	GQLTypeProvider
	Coerce(i InputValueProvider) (InputValueProvider, error)
}

type Scalar_

type Scalar_ struct {
	Desc string
	Name string // no need to hold Location as its stored in InputValue, parent of this object
	Loc  *Loc_
	Directives_
	Data string
	//
	// scalar data validator types (may not be necessary)
	//
	TimeV   time.Time // any date-time
	NumberV float64   // any number
	IntV    int64     // any int
}

====================== Scalar_ ========================= ScalarTypeDefinition:

Description-opt	input	Name	DirectivesConst-opt	InputFieldsDefinition-opt

func (*Scalar_) AssignName

func (e *Scalar_) AssignName(s string, loc *Loc_, errS *[]error)

func (*Scalar_) CheckDirectiveLocation

func (e *Scalar_) CheckDirectiveLocation(err *[]error)

func (*Scalar_) Coerce

func (s *Scalar_) Coerce(input InputValueProvider) (InputValueProvider, error)

func (*Scalar_) IsType

func (e *Scalar_) IsType() TypeFlag_

func (*Scalar_) SolicitAbstractTypes

func (e *Scalar_) SolicitAbstractTypes(unresolved UnresolvedMap)

func (*Scalar_) String

func (u *Scalar_) String() string

func (*Scalar_) Type

func (e *Scalar_) Type() string

func (*Scalar_) TypeName

func (i *Scalar_) TypeName() NameValue_

func (*Scalar_) TypeSystemNode

func (e *Scalar_) TypeSystemNode()

func (*Scalar_) ValueNode

func (e *Scalar_) ValueNode()

type Schema

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

type Schema_

type Schema_ struct {
	Directives_
	Query        Name_ // named type to use as root type of query into graph of types e.g. "Query" -> type Query { allPersons(last : Int ) : [Person!]! }
	Mutation     Name_
	Subscription Name_
	Op           opType //  current operation used during parsing of statement
}

func (*Schema_) AssignName

func (sc *Schema_) AssignName(s string, loc *Loc_, errS *[]error)

func (*Schema_) CheckDirectiveLocation

func (sc *Schema_) CheckDirectiveLocation(err *[]error)

func (*Schema_) String

func (sc *Schema_) String() string

func (*Schema_) Type

func (sc *Schema_) Type() string

func (*Schema_) TypeName

func (sc *Schema_) TypeName() NameValue_

func (*Schema_) TypeSystemNode

func (sc *Schema_) TypeSystemNode()

type String_

type String_ string

func (String_) IsType

func (s String_) IsType() TypeFlag_

func (String_) String

func (s String_) String() string

func (String_) ValueNode

func (s String_) ValueNode()

type TypeFlag_

type TypeFlag_ uint8
const (
	ID TypeFlag_
	INT
	FLOAT
	BOOLEAN
	STRING
	RAWSTRING
	SCALAR
	//
	NULL
	OBJECT
	ENUM
	ENUMVALUE
	INPUT
	LIST
	INTERFACE
	UNION
	//
	ILLEGAL
)

TypeFlag constants shared by GQLType & InputValue types - not all the below are applicable to each

func (TypeFlag_) String

func (tf TypeFlag_) String() string

type Union_

type Union_ struct {
	Desc string
	Name_
	Directives_
	NameS // Members
}

InterfaceTypeDefinition

Description-opt interface Name Directives-opt FieldsDefinition-opt

func (*Union_) CheckDirectiveLocation

func (u *Union_) CheckDirectiveLocation(err *[]error)

func (*Union_) SolicitAbstractTypes

func (u *Union_) SolicitAbstractTypes(unresolved UnresolvedMap)

func (*Union_) String

func (u *Union_) String() string

func (*Union_) Type

func (u *Union_) Type() string

func (*Union_) TypeName

func (u *Union_) TypeName() NameValue_

func (*Union_) TypeSystemNode

func (u *Union_) TypeSystemNode()

type UnresolvedMap

type UnresolvedMap map[Name_]*GQLtype

Jump to

Keyboard shortcuts

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