engine

package
v0.0.0-...-01ef8d7 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2020 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Engine

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

func NewEngine

func NewEngine(schema string, hasBinaryTargets bool) *Engine

func (*Engine) Connect

func (e *Engine) Connect() error

func (*Engine) Disconnect

func (e *Engine) Disconnect() error

func (*Engine) Do

func (e *Engine) Do(ctx context.Context, query string, response interface{}) error

Do sends the http Request to the query engine and unmarshals the response

func (*Engine) Request

func (e *Engine) Request(ctx context.Context, method string, path string, payload interface{}) ([]byte, error)

type GQLError

type GQLError struct {
	Message    string                 `json:"error"` // note: the query-engine uses 'error' instead of 'message'
	Path       []string               `json:"path"`
	Extensions map[string]interface{} `json:"query"`
}

GQLError is a GraphQL Error

type GQLRequest

type GQLRequest struct {
	Query         string                 `json:"query"`
	Variables     map[string]interface{} `json:"variables"`
	OperationName *string                `json:"operationName"`
}

GQLRequest is the payload for GraphQL queries

type GQLResponse

type GQLResponse struct {
	Data       interface{}            `json:"data"`
	Errors     []GQLError             `json:"errors"`
	Extensions map[string]interface{} `json:"extensions"`
}

GQLResponse is the payload for a GraphQL response

Jump to

Keyboard shortcuts

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