options

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ContextFunc

type ContextFunc func(t RequestType, r *http.Request) context.Context

type FormatErrorFunc

type FormatErrorFunc func(err error) gqlerrors.FormattedError

type Option

type Option func(opts *Options)

func WithContextFunc

func WithContextFunc(f ContextFunc) Option

func WithFormatErrorFunc

func WithFormatErrorFunc(f FormatErrorFunc) Option

func WithGraphiQLOptions

func WithGraphiQLOptions(o *ide.GraphiQLOptions) Option

func WithLogFunc

func WithLogFunc(l logger.LogFunc) Option

func WithPlaygroundOptions

func WithPlaygroundOptions(o *ide.PlaygroundOptions) Option

func WithPretty

func WithPretty() Option

func WithResultCallbackFunc

func WithResultCallbackFunc(f ResultCallbackFunc) Option

func WithRootValueFunc

func WithRootValueFunc(f RootValueFunc) Option

func WithWebsocketContextFunc

func WithWebsocketContextFunc(f ContextFunc) Option

type Options

type Options struct {
	Pretty             bool
	RootValueFunc      RootValueFunc
	WSRootsFunc        WSRootsFunc
	FormatErrorFunc    FormatErrorFunc
	ContextFunc        ContextFunc
	WSContextFunc      ContextFunc
	ResultCallbackFunc ResultCallbackFunc
	LogFunc            logger.LogFunc
	WS                 *WSOptions
	Playground         *ide.PlaygroundOptions
	GraphiQL           *ide.GraphiQLOptions
}

type RequestType

type RequestType string
const (
	RequestTypeHTTP RequestType = "http"
	RequestTypeWS   RequestType = "ws"
)

type ResultCallbackFunc

type ResultCallbackFunc func(ctx context.Context, params *graphql.Params, result *graphql.Result, responseBody []byte)

type RootValueFunc

type RootValueFunc func(ctx context.Context, r *http.Request) map[string]interface{}

type Roots

type Roots struct {
	Query        map[string]interface{}
	Mutation     map[string]interface{}
	Subscription map[string]interface{}
}

type WSOptions

type WSOptions struct {
}

type WSRootsFunc

type WSRootsFunc func(ctx context.Context, r *http.Request) *Roots

Jump to

Keyboard shortcuts

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