gqlgencfed

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Jun 19, 2026 License: MIT Imports: 11 Imported by: 0

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.

func (*Plugin) Name

func (p *Plugin) Name() string

Name returns "clientgen" so api.ReplacePlugin swaps this for the default plugin.

Jump to

Keyboard shortcuts

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