Documentation ¶
Index ¶
Constants ¶
View Source
const (
AbsintheWSSubProtocol = "absinthe"
)
View Source
const (
// This might seem confusing, but the protocol is called graphql-ws and uses "graphql-transport-ws" as subprotocol
GraphQLWSSubprotocol = "graphql-transport-ws"
)
View Source
const (
// Again, this is not a typo. Somehow they managed to give each protocol name to the other's subprotocol identifier.
SubscriptionsTransportWSSubprotocol = "graphql-ws"
)
Variables ¶
This section is empty.
Functions ¶
func IsSupportedSubprotocol ¶
func Subprotocols ¶
func Subprotocols() []string
Types ¶
type Message ¶
type Message struct { ID string Type MessageType Payload json.RawMessage }
type MessageType ¶
type MessageType int
MessageType indicates the type of the message received from the client
const ( MessageTypePing MessageType = iota + 1 MessageTypePong MessageTypeSubscribe MessageTypeComplete MessageTypeTerminate )
type Proto ¶
type Proto interface { Subprotocol() string // Initialize starts the protocol and returns the initial payload received from the client Initialize() (json.RawMessage, error) ReadMessage() (*Message, error) Pong(*Message) error WriteGraphQLData(id string, data json.RawMessage, extensions json.RawMessage) error WriteGraphQLErrors(id string, errors json.RawMessage, extensions json.RawMessage) error // Done is sent to indicate the requested operation is done and no more results will come in Done(id string) error }
Click to show internal directories.
Click to hide internal directories.