extension

package
v0.14.1 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2021 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ApqStats

type ApqStats struct {
	// The hash of the incoming query
	Hash string

	// SentQuery is true if the incoming request sent the full query
	SentQuery bool
}

func GetApqStats

func GetApqStats(ctx context.Context) *ApqStats

type AutomaticPersistedQuery

type AutomaticPersistedQuery struct {
	Cache graphql.Cache
}

AutomaticPersistedQuery saves client upload by optimistically sending only the hashes of queries, if the server does not yet know what the query is for the hash it will respond telling the client to send the query along with the hash in the next request. see https://github.com/apollographql/apollo-link-persisted-queries

func (AutomaticPersistedQuery) ExtensionName

func (a AutomaticPersistedQuery) ExtensionName() string

func (AutomaticPersistedQuery) MutateOperationParameters

func (a AutomaticPersistedQuery) MutateOperationParameters(ctx context.Context, rawParams *graphql.RawParams) *gqlerror.Error

func (AutomaticPersistedQuery) Validate

type ComplexityLimit

type ComplexityLimit struct {
	Func func(ctx context.Context, rc *graphql.OperationContext) int
	// contains filtered or unexported fields
}

ComplexityLimit allows you to define a limit on query complexity

If a query is submitted that exceeds the limit, a 422 status code will be returned.

func FixedComplexityLimit

func FixedComplexityLimit(limit int) *ComplexityLimit

FixedComplexityLimit sets a complexity limit that does not change

func (ComplexityLimit) ExtensionName

func (c ComplexityLimit) ExtensionName() string

func (ComplexityLimit) MutateOperationContext

func (c ComplexityLimit) MutateOperationContext(ctx context.Context, rc *graphql.OperationContext) *gqlerror.Error

func (*ComplexityLimit) Validate

func (c *ComplexityLimit) Validate(schema graphql.ExecutableSchema) error

type ComplexityStats

type ComplexityStats struct {
	// The calculated complexity for this request
	Complexity int

	// The complexity limit for this request returned by the extension func
	ComplexityLimit int
}

func GetComplexityStats

func GetComplexityStats(ctx context.Context) *ComplexityStats

type Introspection

type Introspection struct{}

EnableIntrospection enables clients to reflect all of the types available on the graph.

func (Introspection) ExtensionName

func (c Introspection) ExtensionName() string

func (Introspection) MutateOperationContext

func (c Introspection) MutateOperationContext(ctx context.Context, rc *graphql.OperationContext) *gqlerror.Error

func (Introspection) Validate

func (c Introspection) Validate(schema graphql.ExecutableSchema) error

Jump to

Keyboard shortcuts

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