handler

package
v0.17.60 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2024 License: MIT Imports: 11 Imported by: 544

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetInitPayload added in v0.6.0

func GetInitPayload(ctx context.Context) transport.InitPayload

func GraphQL deprecated

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

Deprecated: switch to graphql/handler.New

func Playground deprecated

func Playground(title, endpoint string) http.HandlerFunc

Deprecated: use playground.Handler instead

Types

type Config deprecated

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

Deprecated: switch to graphql/handler.New

type InitPayload deprecated added in v0.6.0

type InitPayload = transport.InitPayload

Deprecated: use transport.InitPayload instead

type Option deprecated

type Option func(cfg *Config)

Deprecated: switch to graphql/handler.New

func CacheSize added in v0.5.0

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 added in v0.5.0

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 added in v0.8.2

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 added in v0.9.1

func EnablePersistedQueryCache(cache PersistedQueryCache) Option

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

func ErrorPresenter

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 added in v0.7.0

func IntrospectionEnabled(enabled bool) Option

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

func RecoverFunc deprecated

func RecoverFunc(recoverFn graphql.RecoverFunc) Option

Deprecated: switch to graphql/handler.New

func RequestMiddleware

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

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 added in v0.9.0

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 added in v0.9.0

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 added in v0.9.1

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 added in v0.7.2

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 WebsocketPingPongDuration added in v0.15.0

func WebsocketPingPongDuration(duration time.Duration) Option

func WebsocketUpgrader deprecated

func WebsocketUpgrader(upgrader websocket.Upgrader) Option

Deprecated: switch to graphql/handler.New

type PersistedQueryCache added in v0.9.1

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

Jump to

Keyboard shortcuts

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