gqlerrors

package
v0.8.1 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2023 License: MIT Imports: 9 Imported by: 429

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FieldASTsToNodeASTs

func FieldASTsToNodeASTs(fieldASTs []*ast.Field) []ast.Node

Types

type Error

type Error struct {
	Message       string
	Stack         string
	Nodes         []ast.Node
	Source        *source.Source
	Positions     []int
	Locations     []location.SourceLocation
	OriginalError error
	Path          []interface{}
}

func NewError

func NewError(message string, nodes []ast.Node, stack string, source *source.Source, positions []int, origError error) *Error

func NewErrorWithPath added in v0.7.6

func NewErrorWithPath(message string, nodes []ast.Node, stack string, source *source.Source, positions []int, path []interface{}, origError error) *Error

func NewLocatedError

func NewLocatedError(err interface{}, nodes []ast.Node) *Error

NewLocatedError creates a graphql.Error with location info @deprecated 0.4.18 Already exists in `graphql.NewLocatedError()`

func NewSyntaxError

func NewSyntaxError(s *source.Source, position int, description string) *Error

func (Error) Error

func (g Error) Error() string

implements Golang's built-in `error` interface

type ExtendedError added in v0.7.6

type ExtendedError interface {
	error
	Extensions() map[string]interface{}
}

type FormattedError

type FormattedError struct {
	Message    string                    `json:"message"`
	Locations  []location.SourceLocation `json:"locations"`
	Path       []interface{}             `json:"path,omitempty"`
	Extensions map[string]interface{}    `json:"extensions,omitempty"`
	// contains filtered or unexported fields
}

func FormatError

func FormatError(err error) FormattedError

func FormatErrors

func FormatErrors(errs ...error) []FormattedError

func NewFormattedError

func NewFormattedError(message string) FormattedError

func (FormattedError) Error

func (g FormattedError) Error() string

func (FormattedError) OriginalError added in v0.7.7

func (g FormattedError) OriginalError() error

type FormattedErrors

type FormattedErrors []FormattedError

func (FormattedErrors) Len

func (errs FormattedErrors) Len() int

func (FormattedErrors) Less

func (errs FormattedErrors) Less(i, j int) bool

func (FormattedErrors) Swap

func (errs FormattedErrors) Swap(i, j int)

Jump to

Keyboard shortcuts

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