graphql

package module
v0.1.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: 8 Imported by: 0

README

graphql-client

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client is a client for interacting with a GraphQL API.

func NewClient

func NewClient(url string, httpClient *http.Client, logger *logr.Logger) *Client

NewClient makes a new Client capable of making GraphQL requests.

func (*Client) RawRequest

func (c *Client) RawRequest(ctx context.Context, query string, variables map[string]interface{}) (*GraphQLResponse, error)

type GraphQLError

type GraphQLError []struct {
	Message   string
	Locations []struct {
		Line   int
		Column int
	}
}

type GraphQLResponse

type GraphQLResponse struct {
	StatusCode      int
	ResponseContent []byte
	Data            *json.RawMessage
	Errors          GraphQLError
	Extensions      *json.RawMessage
}

Jump to

Keyboard shortcuts

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