gqlclient

package
v0.0.0-...-c2e30b8 Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2021 License: NIST-PD-fallback Imports: 10 Imported by: 0

Documentation

Overview

Package gqlclient provides a GraphQL client.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	HTTPClient http.Client
	// contains filtered or unexported fields
}

Client is a GraphQL client.

func New

func New(uri string) (*Client, error)

New creates a Client.

func (*Client) Close

func (c *Client) Close() error

Close blocks until all pending operations have concluded.

func (*Client) Do

func (c *Client) Do(query string, vars interface{}, key string, res interface{}) error

Do executes an operation on the GraphQL server.

query: a GraphQL document, may contain only one query or mutation.

func (*Client) DoOperation

func (c *Client) DoOperation(query, op string, vars interface{}, key string, res interface{}) error

DoOperation executes an operation on the GraphQL server.

query: a GraphQL document, may contain multiple operations.
op: operation name.
vars: query variables.
key: if non-empty, unmarshal result.data[key] instead of result.data.
res: pointer to result struct.

Jump to

Keyboard shortcuts

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