introspectionfilter

package module
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2022 License: MIT Imports: 4 Imported by: 2

README

gqlgen-introspect-filter

Go Reference

Filter GQLGen's Introspection by your application's business logic.

// Use as a GQLGen plugin
exec.Use(introspectionfilter.Plugin{
	Schema:      schema,
	
	// Write filter functions to choose if various parts are included.
	FieldFilter: func(fd *ast.FieldDefinition) bool { return fd.Name != "text" },
})

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DirectiveFilter

type DirectiveFilter func(ctx context.Context, d *ast.DirectiveDefinition) bool

type EnumFilter

type EnumFilter func(ctx context.Context, d *ast.EnumValueDefinition) bool

type FieldFilter

type FieldFilter func(ctx context.Context, d *ast.FieldDefinition) bool

type InputFieldFilter

type InputFieldFilter func(ctx context.Context, d *ast.FieldDefinition) bool

type Plugin

type Plugin struct {
	FieldFilter     FieldFilter
	TypeFilter      TypeFilter
	DirectiveFilter DirectiveFilter
	EnumFilter      EnumFilter
	// contains filtered or unexported fields
}

func (*Plugin) ExtensionName

func (*Plugin) ExtensionName() string

func (*Plugin) InterceptField

func (p *Plugin) InterceptField(ctx context.Context, next graphql.Resolver) (res interface{}, err error)

func (*Plugin) Validate

func (p *Plugin) Validate(schema graphql.ExecutableSchema) error

type SortPlugin

type SortPlugin struct{}

SortPlugin is a plugin that sorts the result of introspection queries. Deprecated: GQLGen now sorts the result of introspection queries automatically. This plugin is now a no-op.

func (SortPlugin) ExtensionName

func (SortPlugin) ExtensionName() string

func (SortPlugin) InterceptField

func (SortPlugin) InterceptField(ctx context.Context, next graphql.Resolver) (res interface{}, err error)

func (SortPlugin) Validate

func (SortPlugin) Validate(schema graphql.ExecutableSchema) error

type TypeFilter

type TypeFilter func(ctx context.Context, d *ast.Definition) bool

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

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