Help us shape the future of Go! Take the 2026 Go Developer Survey

graphqlfields

package
v3.19.0 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2026 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package graphqlfields renders GraphQL fragment bodies from a per-service field registry and a caller-supplied selection. Fields sharing a non-empty Container are grouped under `<container> { ... }`.

Nested template references (e.g. `{{ template "UserCoreBasic" }}`) are passed through verbatim; callers parse the returned string as part of the outer template tree.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildFragment

func BuildFragment(registry []Field, selected []string) (string, error)

BuildFragment renders selected fields in registry order. Unknown names return an error before rendering.

Types

type Field

type Field struct {
	Name      string
	Fragment  string
	Container string
}

Field maps a logical name to a GraphQL fragment. Container groups related fields under a single wrapping block (e.g. work-item widgets under `features { ... }`).

Jump to

Keyboard shortcuts

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