Skip to content

module

graphql_ws

graphql-ws: how GraphQL subscriptions run over a WebSocket.

Enums

  • Event

    A message from the server.

Functions

init

pub fn init() -> String

The message that opens a connection.

pong

pub fn pong() -> String

The answer to the server's ping.

read

pub fn read(text: &str) -> Event

Read a message from the server.

subscribe

pub fn subscribe(query: &str, variables: Option<&Value>) -> String

The message that starts a subscription to query, with variables.

Constants

PROTOCOL

pub const PROTOCOL: &str = "graphql-transport-ws";

The WebSocket subprotocol of GraphQL subscriptions: graphql-transport-ws.