handler

package
v0.0.0-...-08ddf37 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2017 License: ISC Imports: 8 Imported by: 3

Documentation

Overview

Package handler implements an HTTP interface to a Schema.

It is intended to serve as an example rather than a full implementation.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Error

type Error struct {
	Message string `json:"message"`
}

Error represents an error the occured while parsing a graphql query or while generating a response.

type ExecutorHandler

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

ExecutorHandler makes a executor.Executor querable via HTTP

func New

func New(executor *executor.Executor) *ExecutorHandler

New constructs a ExecutorHandler from a executor.

func (*ExecutorHandler) ServeHTTP

func (h *ExecutorHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)

ServeHTTP provides an entrypoint into a graphql executor. It pulls the query from the 'q' GET parameter.

type Result

type Result struct {
	Trace interface{} `json:"__trace_info,omitempty"`
	Data  interface{} `json:"data,omitempty"`
	Error *Error      `json:"error,omitempty"`
}

Result represents a graphql query result.

Jump to

Keyboard shortcuts

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