Documentation
¶
Index ¶
Constants ¶
View Source
const ( ContentTypeJSON = "application/json" ContentTypeGraphQL = "application/graphql" ContentTypeFormURLEncoded = "application/x-www-form-urlencoded" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
Schema *graphql.Schema
Pretty bool
GraphiQL bool
Playground bool
WebSocket bool
RootObjectFn RootObjectFn
ResultCallbackFn ResultCallbackFn
FormatErrorFn func(err error) gqlerrors.FormattedError
}
type GraphQLWSMessage ¶
type GraphQLWSMessage struct {
ID any `json:"id"`
Type string `json:"type"`
Payload json.RawMessage `json:"payload"`
}
type Handler ¶
type Handler struct {
Schema *graphql.Schema
ModifyContextOnHeaders func(ctx context.Context, headers map[string]string) context.Context
// contains filtered or unexported fields
}
func (*Handler) ContextHandler ¶
ContextHandler provides an entrypoint into executing graphQL queries with a user-provided context.
func (*Handler) ContextWebsocketHandler ¶
func (h *Handler) ContextWebsocketHandler(ctx context.Context, w http.ResponseWriter, r *http.Request)
ContextHandler provides an entrypoint into executing graphQL queries and subscriptions with user-provided context.
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
RequestOptions Parses a http.Request into GraphQL request options struct
type ResultCallbackFn ¶
type RootObjectFn ¶
RootObjectFn allows a user to generate a RootObject per request
Click to show internal directories.
Click to hide internal directories.