gqlx

package
v0.0.0-...-5a6b2d2 Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2023 License: Apache-2.0 Imports: 21 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Import

type Import struct {
	Alias      string
	ImportPath string
}

type MutationType

type MutationType int
const (
	MutationCreate MutationType = iota
	MutationUpdate
	MutationDelete
)

type Option

type Option func(*ResolverPlugin)

func WithConfig

func WithConfig(cfg *config.Config) Option

WithConfig set config for resolver plugin. in v0.17.41 need the config. so add this method for compatible.

func WithRelayNodeEx

func WithRelayNodeEx() Option

WithRelayNodeEx enable relay node extended by globalID.

type ResolverPlugin

type ResolverPlugin struct {
	// contains filtered or unexported fields
}

func NewResolverPlugin

func NewResolverPlugin(opt ...Option) *ResolverPlugin

func (ResolverPlugin) FormatFile

func (r ResolverPlugin) FormatFile(path string) error

func (ResolverPlugin) GenerateCode

func (r ResolverPlugin) GenerateCode(data *codegen.Data) error

GenerateCode implement api.CodeGenerator

func (ResolverPlugin) Implement

func (r ResolverPlugin) Implement(f *codegen.Field) (val string)

Implement gqlgen api.ResolverImplementer

func (ResolverPlugin) Mutation

func (r ResolverPlugin) Mutation(f *codegen.Field) (string, error)

func (ResolverPlugin) Name

func (r ResolverPlugin) Name() string

func (ResolverPlugin) OverrideResolverStruct

func (r ResolverPlugin) OverrideResolverStruct(config *config.Config) error

func (ResolverPlugin) Query

func (r ResolverPlugin) Query(f *codegen.Field) (string, error)

type Rewriter

type Rewriter struct {
	// contains filtered or unexported fields
}

func NewRewriter

func NewRewriter(dir string) (*Rewriter, error)

func (*Rewriter) ExistingImports

func (r *Rewriter) ExistingImports(filename string) []Import

func (*Rewriter) GetMethodBody

func (r *Rewriter) GetMethodBody(structname, methodname string) string

func (*Rewriter) GetMethodComment

func (r *Rewriter) GetMethodComment(structname, methodname string) string

func (*Rewriter) GetPrevDecl

func (r *Rewriter) GetPrevDecl(structname, methodname string) *ast.FuncDecl

func (*Rewriter) MarkStructCopied

func (r *Rewriter) MarkStructCopied(name string)

func (*Rewriter) RemainingSource

func (r *Rewriter) RemainingSource(filename string) string

Jump to

Keyboard shortcuts

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