Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrInvalidInput = errors.New("cannot send files with PostFields option") ErrCreateVariablesField = errors.New("create variables field") ErrEncodeVariablesField = errors.New("encode variables") ErrCreateFile = errors.New("create form file") ErrReadBody = errors.New("read body") ErrDecode = errors.New("decode") ErrCopy = errors.New("copy") ErrRequest = errors.New("graphql: server returned a non-200 status code") )
Functions ¶
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func NewClient ¶
func NewClient(endpoint string, opts ...ClientOption) *Client
NewClient makes a new Client capable of making GraphQL requests.
type ClientOption ¶
type ClientOption func(*Client)
func ImmediatelyCloseReqBody ¶
func ImmediatelyCloseReqBody() ClientOption
ImmediatelyCloseReqBody will close the req body immediately after each request body is ready
func UseMultipartForm ¶
func UseMultipartForm() ClientOption
UseMultipartForm uses multipart/form-data and activates support for files.
func WithHTTPClient ¶
func WithHTTPClient(httpclient HTTPRequestDoer) ClientOption
WithHTTPClient specifies the underlying http.Client to use when making requests.
NewClient(endpoint, WithHTTPClient(specificHTTPClient))
type GraphError ¶
func (GraphError[T]) GetExtensions ¶
func (e GraphError[T]) GetExtensions() T
type GraphqlError ¶
type HTTPRequestDoer ¶
type QueryVariables ¶
type Request ¶
func NewRequest ¶
NewRequest makes a new Request with the specified string.
func (*Request) File ¶
File sets a file to upload. Files are only supported with a Client that was created with the UseMultipartForm option.
Click to show internal directories.
Click to hide internal directories.