Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var (
CloseDeadlineDuration time.Duration = 100 * time.Millisecond
)
Functions ¶
Types ¶
type Config ¶ added in v0.2.0
type Config struct {
WS *websocket.Conn
Schema *graphql.Schema
Logger *logger.LogWrapper
Request *http.Request
KeepAlive time.Duration
Roots *options.Roots
ContextValueFunc func(c protocols.Context, msg protocols.OperationMessage, execArgs graphql.Params) (context.Context, gqlerrors.FormattedErrors)
OnConnect func(c protocols.Context, payload interface{}) interface{}
OnDisconnect func(c protocols.Context)
OnOperation func(c protocols.Context, msg StartMessage, params *graphql.Params) (*graphql.Params, error)
OnOperationComplete func(c protocols.Context, id string)
}
ConnectionConfig defines the configuration parameters of a GraphQL WebSocket connection.
type ExecutionResult ¶ added in v0.2.0
type ExecutionResult struct {
Errors gqlerrors.FormattedErrors `json:"errors,omitempty"`
Data interface{} `json:"data,omitempty"`
Extensions map[string]interface{} `json:"extensions,omitempty"`
}
ExecutionResult result of an execution
type StartMessage ¶ added in v0.2.0
type StartMessage struct {
ID string `json:"id,omitempty"`
Type protocols.MessageType `json:"type"`
Payload StartMessagePayload `json:"payload,omitempty"`
}
type StartMessagePayload ¶
type StartMessagePayload struct {
Query string `json:"query"`
Variables map[string]interface{} `json:"variables"`
OperationName string `json:"operationName"`
}
StartMessagePayload defines the parameters of an operation that a client requests to be started.
func (*StartMessagePayload) Validate ¶ added in v0.2.0
func (s *StartMessagePayload) Validate() error
Click to show internal directories.
Click to hide internal directories.