resolvergen

package
v0.13.2 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2026 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package resolvergen provides the a resolver template for the gqlgen resolver plugin to override the default resolver functions

Index

Constants

View Source
const (
	CreateOperation  = "Create"
	UpdateOperation  = "Update"
	AddOperation     = "Add"
	DeleteOperation  = "Delete"
	InputObject      = "Input"
	BulkOperation    = "Bulk"
	CSVOperation     = "CSV"
	BulkCSVOperation = "BulkCSV"
	UploadOperation  = "Upload"
	Connection       = "Connection"
	Payload          = "Payload"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Options added in v0.4.8

type Options func(*ResolverPlugin)

Options is a function to set the options for the plugin

func WithArchivableSchemas added in v0.7.1

func WithArchivableSchemas(schemas []string) Options

WithArchivableSchemas sets schemas that can have a status of archived

func WithEntGeneratedPackage added in v0.4.8

func WithEntGeneratedPackage(entPackage string) Options

WithEntGeneratedPackage sets the ent generated package for imports

func WithExcludeCustomUpdateFields added in v0.4.9

func WithExcludeCustomUpdateFields() Options

WithExcludeCustomUpdateFields excludes custom resolver fields for updates resolvers

func WithGraphQLImport added in v0.13.0

func WithGraphQLImport(graphqlImport string) Options

WithGraphQLImport sets the import path for the graphql package

type ResolverPlugin

type ResolverPlugin struct {
	*resolvergen.Plugin
	// contains filtered or unexported fields
}

ResolverPlugin is a gqlgen plugin to generate resolver functions

func New

func New() *ResolverPlugin

New returns a new resolver plugin

func NewWithOptions added in v0.4.8

func NewWithOptions(opts ...Options) *ResolverPlugin

NewWithOptions returns a new plugin with the given options

func (*ResolverPlugin) GenerateCode

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

GenerateCode implements api.CodeGenerator

func (*ResolverPlugin) Implement

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

Implement gqlgen api.ResolverImplementer

func (ResolverPlugin) Name

func (r ResolverPlugin) Name() string

Name returns the name of the plugin This name must match the upstream resolvergen to replace during code generation

Jump to

Keyboard shortcuts

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