graphql

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNilRequest = errors.New("graphQL request not provided")

Functions

This section is empty.

Types

type Client

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

func NewClient

func NewClient(endpoint string, options ...ClientOption) *Client

func (*Client) Run

func (c *Client) Run(ctx context.Context, req *Request, res interface{}) error

type ClientOption

type ClientOption func(*Client)

func WithHTTPClient

func WithHTTPClient(httpClient *http.Client) ClientOption

type ClientRunner

type ClientRunner interface {
	Run(ctx context.Context, req *Request, res interface{}) error
}

type Err

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

func (*Err) Error

func (e *Err) Error() string

func (*Err) Unwrap

func (e *Err) Unwrap() error

type ErrResponse

type ErrResponse struct {
	Message string
}

func (*ErrResponse) Error

func (e *ErrResponse) Error() string

type ErrStatus

type ErrStatus struct {
	StatusCode int
	Status     string
}

func (*ErrStatus) Error

func (e *ErrStatus) Error() string

type Request

type Request struct {
	Header http.Header
	// contains filtered or unexported fields
}

func NewRequest

func NewRequest(query string, options ...RequestOption) *Request

func (*Request) GetQuery

func (r *Request) GetQuery() string

func (*Request) GetVariables

func (r *Request) GetVariables() RequestVariables

func (*Request) SetVariable

func (r *Request) SetVariable(key string, value interface{})

type RequestOption

type RequestOption func(*Request)

func WithHTTPHeader

func WithHTTPHeader(httpHeader http.Header) RequestOption

func WithVariables

func WithVariables(variables RequestVariables) RequestOption

type RequestVariables

type RequestVariables map[string]interface{}

Directories

Path Synopsis
providers

Jump to

Keyboard shortcuts

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