package fieldset

import "github.com/99designs/gqlgen/plugin/federation/fieldset"

Index

Types

type Field

type Field []string

Field represents a single field in a FieldSet

func (Field) FieldDefinition

func (f Field) FieldDefinition(schemaType *ast.Definition, schema *ast.Schema) *ast.FieldDefinition

FieldDefinition looks up a field in the type.

func (Field) Join

func (f Field) Join(str string) string

Join concatenates the field parts with a string separator between. Useful in templates.

func (Field) JoinGo

func (f Field) JoinGo(str string) string

JoinGo concatenates the Go name of field parts with a string separator between. Useful in templates.

func (Field) LastIndex

func (f Field) LastIndex() int

func (Field) ToGo

func (f Field) ToGo() string

ToGo converts a (possibly nested) field into a proper public Go name.

func (Field) ToGoPrivate

func (f Field) ToGoPrivate() string

ToGoPrivate converts a (possibly nested) field into a proper private Go name.

func (Field) TypeReference

func (f Field) TypeReference(obj *codegen.Object, objects codegen.Objects) *codegen.Field

TypeReference looks up the type of a field.

type Set

type Set []Field

Set represents a FieldSet that is used in federation directives @key and @requires. Would be happier to reuse FieldSet parsing from gqlparser, but this suits for now.

func New

func New(raw string, prefix []string) Set

New parses a FieldSet string into a TinyFieldSet.

Source Files

fieldset.go

Version
v0.17.73 (latest)
Published
May 2, 2025
Platform
linux/amd64
Imports
5 packages
Last checked
6 days ago

Tools for package owners.