graph

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2019 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GQLError added in v1.1.2

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

GQLError represents a GraphQL error

func (GQLError) Error added in v1.1.2

func (gqlerr GQLError) Error() string

type Graph

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

Graph represents the graph resolution engine

func New

func New(
	str store.Store,
	validator validator.Validator,
	sessionKeyGenerator sesskeygen.SessionKeyGenerator,
	passwordHasher passhash.PasswordHasher,
	shield gqlshield.GraphQLShield,
) (*Graph, error)

New creates a new graph resolver instance

func (*Graph) Query

func (graph *Graph) Query(
	ctx context.Context,
	query Query,
) ([]byte, error)

Query executes a graph query and returns a JSON encoded result (or an error)

type Query

type Query struct {
	Query         []byte
	OperationName string
	Variables     map[string]*string
}

Query represents the graph query structure

type Response

type Response struct {
	Data  []byte
	Error *ResponseError
}

Response represents a response object

type ResponseError

type ResponseError struct {
	Code    string
	Message string
}

ResponseError represents a response error object

func (*ResponseError) Error

func (err *ResponseError) Error() string

Error implements the error interface

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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