gqlclient

package
v0.0.0-...-7426b64 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: BSD-3-Clause Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BearerTokenProvider

type BearerTokenProvider interface {
	BearerToken() string
}

type Client

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

func New

func New(url string, timeout time.Duration) *Client

func NewWithOpts

func NewWithOpts(url string, timeout time.Duration, opts ...graphql.ClientOption) *Client

func (*Client) EnableDebugLog

func (c *Client) EnableDebugLog()

EnableDebugLog turns on debug logging

func (*Client) Run

func (c *Client) Run(request Request, response interface{}) error

func (*Client) RunWithContext

func (c *Client) RunWithContext(ctx context.Context, request Request, response interface{}) error

func (*Client) SetDebug

func (c *Client) SetDebug(b bool)

func (*Client) SetTokenProvider

func (c *Client) SetTokenProvider(tokenProvider BearerTokenProvider)

type File

type File struct {
	Field string
	Name  string
	R     io.Reader
}
type Header map[string][]string

type JsonRequest

type JsonRequest struct {
	Query     string                 `json:"query"`
	Variables map[string]interface{} `json:"variables"`
}

type Request

type Request interface {
	Query() string
	Vars() (map[string]interface{}, error)
}

type Request0

type Request0 interface {
	Query() string
	Vars() map[string]interface{}
}

type RequestError

type RequestError struct {
	Request Request
	// contains filtered or unexported fields
}

func NewRequestError

func NewRequestError(err error, req Request) *RequestError

func (*RequestError) Error

func (e *RequestError) Error() string

func (*RequestError) Unwrap

func (e *RequestError) Unwrap() error

type RequestWithFiles

type RequestWithFiles interface {
	Request
	Files() []File
}

type StandardizedErrors

type StandardizedErrors struct {
	Message string
	Error   string
	Errors  []graphErr
}

StandardizedErrors works around API's that don't follow the graphql standard It looks redundant because it needs to address two different API responses. https://activestatef.atlassian.net/browse/PB-4291

func (StandardizedErrors) HasErrors

func (e StandardizedErrors) HasErrors() bool

func (StandardizedErrors) Values

func (e StandardizedErrors) Values() []string

Values tells us all the relevant error messages returned. We don't include e.Error because it's an unhelpful generic error code redundant with the message.

Jump to

Keyboard shortcuts

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