func New() plugin.Plugin
type BuildMutateHook = func(b *ModelBuild) *ModelBuild
type Enum struct { Description string Name string Values []*EnumValue }
type EnumValue struct { Description string Name string }
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 }
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(td *ast.Definition, fd *ast.FieldDefinition, f *Field) (*Field, error)
GoFieldHook applies the goField directive to the generated Field f.
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 = func(td *ast.Definition, fd *ast.FieldDefinition, f *Field) (*Field, error)
type Interface struct { Description string Name string Fields []*Field Implements []string OmitCheck bool Models []*Object }
type ModelBuild struct { PackageName string Interfaces []*Interface Models []*Object Enums []*Enum Scalars []string }
func DefaultBuildMutateHook(b *ModelBuild) *ModelBuild
DefaultBuildMutateHook is the default hook for the Plugin which mutate ModelBuild.
type Object struct { Description string Name string Fields []*Field Implements []string }
type Plugin struct { MutateHook BuildMutateHook FieldHook FieldMutateHook }
func (m *Plugin) MutateConfig(cfg *config.Config) error
func (m *Plugin) Name() string