gqlerrors

package
v0.2.4 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ValidationFailedError = "GRAPHQL_VALIDATION_FAILED"
	UndefinedError        = "UNDEFINED_ERROR"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Error

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

Error represents a graphql error

func NewError

func NewError(code string, err error) *Error

NewError returns a graphql error with the given code and message

func (*Error) Error

func (e *Error) Error() string

type ErrorList

type ErrorList []*Error

ErrorList represents a list of errors

func ExtendErrorList

func ExtendErrorList(errs ErrorList, err error) ErrorList

ExtendErrorList adds provided err as *Error

func FormatError

func FormatError(err error) ErrorList

func (ErrorList) Error

func (list ErrorList) Error() string

Error returns a string representation of each 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