import "github.com/99designs/gqlgen/codegen"
args.go complexity.go data.go directive.go field.go generate.go interface.go object.go type.go util.go
type ArgSet struct { Args []*FieldArgument FuncDecl string }
type Data struct { Config *config.Config Schema *ast.Schema Directives DirectiveList Objects Objects Inputs Objects Interfaces map[string]*Interface ReferencedTypes map[string]*config.TypeReference ComplexityRoots map[string]*Object QueryRoot *Object MutationRoot *Object SubscriptionRoot *Object }
Data is a unified model of the code to be generated. Plugins may modify this structure to do things like implement resolvers or directives automatically (eg grpc, validation)
func (a *Data) Args() map[string][]*FieldArgument
type Directive struct { *ast.DirectiveDefinition Name string Args []*FieldArgument Builtin bool }
func (d *Directive) IsLocation(location ...ast.DirectiveLocation) bool
IsLocation check location directive
func (dl DirectiveList) LocationDirectives(location string) DirectiveList
LocationDirectives filter directives by location
type Field struct { *ast.FieldDefinition TypeReference *config.TypeReference GoFieldType GoFieldType // The field type in go, if any GoReceiverName string // The name of method & var receiver in go, if any GoFieldName string // The name of the method or var in go, if any IsResolver bool // Does this field need a resolver Args []*FieldArgument // A list of arguments to be passed to this field MethodHasContext bool // If this is bound to a go method, does the method also take a context NoErr bool // If this is bound to a go method, does that method have an error as the second argument Object *Object // A link back to the parent object Default interface{} // The default value Stream bool // does this field return a channel? Directives []*Directive }
type FieldArgument struct { *ast.ArgumentDefinition TypeReference *config.TypeReference VarName string // The name of the var in go Object *Object // A link back to the parent object Default interface{} // The default value Directives []*Directive Value interface{} // value set in Data }
func (f *FieldArgument) DirectiveObjName() string
func (f *FieldArgument) ImplDirectives() []*Directive
ImplDirectives get not Builtin and location ARGUMENT_DEFINITION directive
func (f *FieldArgument) Stream() bool
const ( GoFieldUndefined GoFieldType = iota GoFieldMethod GoFieldVariable GoFieldMap )
type Interface struct { *ast.Definition Type types.Type Implementors []InterfaceImplementor InTypemap bool }
func (i *InterfaceImplementor) CanBeNil() bool
type Object struct { *ast.Definition Type types.Type ResolverInterface types.Type Root bool Fields []*Field Implements []*ast.Definition DisableConcurrency bool Stream bool Directives []*Directive }
Path | Synopsis |
---|---|
config | |
templates | |
testserver | |
testserver/introspection | |
testserver/invalid-packagename | |
testserver/otherpkg |
Package codegen imports 12 packages (graph) and is imported by 49 packages. Updated 2020-09-25. Refresh now. Tools for package owners.