Documentation ¶
Index ¶
Constants ¶
View Source
const ( ContentTypeJSON = "application/json" ContentTypeGraphQL = "application/graphql" ContentTypeFormURLEncoded = "application/x-www-form-urlencoded" ContentTypeMultiplartFormData = "multipart/form-data" )
Variables ¶
This section is empty.
Functions ¶
func NewHandlerFunc ¶
func NewHandlerFunc(config HandlerConfig) func(http.ResponseWriter, *http.Request)
NewHandler creates a WebSocket handler for GraphQL WebSocket connections. This handler takes a SubscriptionManager and adds/removes subscriptions as they are started/stopped by the client.
Types ¶
type AuthenticateFunc ¶
AuthenticateFunc is a function that resolves an auth token into a user (or returns an error if that isn't possible).
type Handler ¶
func (*Handler) ContextHandler ¶
func (h *Handler) ContextHandler(w http.ResponseWriter, r *http.Request)
ContextHandler provides an entrypoint into executing graphQL queries with a user-provided context.
type HandlerConfig ¶
type HandlerConfig struct { SubscriptionManager graphqlws.SubscriptionManager Authenticate AuthenticateFunc Secret string Schema *graphql.Schema Context context.Context }
HandlerConfig stores the configuration of a GraphQL handler.
type RequestOptions ¶
type RequestOptions struct { Query string `json:"query" url:"query" schema:"query"` Variables map[string]interface{} `json:"variables" url:"variables" schema:"variables"` OperationName string `json:"operationName" url:"operationName" schema:"operationName"` }
func NewRequestOptions ¶
func NewRequestOptions(r *http.Request) *RequestOptions
NewRequestOptions Parses a http.Request into GraphQL request options struct
type ResultCallbackFn ¶
Click to show internal directories.
Click to hide internal directories.