Documentation ¶
Index ¶
- Constants
- Variables
- func BaseType(t GQLTypeProvider) string
- func InitCache(size int)
- func IsGLType(t GQLTypeProvider) string
- func IsInputType(t *GQLtype) bool
- func IsOutputType(t *GQLtype) bool
- func ValidateName(name string, errS *[]error, loc *Loc_)
- type ArgumentAppender
- type ArgumentS
- type ArgumentT
- type Arguments_
- type AssignTyper
- type Bool_
- type DirectiveAppender
- type DirectiveLoc
- type DirectiveT
- type Directive_
- func (d *Directive_) AppendField(f_ *InputValueDef, err *[]error)
- func (d *Directive_) AssignName(input string, loc *Loc_, err *[]error)
- func (d *Directive_) CheckDirectiveLocation(err *[]error)
- func (d *Directive_) CheckDirectiveRef(dir NameValue_, err *[]error)
- func (d *Directive_) CheckInputValueType(err *[]error)
- func (d *Directive_) CheckIsInputType(err *[]error)
- func (d *Directive_) CoerceDirectiveName()
- func (d *Directive_) SolicitAbstractTypes(unresolved UnresolvedMap)
- func (d *Directive_) String() string
- func (d *Directive_) Type() string
- func (d *Directive_) TypeName() NameValue_
- func (d *Directive_) TypeSystemNode()
- type Directives_
- func (d *Directives_) AppendDirective(s *DirectiveT) error
- func (d *Directives_) CheckDirectiveRef(dir NameValue_, err *[]error)
- func (d *Directives_) CheckInputValueType(err *[]error)
- func (d *Directives_) Len() int
- func (d *Directives_) SolicitAbstractTypes(unresolved UnresolvedMap)
- func (d *Directives_) String() string
- type Document
- type EnumValue_
- func (e *EnumValue_) AssignName(s string, l *Loc_, unresolved *[]error)
- func (e *EnumValue_) CheckDirectiveLocation(err *[]error)
- func (e *EnumValue_) CheckEnumValue(a *GQLtype, err *[]error)
- func (e *EnumValue_) CheckInputValueType(err *[]error)
- func (e *EnumValue_) IsType() TypeFlag_
- func (e *EnumValue_) SolicitAbstractTypes(unresolved UnresolvedMap)
- func (e *EnumValue_) String() string
- func (e *EnumValue_) Type() string
- func (e *EnumValue_) TypeName() NameValue_
- func (e *EnumValue_) TypeSystemNode()
- func (e *EnumValue_) ValueNode()
- type Enum_
- type FieldAppender
- type FieldArgAppender
- type FieldSet
- type Field_
- func (f *Field_) AppendField(f_ *InputValueDef, unresolved *[]error)
- func (f *Field_) AssignName(s string, loc *Loc_, unresolved *[]error)
- func (f *Field_) AssignType(t *GQLtype)
- func (f *Field_) CheckDirectiveLocation(err *[]error)
- func (f *Field_) CheckDirectiveRef(dir NameValue_, err *[]error)
- func (f *Field_) CheckInputValueType(err *[]error)
- func (f *Field_) SolicitAbstractTypes(unresolved UnresolvedMap)
- func (f *Field_) String() string
- type Float_
- type GQLTypeProvider
- type GQLtype
- func (a *GQLtype) Equals(b *GQLtype) bool
- func (t *GQLtype) IsList() bool
- func (t *GQLtype) IsNullable() bool
- func (t *GQLtype) IsNullableAtDepth(depth uint8) (bool, error)
- func (t *GQLtype) IsScalar() bool
- func (t *GQLtype) IsType() TypeFlag_
- func (t *GQLtype) IsType2() TypeFlag_
- func (t GQLtype) String() string
- func (t GQLtype) TypeName() string
- type ID_
- type InputValueDef
- func (fa *InputValueDef) AssignName(input string, loc *Loc_, unresolved *[]error)
- func (fa *InputValueDef) AssignType(t *GQLtype)
- func (fa *InputValueDef) CheckDirectiveLocation(err *[]error)
- func (fa *InputValueDef) CheckDirectiveRef(dir NameValue_, err *[]error)
- func (a *InputValueDef) CheckInputValueType(err *[]error)
- func (fa *InputValueDef) SolicitAbstractTypes(unresolved UnresolvedMap)
- func (fa *InputValueDef) String() string
- type InputValueDefs
- func (fa *InputValueDefs) AppendField(f *InputValueDef, unresolved *[]error)
- func (fa *InputValueDefs) CheckDirectiveLocation(err *[]error)
- func (fa InputValueDefs) CheckDirectiveRef(dirName NameValue_, err *[]error)
- func (fa InputValueDefs) CheckInputValueType(err *[]error)
- func (fa InputValueDefs) CheckIsInputType(err *[]error)
- func (fa InputValueDefs) SolicitAbstractTypes(unresolved UnresolvedMap)
- func (fa *InputValueDefs) String(encl [2]token.TokenType) string
- type InputValueProvider
- type InputValue_
- type Input_
- func (i *Input_) CheckDirectiveLocation(err *[]error)
- func (i *Input_) CheckDirectiveRef(dir NameValue_, err *[]error)
- func (i *Input_) CheckInputValueType(err *[]error)
- func (e *Input_) IsType() TypeFlag_
- func (e *Input_) SolicitAbstractTypes(unresolved UnresolvedMap)
- func (u *Input_) String() string
- func (e *Input_) Type() string
- func (i *Input_) TypeName() NameValue_
- func (e *Input_) TypeSystemNode()
- type Int_
- type Interface_
- func (i *Interface_) AssignName(input string, loc *Loc_, unresolved *[]error)
- func (i *Interface_) CheckDirectiveLocation(err *[]error)
- func (i *Interface_) CheckFieldMembers(err *[]error)
- func (i *Interface_) CheckInputValueType(err *[]error)
- func (i *Interface_) Conform(obj GQLTypeProvider) bool
- func (i *Interface_) GetSelectionSet() FieldSet
- func (i *Interface_) SolicitAbstractTypes(unresolved UnresolvedMap)
- func (i *Interface_) String() string
- func (i *Interface_) Type() string
- func (i *Interface_) TypeName() NameValue_
- func (i *Interface_) TypeSystemNode()
- type List_
- type Loc_
- type NameAssigner
- type NameS
- type NameValue_
- type Name_
- type Null_
- type ObjectVals
- func (a ObjectVals) AppendArgument(ss *ArgumentT)
- func (o ObjectVals) Exists() bool
- func (o ObjectVals) IsType() TypeFlag_
- func (o ObjectVals) String() string
- func (o ObjectVals) Type() string
- func (o ObjectVals) TypeSystemNode()
- func (o ObjectVals) ValidateObjectValues(ref *GQLtype, err *[]error)
- func (o ObjectVals) ValueNode()
- type Object_
- func (f *Object_) AssignName(s string, loc *Loc_, unresolved *[]error)
- func (o *Object_) CheckDirectiveLocation(err *[]error)
- func (o *Object_) CheckDirectiveRef(dirName NameValue_, err *[]error)
- func (f *Object_) CheckImplements(err *[]error)
- func (f *Object_) CheckInputValueType(err *[]error)
- func (f *Object_) CheckIsInputType(err *[]error)
- func (f *Object_) CheckIsOutputType(err *[]error)
- func (o *Object_) GetSelectionSet() FieldSet
- func (o *Object_) SolicitAbstractTypes(unresolved UnresolvedMap)
- func (f *Object_) String() string
- func (o *Object_) Type() string
- func (o *Object_) TypeName() NameValue_
- func (o *Object_) TypeSystemNode()
- type RawString_
- type SDLSelectionSetter
- type ScalarProvider
- type Scalar_
- func (e *Scalar_) AssignName(s string, loc *Loc_, errS *[]error)
- func (e *Scalar_) CheckDirectiveLocation(err *[]error)
- func (s *Scalar_) Coerce(input InputValueProvider) (InputValueProvider, error)
- func (e *Scalar_) IsType() TypeFlag_
- func (e *Scalar_) SolicitAbstractTypes(unresolved UnresolvedMap)
- func (u *Scalar_) String() string
- func (e *Scalar_) Type() string
- func (i *Scalar_) TypeName() NameValue_
- func (e *Scalar_) TypeSystemNode()
- func (e *Scalar_) ValueNode()
- type Schema
- type Schema_
- type String_
- type TypeFlag_
- type Union_
- type UnresolvedMap
Constants ¶
const ( QUERY_OP opType = 1 << iota MUTATION_OP SUBSCRIPTION_OP )
Variables ¶
var DirectiveErr error = errors.New("not a valid name for directive")
type Name_ struct { Name NameValue_ Loc *Loc_ }
var DirectiveLocationMap map[DirectiveLoc]string
var TyCache map[string]GQLTypeProvider
Type cache - each type and its associated AST is held in the cache.
Functions ¶
func BaseType ¶
func BaseType(t GQLTypeProvider) string
func IsGLType ¶
func IsGLType(t GQLTypeProvider) string
func IsInputType ¶
func IsOutputType ¶
func ValidateName ¶
Types ¶
type ArgumentAppender ¶
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_ }
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 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 }
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 (*Enum_) CheckInputValueType ¶
func (*Enum_) SolicitAbstractTypes ¶
func (e *Enum_) SolicitAbstractTypes(unresolved UnresolvedMap)
func (*Enum_) TypeName ¶
func (e *Enum_) TypeName() NameValue_
func (*Enum_) TypeSystemNode ¶
func (e *Enum_) TypeSystemNode()
type FieldAppender ¶
type FieldArgAppender ¶
type FieldArgAppender interface {
AppendField(f_ *InputValueDef, unresolved *[]error)
}
type FieldSet ¶
type FieldSet []*Field_
func (*FieldSet) AppendField ¶
func (*FieldSet) CheckInputValueType ¶
func (*FieldSet) SolicitAbstractTypes ¶
func (fs *FieldSet) SolicitAbstractTypes(unresolved UnresolvedMap)
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 ¶
use following method to override the promoted methods from Name_ and Directives_ fields. Forces use of Name_ method.
func (*Field_) AssignType ¶
func (*Field_) CheckDirectiveLocation ¶
func (*Field_) CheckDirectiveRef ¶
func (f *Field_) CheckDirectiveRef(dir NameValue_, err *[]error)
func (*Field_) CheckInputValueType ¶
func (*Field_) SolicitAbstractTypes ¶
func (f *Field_) SolicitAbstractTypes(unresolved UnresolvedMap)
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) IsNullable ¶
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)
type InputValueProvider ¶
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 (*Input_) CheckDirectiveRef ¶
func (i *Input_) CheckDirectiveRef(dir NameValue_, err *[]error)
func (*Input_) CheckInputValueType ¶
func (*Input_) SolicitAbstractTypes ¶
func (e *Input_) SolicitAbstractTypes(unresolved UnresolvedMap)
func (e *Input_) ValueNode() {}// commented out 19/3/2020
func (*Input_) TypeName ¶
func (i *Input_) TypeName() NameValue_
func (*Input_) TypeSystemNode ¶
func (e *Input_) TypeSystemNode()
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 NameAssigner ¶
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_) AtPosition ¶
func (Name_) EqualString ¶
type Null_ ¶
type Null_ bool // moved from Scalar to it's own type. No obvious reason why - no obvious advantage at this stage
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 ¶
use following method to disambiguate the promoted AssignName method from Name_ and Directives_ fields. Forces use of Name_ method.
func (*Object_) CheckDirectiveLocation ¶
func (*Object_) CheckDirectiveRef ¶
func (o *Object_) CheckDirectiveRef(dirName NameValue_, err *[]error)
func (*Object_) CheckImplements ¶
func (*Object_) CheckInputValueType ¶
func (*Object_) CheckIsInputType ¶
func (*Object_) CheckIsOutputType ¶
func (*Object_) GetSelectionSet ¶
func (*Object_) SolicitAbstractTypes ¶
func (o *Object_) SolicitAbstractTypes(unresolved UnresolvedMap)
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_) CheckDirectiveLocation ¶
func (*Scalar_) Coerce ¶
func (s *Scalar_) Coerce(input InputValueProvider) (InputValueProvider, error)
func (*Scalar_) SolicitAbstractTypes ¶
func (e *Scalar_) SolicitAbstractTypes(unresolved UnresolvedMap)
func (*Scalar_) TypeName ¶
func (i *Scalar_) TypeName() NameValue_
func (*Scalar_) TypeSystemNode ¶
func (e *Scalar_) TypeSystemNode()
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_) CheckDirectiveLocation ¶
func (*Schema_) TypeName ¶
func (sc *Schema_) TypeName() NameValue_
func (*Schema_) TypeSystemNode ¶
func (sc *Schema_) TypeSystemNode()
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
type Union_ ¶
type Union_ struct { Desc string Name_ Directives_ NameS // Members }
InterfaceTypeDefinition
Description-opt interface Name Directives-opt FieldsDefinition-opt
func (*Union_) CheckDirectiveLocation ¶
func (*Union_) SolicitAbstractTypes ¶
func (u *Union_) SolicitAbstractTypes(unresolved UnresolvedMap)
func (*Union_) TypeName ¶
func (u *Union_) TypeName() NameValue_
func (*Union_) TypeSystemNode ¶
func (u *Union_) TypeSystemNode()