graphql

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GraphQLError

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

type GraphQLErrorLocation

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

type GraphQLRequest

type GraphQLRequest 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 (*GraphQLRequest) ToBody

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

func (*GraphQLRequest) ToRequest

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

type GraphQLResponse

type GraphQLResponse struct {
	Data   map[string]interface{} `json:"data"`
	Errors []GraphQLError         `json:"errors"`
}

func ParseGraphQLResponse

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

Jump to

Keyboard shortcuts

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