Documentation ¶
Index ¶
- Variables
- func ArgumentsFromMap(in map[string]any) (args map[string]*ParsedArgument)
- type EnumValue
- type FieldType
- func (ft FieldType) AppSyncType() string
- func (ft FieldType) DynamoPointerFunc() string
- func (ft FieldType) DynamoType() string
- func (ft FieldType) GoType() string
- func (ft FieldType) GoTypeRequired() string
- func (ft FieldType) IsCollectionOfObjects() bool
- func (ft FieldType) IsObject() bool
- func (ft FieldType) Validate() error
- func (ft FieldType) ZeroValueGo() string
- type ParsedArgument
- type ParsedArgumentDef
- type ParsedDirective
- func (pd *ParsedDirective) Arg(key string) string
- func (pd *ParsedDirective) ArgBool(key string) bool
- func (pd *ParsedDirective) ArgGo(key string) string
- func (pd *ParsedDirective) ArgHCL(key string) string
- func (pd *ParsedDirective) ArgIsNull(key string) bool
- func (pd *ParsedDirective) ArgJS(key string) string
- func (pd *ParsedDirective) ArgListString(key string) []string
- func (pd *ParsedDirective) HasArg(key string) bool
- func (pd *ParsedDirective) Validate() error
- type ParsedEnum
- type ParsedField
- func (pf *ParsedField) GoStructTag() string
- func (pf *ParsedField) HasDirective(key string) bool
- func (pf *ParsedField) NameCamel() string
- func (pf *ParsedField) NameDash() string
- func (pf *ParsedField) NameTitle() string
- func (pf *ParsedField) NameUnder() string
- func (pf *ParsedField) NormaliseGo(key string) (ret string)
- func (pf *ParsedField) NormaliseVTL(key string) (ret string)
- func (pf *ParsedField) SingleDirective(key string) *ParsedDirective
- func (pf *ParsedField) Validate() error
- type ParsedObject
- func (po *ParsedObject) Field(key string) *ParsedField
- func (po *ParsedObject) HasDirective(key string) bool
- func (po *ParsedObject) NameCamel() string
- func (po *ParsedObject) NameDash() string
- func (po *ParsedObject) NameTitle() string
- func (po *ParsedObject) NameUnder() string
- func (po *ParsedObject) SingleDirective(key string) *ParsedDirective
- func (po *ParsedObject) Validate() error
- type ParsedUnion
- type Schema
- type Value
Constants ¶
This section is empty.
Variables ¶
var TypeIntReq = &FieldType{ Kind: "String", Required: true, Collection: false, CollectionSubtype: nil, }
TypeIntReq is a pre-filled FieldType for a Required Int field. This is used primarily for unit testing.
var TypeStringReq = &FieldType{ Kind: "String", Required: true, Collection: false, CollectionSubtype: nil, }
TypeStringReq is a pre-filled FieldType for a Required String field. This is used primarily for unit testing.
var TypeStringReqCollection = &FieldType{ Required: true, Collection: true, CollectionSubtype: TypeStringReq, }
TypeStringReqCollection is a pre-filled FieldType for a Required String field. This is used primarily for unit testing.
Functions ¶
func ArgumentsFromMap ¶
func ArgumentsFromMap(in map[string]any) (args map[string]*ParsedArgument)
ArgumentsFromMap generates a ParsedArgument map based on a Go map - this should be used only for testing purposes
Types ¶
type EnumValue ¶
type EnumValue struct { Name string Description string Directives map[string][]*ParsedDirective }
type FieldType ¶
FieldType is a struct that represents a field type, generated by parsing a graphql schema
func ParseFieldType ¶
func (FieldType) AppSyncType ¶
func (FieldType) DynamoPointerFunc ¶
func (FieldType) DynamoType ¶
func (FieldType) GoTypeRequired ¶
func (FieldType) IsCollectionOfObjects ¶
func (FieldType) ZeroValueGo ¶
type ParsedArgument ¶
func (*ParsedArgument) Validate ¶
func (pa *ParsedArgument) Validate() error
type ParsedArgumentDef ¶
func (*ParsedArgumentDef) GoStructTag ¶
func (pad *ParsedArgumentDef) GoStructTag() string
func (*ParsedArgumentDef) NameCamel ¶
func (pad *ParsedArgumentDef) NameCamel() string
func (*ParsedArgumentDef) NameDash ¶
func (pad *ParsedArgumentDef) NameDash() string
func (*ParsedArgumentDef) NameTitle ¶
func (pad *ParsedArgumentDef) NameTitle() string
func (*ParsedArgumentDef) NameUnder ¶
func (pad *ParsedArgumentDef) NameUnder() string
func (*ParsedArgumentDef) Validate ¶
func (pad *ParsedArgumentDef) Validate() error
type ParsedDirective ¶
type ParsedDirective struct { Name string Arguments map[string]*ParsedArgument }
func (*ParsedDirective) Arg ¶
func (pd *ParsedDirective) Arg(key string) string
func (*ParsedDirective) ArgBool ¶
func (pd *ParsedDirective) ArgBool(key string) bool
func (*ParsedDirective) ArgGo ¶
func (pd *ParsedDirective) ArgGo(key string) string
func (*ParsedDirective) ArgHCL ¶
func (pd *ParsedDirective) ArgHCL(key string) string
func (*ParsedDirective) ArgIsNull ¶
func (pd *ParsedDirective) ArgIsNull(key string) bool
func (*ParsedDirective) ArgJS ¶
func (pd *ParsedDirective) ArgJS(key string) string
func (*ParsedDirective) ArgListString ¶ added in v0.9.2
func (pd *ParsedDirective) ArgListString(key string) []string
func (*ParsedDirective) HasArg ¶
func (pd *ParsedDirective) HasArg(key string) bool
func (*ParsedDirective) Validate ¶
func (pd *ParsedDirective) Validate() error
type ParsedEnum ¶
func (*ParsedEnum) NameCamel ¶
func (e *ParsedEnum) NameCamel() string
func (*ParsedEnum) NameDash ¶
func (e *ParsedEnum) NameDash() string
func (*ParsedEnum) NameTitle ¶
func (e *ParsedEnum) NameTitle() string
func (*ParsedEnum) NameUnder ¶
func (e *ParsedEnum) NameUnder() string
func (*ParsedEnum) Validate ¶
func (e *ParsedEnum) Validate() error
func (*ParsedEnum) ValueString ¶
func (e *ParsedEnum) ValueString() []string
type ParsedField ¶
type ParsedField struct { Name string Directives map[string][]*ParsedDirective Description string Arguments map[string]*ParsedArgumentDef Type *FieldType }
func (*ParsedField) GoStructTag ¶
func (pf *ParsedField) GoStructTag() string
func (*ParsedField) HasDirective ¶
func (pf *ParsedField) HasDirective(key string) bool
func (*ParsedField) NameCamel ¶
func (pf *ParsedField) NameCamel() string
func (*ParsedField) NameDash ¶
func (pf *ParsedField) NameDash() string
func (*ParsedField) NameTitle ¶
func (pf *ParsedField) NameTitle() string
func (*ParsedField) NameUnder ¶
func (pf *ParsedField) NameUnder() string
func (*ParsedField) NormaliseGo ¶ added in v0.9.2
func (pf *ParsedField) NormaliseGo(key string) (ret string)
NormaliseGo generates Go code to normalise a value as per the @normalise directive. The key parameter defines the variable name in VTL associated with this field, e.g. "object.myField"
func (*ParsedField) NormaliseVTL ¶ added in v0.9.2
func (pf *ParsedField) NormaliseVTL(key string) (ret string)
NormaliseVTL generates VTL (Velocity Template Language, for AppSync) to normalise a value as per the @normalise directive. The key parameter defines the variable name in VTL associated with this field, e.g. "$context.source.x"
func (*ParsedField) SingleDirective ¶
func (pf *ParsedField) SingleDirective(key string) *ParsedDirective
func (*ParsedField) Validate ¶
func (pf *ParsedField) Validate() error
type ParsedObject ¶
type ParsedObject struct { Name string Directives map[string][]*ParsedDirective Description string Fields []*ParsedField Interfaces []string }
func (*ParsedObject) Field ¶
func (po *ParsedObject) Field(key string) *ParsedField
func (*ParsedObject) HasDirective ¶
func (po *ParsedObject) HasDirective(key string) bool
func (*ParsedObject) NameCamel ¶
func (po *ParsedObject) NameCamel() string
func (*ParsedObject) NameDash ¶
func (po *ParsedObject) NameDash() string
func (*ParsedObject) NameTitle ¶
func (po *ParsedObject) NameTitle() string
func (*ParsedObject) NameUnder ¶
func (po *ParsedObject) NameUnder() string
func (*ParsedObject) SingleDirective ¶
func (po *ParsedObject) SingleDirective(key string) *ParsedDirective
func (*ParsedObject) Validate ¶
func (po *ParsedObject) Validate() error
type ParsedUnion ¶
type Schema ¶
type Schema struct { Objects map[string]*ParsedObject InputObjects map[string]*ParsedObject Enums map[string]*ParsedEnum Unions map[string]*ParsedUnion Query map[string]*ParsedField Mutation map[string]*ParsedField Subscription map[string]*ParsedField }