Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var (
CloseDeadlineDuration time.Duration = 100 * time.Millisecond
)
Functions ¶
Types ¶
type Config ¶
type Config struct {
WS *websocket.Conn
Schema *graphql.Schema
Logger *logger.LogWrapper
Request *http.Request
KeepAlive time.Duration
RootValueFunc func(ctx context.Context, r *http.Request, op *ast.OperationDefinition) map[string]interface{}
ContextValueFunc func(c protocol.Context, msg protocol.OperationMessage, execArgs graphql.Params) (context.Context, gqlerrors.FormattedErrors)
OnConnect func(c protocol.Context, payload interface{}) (interface{}, error)
OnDisconnect func(c protocol.Context)
OnOperation func(c protocol.Context, msg StartMessage, params *graphql.Params) (*graphql.Params, error)
OnOperationComplete func(c protocol.Context, id string)
}
ConnectionConfig defines the configuration parameters of a GraphQL WebSocket connection.
type StartMessage ¶
type StartMessage struct {
ID string `json:"id,omitempty"`
Type protocol.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 ¶
func (s *StartMessagePayload) Validate() error
Click to show internal directories.
Click to hide internal directories.