graphql

package
v2.31.2 Latest Latest
Warning

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

Go to latest
Published: Feb 2, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsHttp

func IsHttp(err error) bool

IsHttp asserts httpError.

func IsInvalidConfig

func IsInvalidConfig(err error) bool

IsInvalidConfig asserts invalidConfigError.

func IsQuery

func IsQuery(err error) bool

IsQuery asserts queryError.

func IsResponseErrorCollection

func IsResponseErrorCollection(err error) bool

Types

type Client

type Client interface {
	ExecuteQuery(ctx context.Context, query string, variables map[string]string, v interface{}) error
}

type ClientImpl

type ClientImpl struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient(config ClientImplConfig) (*ClientImpl, error)

func (*ClientImpl) ExecuteQuery

func (c *ClientImpl) ExecuteQuery(ctx context.Context, query string, variables map[string]string, v interface{}) error

type ClientImplConfig

type ClientImplConfig struct {
	HttpClient *http.Client
	Url        string
}

type ResponseError

type ResponseError struct {
	Message    string                  `json:"message"`
	Locations  []ResponseErrorLocation `json:"locations"`
	Path       []interface{}           `json:"path"`
	Extensions map[string]interface{}  `json:"extensions"`
}

ResponseError as defined per GraphQL spec.

https://spec.graphql.org/June2018/#sec-Errors

type ResponseErrorCollection

type ResponseErrorCollection []ResponseError

func (ResponseErrorCollection) Error

func (r ResponseErrorCollection) Error() string

type ResponseErrorLocation

type ResponseErrorLocation struct {
	Line   int `json:"line"`
	Column int `json:"column"`
}

Jump to

Keyboard shortcuts

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