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

package handler

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

Index

Package Files

handler.go

func GetInitPayload Uses

func GetInitPayload(ctx context.Context) transport.InitPayload

func GraphQL Uses

func GraphQL(exec graphql.ExecutableSchema, options ...Option) http.HandlerFunc

Deprecated: switch to graphql/handler.New

func Playground Uses

func Playground(title string, endpoint string) http.HandlerFunc

Deprecated: use playground.Handler instead

type Config Uses

type Config struct {
    // contains filtered or unexported fields
}

Deprecated: switch to graphql/handler.New

type InitPayload Uses

type InitPayload = transport.InitPayload

Deprecated: use transport.InitPayload instead

type Option Uses

type Option func(cfg *Config)

Deprecated: switch to graphql/handler.New

func CacheSize Uses

func CacheSize(size int) Option

CacheSize sets the maximum size of the query cache. If size is less than or equal to 0, the cache is disabled. Deprecated: switch to graphql/handler.New

func ComplexityLimit Uses

func ComplexityLimit(limit int) Option

ComplexityLimit sets a maximum query complexity that is allowed to be executed. If a query is submitted that exceeds the limit, a 422 status code will be returned. Deprecated: switch to graphql/handler.New

func ComplexityLimitFunc Uses

func ComplexityLimitFunc(complexityLimitFunc func(ctx context.Context) int) Option

ComplexityLimitFunc allows you to define a function to dynamically set the maximum query complexity that is allowed to be executed. If a query is submitted that exceeds the limit, a 422 status code will be returned. Deprecated: switch to graphql/handler.New

func EnablePersistedQueryCache Uses

func EnablePersistedQueryCache(cache PersistedQueryCache) Option

Add cache that will hold queries for automatic persisted queries (APQ) Deprecated: switch to graphql/handler.New

func ErrorPresenter Uses

func ErrorPresenter(f graphql.ErrorPresenterFunc) Option

ErrorPresenter transforms errors found while resolving into errors that will be returned to the user. It provides a good place to add any extra fields, like error.type, that might be desired by your frontend. Check the default implementation in graphql.DefaultErrorPresenter for an example. Deprecated: switch to graphql/handler.New

func IntrospectionEnabled Uses

func IntrospectionEnabled(enabled bool) Option

IntrospectionEnabled = false will forbid clients from calling introspection endpoints. Can be useful in prod when you dont want clients introspecting the full schema. Deprecated: switch to graphql/handler.New

func RecoverFunc Uses

func RecoverFunc(recover graphql.RecoverFunc) Option

Deprecated: switch to graphql/handler.New

func RequestMiddleware Uses

func RequestMiddleware(middleware graphql.ResponseMiddleware) Option

RequestMiddleware allows you to define a function that will be called around the root request, after the query has been parsed. This is useful for logging Deprecated: switch to graphql/handler.New

func ResolverMiddleware Uses

func ResolverMiddleware(middleware graphql.FieldMiddleware) Option

ResolverMiddleware allows you to define a function that will be called around every resolver, useful for logging. Deprecated: switch to graphql/handler.New

func UploadMaxMemory Uses

func UploadMaxMemory(size int64) Option

UploadMaxMemory sets the maximum number of bytes used to parse a request body as multipart/form-data in memory, with the remainder stored on disk in temporary files. Deprecated: switch to graphql/handler.New

func UploadMaxSize Uses

func UploadMaxSize(size int64) Option

UploadMaxSize sets the maximum number of bytes used to parse a request body as multipart/form-data. Deprecated: switch to graphql/handler.New

func WebsocketInitFunc Uses

func WebsocketInitFunc(websocketInitFunc transport.WebsocketInitFunc) Option

WebsocketInitFunc is called when the server receives connection init message from the client. This can be used to check initial payload to see whether to accept the websocket connection. Deprecated: switch to graphql/handler.New

func WebsocketKeepAliveDuration Uses

func WebsocketKeepAliveDuration(duration time.Duration) Option

WebsocketKeepAliveDuration allows you to reconfigure the keepalive behavior. By default, keepalive is enabled with a DefaultConnectionKeepAlivePingInterval duration. Set handler.connectionKeepAlivePingInterval = 0 to disable keepalive altogether. Deprecated: switch to graphql/handler.New

func WebsocketUpgrader Uses

func WebsocketUpgrader(upgrader websocket.Upgrader) Option

Deprecated: switch to graphql/handler.New

type PersistedQueryCache Uses

type PersistedQueryCache interface {
    Add(ctx context.Context, hash string, query string)
    Get(ctx context.Context, hash string) (string, bool)
}

Package handler imports 10 packages (graph) and is imported by 53 packages. Updated 2020-01-21. Refresh now. Tools for package owners.