handler

package
v0.0.0-...-c52f24a Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2018 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GraphQL

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

func Playground

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

Types

type Config

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

type Option

type Option func(cfg *Config)

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.

func RecoverFunc

func RecoverFunc(recover graphql.RecoverFunc) Option

func RequestMiddleware

func RequestMiddleware(middleware graphql.RequestMiddleware) 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 and tracing

func ResolverMiddleware

func ResolverMiddleware(middleware graphql.ResolverMiddleware) Option

ResolverMiddleware allows you to define a function that will be called around every resolver, useful for tracing and logging. It will only be called for user defined resolvers, any direct binding to models is assumed to cost nothing.

func WebsocketUpgrader

func WebsocketUpgrader(upgrader websocket.Upgrader) Option

Jump to

Keyboard shortcuts

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