Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type BuildMutateHook ¶ added in v0.10.2
type BuildMutateHook = func(b *ModelBuild) *ModelBuild
type Field ¶
type Field struct {
Description string
// Name is the field's name as it appears in the schema
Name string
// GoName is the field's name as it appears in the generated Go code
GoName string
Type types.Type
Tag string
IsResolver bool
Omittable bool
ForceGenerate bool
}
func DefaultFieldMutateHook ¶ added in v0.17.23
func DefaultFieldMutateHook(td *ast.Definition, fd *ast.FieldDefinition, f *Field) (*Field, error)
DefaultFieldMutateHook is the default hook for the Plugin which applies the GoFieldHook and GoTagFieldHook.
func GoFieldHook ¶ added in v0.17.21
func GoFieldHook(td *ast.Definition, fd *ast.FieldDefinition, f *Field) (*Field, error)
GoFieldHook is a noop TODO: This will be removed in the next breaking release
func GoTagFieldHook ¶ added in v0.15.0
func GoTagFieldHook(td *ast.Definition, fd *ast.FieldDefinition, f *Field) (*Field, error)
GoTagFieldHook prepends the goTag directive to the generated Field f. When applying the Tag to the field, the field name is used if no value argument is present.
type FieldMutateHook ¶ added in v0.15.0
type FieldMutateHook = func(td *ast.Definition, fd *ast.FieldDefinition, f *Field) (*Field, error)
type Getter ¶ added in v0.17.96
type Getter struct {
Name string // the method is Get<Name>: the interface field's Go name
Field string // the model field it returns, by Go name
Type types.Type // the interface field's type
Description string
PointerOp string // "&" or "*" applied to the field to match Type, or ""
Slice bool // copied element by element, since a []T is not a []I
// contains filtered or unexported fields
}
Getter is a method that returns an interface field from a model.
type Implementation ¶ added in v0.17.96
Implementation is an interface or union a model implements, with the getters the model needs for it.
type ModelBuild ¶
type ModelBuild struct {
PackageName string
Interfaces []*Interface
Models []*Object
Enums []*Enum
Scalars []string
}
func DefaultBuildMutateHook ¶ added in v0.17.23
func DefaultBuildMutateHook(b *ModelBuild) *ModelBuild
DefaultBuildMutateHook is the default hook for the Plugin which mutate ModelBuild.
type Object ¶
type Object struct {
Description string
Name string
Fields []*Field
Implements []string
// Implementations holds Implements with their getters; set after the
// build hook runs.
Implementations []*Implementation
}
type Plugin ¶
type Plugin struct {
MutateHook BuildMutateHook
FieldHook FieldMutateHook
}
Source Files
¶
Click to show internal directories.
Click to hide internal directories.