Documentation
¶
Overview ¶
Package gqlgencfed provides a gqlgenc plugin that generates typed Go clients whose methods call the Federation v2 query planner directly instead of an HTTP gateway.
Usage with the modified gqlgenc generator.Generate:
err = generator.Generate(ctx, cfg,
api.ReplacePlugin(gqlgencfed.New(queryDoc, opDocs, cfg.Client, cfg.Generate,
supergraphSDL)),
)
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Plugin ¶
type Plugin struct {
// contains filtered or unexported fields
}
Plugin is the federation code-gen plugin for gqlgenc. It replaces clientgenv2.Plugin (shares the name "clientgen") and renders typed clients that call generated federation_exec.go directly.
func New ¶
func New( queryDocument *ast.QueryDocument, operationQueryDocuments []*ast.QueryDocument, client gqlgenConfig.PackageConfig, generateConfig *gqlgencConfig.GenerateConfig, supergraphSDL string, ) *Plugin
New constructs the plugin with pre-parsed query documents. supergraphSDL is the original Federation v2 supergraph SDL (with federation metadata); it is used to build per-operation plan specs at generation time.
func NewWithFilePaths ¶
func NewWithFilePaths( queryFilePaths []string, client gqlgenConfig.PackageConfig, generateConfig *gqlgencConfig.GenerateConfig, supergraphSDL string, ) *Plugin
NewWithFilePaths constructs the plugin with query file paths. supergraphSDL is the original Federation v2 supergraph SDL (with federation metadata); it is used to build per-operation plan specs at generation time.
func (*Plugin) MutateConfig ¶
func (p *Plugin) MutateConfig(cfg *gqlgenConfig.Config) error
MutateConfig mirrors clientgenv2.Plugin.MutateConfig but calls RenderFederationTemplate.