github.com/operandinc/gqlgen@v0.16.1/plugin/plugin.go (about)

     1  // plugin package interfaces are EXPERIMENTAL.
     2  
     3  package plugin
     4  
     5  import (
     6  	"github.com/operandinc/gqlgen/codegen"
     7  	"github.com/operandinc/gqlgen/codegen/config"
     8  	"github.com/vektah/gqlparser/v2/ast"
     9  )
    10  
    11  type Plugin interface {
    12  	Name() string
    13  }
    14  
    15  type ConfigMutator interface {
    16  	MutateConfig(cfg *config.Config) error
    17  }
    18  
    19  type CodeGenerator interface {
    20  	GenerateCode(cfg *codegen.Data) error
    21  }
    22  
    23  // EarlySourceInjector is used to inject things that are required for user schema files to compile.
    24  type EarlySourceInjector interface {
    25  	InjectSourceEarly() *ast.Source
    26  }
    27  
    28  // LateSourceInjector is used to inject more sources, after we have loaded the users schema.
    29  type LateSourceInjector interface {
    30  	InjectSourceLate(schema *ast.Schema) *ast.Source
    31  }