resolvergen

package module
v0.0.0-...-5e203e8 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2020 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var InputTypes = []string{"Create", "Update", "Delete"}

Functions

func New

func New(convertHelpersDir, backendModelsPath, frontendModelsPath string, authImport string) plugin.Plugin

Types

type File

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

func (f *File) Imports() string

type Import

type Import struct {
	Alias      string
	ImportPath string
}

type Plugin

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

func (*Plugin) GenerateCode

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

func (*Plugin) Name

func (m *Plugin) Name() string

type Resolver

type Resolver struct {
	Object                    *codegen.Object
	Field                     *codegen.Field
	Implementation            string
	IsSingle                  bool
	IsList                    bool
	IsCreate                  bool
	IsUpdate                  bool
	IsDelete                  bool
	IsBatchCreate             bool
	IsBatchUpdate             bool
	IsBatchDelete             bool
	BoilerWhiteList           string
	ResolveOrganizationID     bool
	ResolveUserOrganizationID bool
	ResolveUserID             bool
	Model                     convert.Model
	InputModel                convert.Model
}

type ResolverBuild

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

type Rewriter

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

func NewRewriter

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

func (*Rewriter) ExistingImports

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

func (*Rewriter) GetMethodBody

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

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