gqlgen: github.com/99designs/gqlgen/graphql/handler/extension Index | Files

package extension

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

Index

Package Files

apq.go complexity.go introspection.go

type ApqStats Uses

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 Uses

func GetApqStats(ctx context.Context) *ApqStats

type AutomaticPersistedQuery Uses

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 Uses

func (a AutomaticPersistedQuery) ExtensionName() string

func (AutomaticPersistedQuery) MutateOperationParameters Uses

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

func (AutomaticPersistedQuery) Validate Uses

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

type ComplexityLimit Uses

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 Uses

func FixedComplexityLimit(limit int) *ComplexityLimit

FixedComplexityLimit sets a complexity limit that does not change

func (ComplexityLimit) ExtensionName Uses

func (c ComplexityLimit) ExtensionName() string

func (ComplexityLimit) MutateOperationContext Uses

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

func (*ComplexityLimit) Validate Uses

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

type ComplexityStats Uses

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 Uses

func GetComplexityStats(ctx context.Context) *ComplexityStats

type Introspection Uses

type Introspection struct{}

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

func (Introspection) ExtensionName Uses

func (c Introspection) ExtensionName() string

func (Introspection) MutateOperationContext Uses

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

func (Introspection) Validate Uses

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

Package extension imports 9 packages (graph) and is imported by 28 packages. Updated 2020-02-28. Refresh now. Tools for package owners.