graphql

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Error added in v0.0.5

type Error struct {
	Message    string                 `json:"message"`
	Locations  []ErrorLocation        `json:"locations,omitempty"`
	Path       []interface{}          `json:"path,omitempty"`
	Extensions map[string]interface{} `json:"extensions,omitempty"`
}

type ErrorLocation added in v0.0.5

type ErrorLocation struct {
	Line   int `json:"line"`
	Column int `json:"column"`
}

type Request added in v0.0.5

type Request struct {
	Query string `json:"query"`
	// A map of variable names to the value of that variable. Allowed value types are strings, numeric types, and booleans
	Variables     map[string]interface{} `json:"variables,omitempty"`
	OperationName string                 `json:"operationName,omitempty"`
}

func (*Request) ToBody added in v0.0.5

func (request *Request) ToBody() ([]byte, error)

func (*Request) ToRequest added in v0.0.5

func (request *Request) ToRequest(ctx context.Context, url string) (*http.Request, error)

type Response added in v0.0.5

type Response struct {
	// We use a jsonnode.Object here because it maintains the order of the keys in a JSON object
	Data   jsonnode.Object `json:"data"`
	Errors []Error         `json:"errors"`
}

func ParseGraphQLResponse

func ParseGraphQLResponse(body io.ReadCloser) (*Response, error)

Jump to

Keyboard shortcuts

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