graphql

package
v0.73.4 Latest Latest
Warning

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

Go to latest
Published: May 3, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const APIOrigin = "https://g.replicated.com/graphql"

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	GQLServer *url.URL
	Token     string
}

Client communicates with the Replicated Vendor GraphQL API.

func NewClient

func NewClient(origin string, apiKey string) *Client

func (*Client) ExecuteRequest

func (c *Client) ExecuteRequest(requestObj Request, deserializeTarget interface{}) error

type Error

type Error struct {
	Locations []map[string]interface{} `json:"locations"`
	Message   string                   `json:"message"`
	Code      string                   `json:"code"`
}

Error represents an error returned by the graphql server

type GQLError

type GQLError interface {
	GraphQLError() []Error
}

type Request

type Request struct {
	Query         string                 `json:"query,omitempty"`
	Variables     map[string]interface{} `json:"variables"`
	OperationName string                 `json:"operationName"`
}

Request is a json-serializable request to the graphql server

type ResponseErrorOnly

type ResponseErrorOnly struct {
	Errors []Error `json:"errors,omitempty"`
}

func (ResponseErrorOnly) GraphQLError

func (r ResponseErrorOnly) GraphQLError() []Error

Jump to

Keyboard shortcuts

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