maple v0.3.0 Maple.Clients.WebsocketApollo View Source

Implements an adapter to resolve the GraphQL subscriptions over a web socket connection. This adapter implements the graphql-ws sub-protocol for Apollo servers. See [https://github.com/apollographql/subscriptions-transport-ws/blob/master/PROTOCOL.md](https://github.com/apollographql/subscriptions-transport-ws/blob/master/PROTOCOL.md) for more details.

You could write your own adapter as long as it conforms to the Maple.Behaviours.WebsocketAdapter behaviour.

Link to this section Summary

Functions

Callback after websocket connects

Callback after incoming data

Starts the websocket connection, registers the callback in the state, completes the initial handshacke and sends the subscription request

Link to this section Functions

Link to this function handle_connect(conn, state) View Source
handle_connect(%WebSockex.Conn{cacerts: term, conn_mod: term, extra_headers: term, host: term, insecure: term, path: term, port: term, query: term, socket: term, socket_connect_timeout: term, socket_recv_timeout: term, transport: term}, map) :: {:ok, map}

Callback after websocket connects

Link to this function handle_frame(frame, state) View Source
handle_frame({:text, String.t}, map) :: {:ok, map}

Callback after incoming data

Link to this function start_link(query, params, callback) View Source
start_link(String.t, map, function) :: atom

Starts the websocket connection, registers the callback in the state, completes the initial handshacke and sends the subscription request.