gqlidgen

package
v0.0.0-...-476b611 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(modelDir string, modelPackage string) plugin.Plugin

Types

type CodegenTemplateData

type CodegenTemplateData struct {
	*codegen.Data
	AddedImports     []string
	NodeImplementors []nodeImplementor
}

type ConfigMutateTemplateData

type ConfigMutateTemplateData struct {
	NodeImplementors []string
}

type Plugin

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

func (*Plugin) GenerateCode

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

func (*Plugin) MutateConfig

func (m *Plugin) MutateConfig(cfg *config.Config) error

MutateConfig will generate stub ID() implementations for any type in the schema that implements the Node interface. This is necessary because gqlgen needs to see that an ID() method exists in order to bind to it, but that binding step happens before gqlgen invokes code generation callbacks, so the real ID() implementations we generate in GenerateCode() below won't exist yet.

func (*Plugin) Name

func (m *Plugin) Name() string

Jump to

Keyboard shortcuts

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