Back to godoc.org

Package federation

v0.12.2
Latest Go to latest

The latest major version is .

Published: Aug 18, 2020 | License: MIT | Module: github.com/99designs/gqlgen

Index

func New

func New() plugin.Plugin

New returns a federation plugin that injects federated directives and types into the schema

type Entity

type Entity struct {
	Name         string      // The same name as the type declaration
	KeyFields    []*KeyField // The fields declared in @key.
	ResolverName string      // The resolver name, such as FindUserByID
	Def          *ast.Definition
	Requires     []*Requires
}

Entity represents a federated type that was declared in the GQL schema.

type KeyField

type KeyField struct {
	Field         *ast.FieldDefinition
	TypeReference *config.TypeReference // The Go representation of that field type
}

type RequireField

type RequireField struct {
	Name          string                // The same name as the type declaration
	NameGo        string                // The Go struct field name
	TypeReference *config.TypeReference // The Go representation of that field type
}

RequireField is similar to an entity but it is a field not an object

type Requires

type Requires struct {
	Name   string          // the name of the field
	Fields []*RequireField // the name of the sibling fields
}

Requires represents an @requires clause

Package Files

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to identifier