Documentation
¶
Index ¶
Constants ¶
View Source
const ( // Client sends this message after plain websocket connection to start the communication with the server GQL_CONNECTION_INIT = "connection_init" // The server may responses with this message to the GQL_CONNECTION_INIT from client, indicates the server rejected the connection. GQL_CONNECTION_ERROR = "connection_error" // Client sends this message to execute GraphQL operation GQL_START = "start" // Client sends this message in order to stop a running GraphQL operation execution (for example: unsubscribe) GQL_STOP = "stop" // Server sends this message upon a failing operation, before the GraphQL execution, usually due to GraphQL validation errors (resolver errors are part of GQL_DATA message, and will be added as errors array) GQL_ERROR = "error" // The server sends this message to transfter the GraphQL execution result from the server to the client, this message is a response for GQL_START message. GQL_DATA = "data" // Server sends this message to indicate that a GraphQL operation is done, and no more data will arrive for the specific operation. GQL_COMPLETE = "complete" // Server message that should be sent right after each GQL_CONNECTION_ACK processed and then periodically to keep the client connection alive. // The client starts to consider the keep alive message only upon the first received keep alive message from the server. GQL_CONNECTION_KEEP_ALIVE = "ka" // The server may responses with this message to the GQL_CONNECTION_INIT from client, indicates the server accepted the connection. May optionally include a payload. GQL_CONNECTION_ACK = "connection_ack" // Client sends this message to terminate the connection. GQL_CONNECTION_TERMINATE = "connection_terminate" // Unknown operation type, for logging only GQL_UNKNOWN = "unknown" // Internal status, for logging only GQL_INTERNAL = "internal" )
View Source
const DisconnectPayload = "{\"type\":\"connection_error\"}"
View Source
const PingPayload = "{\"type\":\"ka\"}"
Variables ¶
This section is empty.
Functions ¶
func IdToIdentifier ¶
func IdentifierToId ¶
Types ¶
type Config ¶
type Executor ¶
type Executor struct {
// contains filtered or unexported fields
}
Handling Apollo commands and transforming them into Action Cable commands
type GraphqlOperation ¶
type GraphqlOperation struct {
Id string `json:"id,omitempty"`
Type string `json:"type"`
Payload interface{} `json:"payload,omitempty"`
}
func (*GraphqlOperation) PayloadString ¶
func (op *GraphqlOperation) PayloadString() (string, error)
func (*GraphqlOperation) ToJSON ¶
func (op *GraphqlOperation) ToJSON() []byte
type GraphqlQuery ¶
type GraphqlQuery struct {
Query string `json:"query"`
Variables interface{} `json:"variables,omitempty"`
OperationName string `json:"operationName,omitempty"`
OperationId string `json:"operationId,omitempty"`
// Required for Action Cable compatibility
Action string `json:"action,omitempty"`
}
func (*GraphqlQuery) ToJSON ¶
func (op *GraphqlQuery) ToJSON() []byte
Click to show internal directories.
Click to hide internal directories.