...

Package fieldset

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

Overview ▾

type Field

Field represents a single field in a FieldSet

type Field []string

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

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.

type Set []Field

func New

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

New parses a FieldSet string into a TinyFieldSet.