Documentation
¶
Index ¶
- Constants
- func DbgPrint(r *http.Request, format string, v ...interface{})
- func HTTPRequest2GraphQLQuery(r *http.Request, params *graphql.RawParams, body []byte) (string, error)
- func NewDefaultServer(es graphql.ExecutableSchema) *handler.Server
- func SetupHTTP2GraphQLMapping(operation RESTOperationType, selection RESTSelectionType, ...)
- type ArgumentsType
- type DELETE
- type ErrorCode
- type GET
- type Options
- type POST
- type ParamType
- type RESTArgumentsType
- type RESTOperationType
- type RESTSelectionType
Constants ¶
View Source
const ( ErrDecodeJson = 422 ErrInvalidParam = 400 )
Variables ¶
This section is empty.
Functions ¶
func NewDefaultServer ¶
func NewDefaultServer(es graphql.ExecutableSchema) *handler.Server
func SetupHTTP2GraphQLMapping ¶
func SetupHTTP2GraphQLMapping(operation RESTOperationType, selection RESTSelectionType, arguments RESTArgumentsType, inputs RESTArgumentsType)
Types ¶
type ArgumentsType ¶
GraphQL Operation => Operation Arguments Pair of <ArgName,ArgType>
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 (h DELETE) Do(w http.ResponseWriter, r *http.Request, exec graphql.GraphExecutor)
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 (h GET) Do(w http.ResponseWriter, r *http.Request, exec graphql.GraphExecutor)
type Options ¶
type Options struct{}
Options responds to http OPTIONS and HEAD requests
func (Options) Do ¶
func (o Options) Do(w http.ResponseWriter, r *http.Request, exec graphql.GraphExecutor)
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 (h POST) Do(w http.ResponseWriter, r *http.Request, exec graphql.GraphExecutor)
type RESTArgumentsType ¶
type RESTArgumentsType map[string]ArgumentsType
type RESTOperationType ¶
1. 类型声明 REST URL => GraphQL Operation
type RESTSelectionType ¶
GraphQL Operation => Fields Selection
Click to show internal directories.
Click to hide internal directories.