gqlerror

package
v2.5.19 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2024 License: MIT Imports: 5 Imported by: 785

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Error

type Error struct {
	Err        error                  `json:"-"`
	Message    string                 `json:"message"`
	Path       ast.Path               `json:"path,omitempty"`
	Locations  []Location             `json:"locations,omitempty"`
	Extensions map[string]interface{} `json:"extensions,omitempty"`
	Rule       string                 `json:"-"`
}

Error is the standard graphql error type described in https://spec.graphql.org/draft/#sec-Errors

func ErrorLocf

func ErrorLocf(file string, line int, col int, message string, args ...interface{}) *Error

func ErrorPathf

func ErrorPathf(path ast.Path, message string, args ...interface{}) *Error

func ErrorPosf

func ErrorPosf(pos *ast.Position, message string, args ...interface{}) *Error

func Errorf

func Errorf(message string, args ...interface{}) *Error

func Wrap added in v2.5.2

func Wrap(err error) *Error

func WrapIfUnwrapped added in v2.5.9

func WrapIfUnwrapped(err error) *Error

func WrapPath

func WrapPath(path ast.Path, err error) *Error

func (*Error) AsError added in v2.5.9

func (err *Error) AsError() error

func (*Error) Error

func (err *Error) Error() string

func (*Error) SetFile

func (err *Error) SetFile(file string)

func (*Error) Unwrap added in v2.1.0

func (err *Error) Unwrap() error

type List

type List []*Error

func (List) As added in v2.2.0

func (errs List) As(target interface{}) bool

func (List) Error

func (errs List) Error() string

func (List) Is added in v2.2.0

func (errs List) Is(target error) bool

func (List) Unwrap added in v2.5.11

func (errs List) Unwrap() []error

type Location

type Location struct {
	Line   int `json:"line,omitempty"`
	Column int `json:"column,omitempty"`
}

Jump to

Keyboard shortcuts

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