handlerx

package
v0.0.13 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2021 License: MIT Imports: 20 Imported by: 3

Documentation

Index

Constants

View Source
const (
	ErrDecodeJson   = 422
	ErrInvalidParam = 400
)

Variables

This section is empty.

Functions

func NewDefaultServer

func NewDefaultServer(es graphql.ExecutableSchema) *handler.Server

func RegisterPrinter added in v0.0.13

func RegisterPrinter(printer Printer)

func SetupHTTP2GraphQLMapping

func SetupHTTP2GraphQLMapping(operation RESTOperationMappingType, selection RESTSelectionMappingType,
	arguments RESTArgumentsMappingType, argInputs RESTArgumentsMappingType)

Types

type ArgNameArgTypePair added in v0.0.9

type ArgNameArgTypePair map[string]string

type DELETE

type DELETE struct{}

DELETE implements the DELETE side of the default HTTP transport defined in https://github.com/APIs-guru/graphql-over-http#post

func (DELETE) Do

func (DELETE) Supports

func (h DELETE) Supports(r *http.Request) bool

type ErrorCode

type ErrorCode int

2. Global Error Codes

type GET

type GET struct{}

GET implements the GET side of the default HTTP transport defined in https://github.com/APIs-guru/graphql-over-http#get

func (GET) Do

func (GET) Supports

func (h GET) Supports(r *http.Request) bool

type Options

type Options struct{}

Options responds to http OPTIONS and HEAD requests

func (Options) Do

func (Options) Supports

func (o Options) Supports(r *http.Request) bool

type POST

type POST struct{}

POST implements the POST side of the default HTTP transport defined in https://github.com/APIs-guru/graphql-over-http#post

func (POST) Do

func (POST) Supports

func (h POST) Supports(r *http.Request) bool

type Printer added in v0.0.13

type Printer interface {
	Println(v ...interface{})
	Printf(format string, v ...interface{})
}

type RESTArgumentsMappingType added in v0.0.9

type RESTArgumentsMappingType map[string]ArgNameArgTypePair

GraphQL Operation => Operation Arguments Pair of <ArgName,ArgType>

type RESTOperationMappingType added in v0.0.9

type RESTOperationMappingType map[string]string

1. Global Declaration REST URL => GraphQL Operation

type RESTResponse added in v0.0.9

type RESTResponse struct {
	Code    int             `json:"code"`
	Message string          `json:"message,omitempty"`
	Data    json.RawMessage `json:"data"`
}

RESTResponse is response struct for RESTful API call @see graphql.Response

type RESTSelectionMappingType added in v0.0.9

type RESTSelectionMappingType map[string]string

GraphQL Operation => Fields Selection

Jump to

Keyboard shortcuts

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