...

Package extension

import "github.com/99designs/gqlgen/graphql/handler/extension"
Overview
Index

Overview ▾

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

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

type AutomaticPersistedQuery struct {
    Cache graphql.Cache
}

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

func (a AutomaticPersistedQuery) Validate(schema graphql.ExecutableSchema) error

type ComplexityLimit

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.

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

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

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

type Introspection struct{}

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