middleware

package
v0.0.0-...-f15f0a0 Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2021 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PanicHandler

func PanicHandler(ctx context.Context, err interface{}) error

PanicHandler logs all panics from graphql handler.

Sec: DON'T log requests because of sensitive data.

Types

type ErrorModifier

type ErrorModifier struct{}

ErrorModifier intercepts error messages and modifies them accordingly.

func (ErrorModifier) ExtensionName

func (interceptor ErrorModifier) ExtensionName() string

ExtensionName returns extension's name.

func (ErrorModifier) InterceptResponse

func (interceptor ErrorModifier) InterceptResponse(ctx context.Context, next graphql.ResponseHandler) *graphql.Response

InterceptResponse modifies error messages with "internal system error". And removes client errors if present. It prevents the client user from fixing the wrong issues.

func (ErrorModifier) Validate

func (interceptor ErrorModifier) Validate(schema graphql.ExecutableSchema) error

Validate an interface impl does nothing.

Jump to

Keyboard shortcuts

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