resolvergen

package
v0.17.45 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 11, 2024 License: MIT Imports: 16 Imported by: 17

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New() plugin.Plugin

Types

type File added in v0.11.0

type File struct {

	// These are separated because the type definition of the resolver object may live in a different file from the
	// resolver method implementations, for example when extending a type in a different graphql schema file
	Objects   []*codegen.Object
	Resolvers []*Resolver

	RemainingSource string
	// contains filtered or unexported fields
}

func (*File) Imports added in v0.11.0

func (f *File) Imports() string

type Plugin

type Plugin struct{}

func (*Plugin) GenerateCode

func (m *Plugin) GenerateCode(data *codegen.Data) error

func (*Plugin) Name

func (m *Plugin) Name() string

type Resolver added in v0.11.0

type Resolver struct {
	Object               *codegen.Object
	Field                *codegen.Field
	PrevDecl             *ast.FuncDecl
	Comment              string
	ImplementationStr    string
	ImplementationRender func(r *codegen.Field) string
}

func (*Resolver) Implementation added in v0.11.0

func (r *Resolver) Implementation() string

type ResolverBuild

type ResolverBuild struct {
	*File
	HasRoot             bool
	PackageName         string
	ResolverType        string
	OmitTemplateComment bool
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL