Documentation ¶
Index ¶
Constants ¶
View Source
const ( ContentTypeJSON = "application/json" ContentTypeGraphQL = "application/graphql" ContentTypeFormURLEncoded = "application/x-www-form-urlencoded" )
Constants
Variables ¶
View Source
var ConnKey any = "conn"
ConnKey the connection key
View Source
var GraphiqlVersion = "1.4.1"
GraphiqlVersion is the current version of GraphiQL
View Source
var PlaygroundVersion = "1.7.27"
PlaygroundVersion the default version to use
Functions ¶
func IsWSUpgrade ¶
Types ¶
type ChanMgr ¶
type ChanMgr struct {
// contains filtered or unexported fields
}
func (*ChanMgr) Add ¶
func (c *ChanMgr) Add(rc *ResultChan)
type FormatErrorFunc ¶
type FormatErrorFunc func(err error) gqlerrors.FormattedError
type GraphiQLOptions ¶
func NewDefaultGraphiQLOptions ¶
func NewDefaultGraphiQLOptions() *GraphiQLOptions
func NewDefaultSSLGraphiQLOption ¶
func NewDefaultSSLGraphiQLOption() *GraphiQLOptions
type Options ¶
type Options struct { Pretty bool RootValueFunc RootValueFunc FormatErrorFunc FormatErrorFunc ContextFunc ContextFunc WSContextFunc ContextFunc ResultCallbackFunc ResultCallbackFunc Logger logger.Logger WS *WSOptions Playground *PlaygroundOptions GraphiQL *GraphiQLOptions }
type PlaygroundOptions ¶
type PlaygroundOptions struct { Version string SSL bool Endpoint string SubscriptionEndpoint string }
func NewDefaultPlaygroundOptions ¶
func NewDefaultPlaygroundOptions() *PlaygroundOptions
func NewDefaultSSLPlaygroundOptions ¶
func NewDefaultSSLPlaygroundOptions() *PlaygroundOptions
type RequestOptions ¶
type RequestOptions struct { Query string `json:"query" url:"query" schema:"query"` Variables map[string]any `json:"variables" url:"variables" schema:"variables"` OperationName string `json:"operationName" url:"operationName" schema:"operationName"` }
RequestOptions options
func GetRequestOptions ¶
func GetRequestOptions(r *http.Request) *RequestOptions
GetRequestOptions Parses a http.Request into GraphQL request options struct without clearning the body
func NewRequestOptions ¶
func NewRequestOptions(r *http.Request) *RequestOptions
NewRequestOptions Parses a http.Request into GraphQL request options struct
type ResultCallbackFunc ¶
type ResultChan ¶
type ResultChan struct {
// contains filtered or unexported fields
}
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func (*Server) ContextHandler ¶
ContextHandler provides an entrypoint into executing graphQL queries with a user-provided context.
type WSOptions ¶
type WSOptions struct {
AuthenticateFunc graphqlws.AuthenticateFunc
}
Source Files ¶
Click to show internal directories.
Click to hide internal directories.