View Source GraphQLWSClient.Client behaviour (GraphQL-over-Websocket Client v0.1.0)
A behaviour that is implemented by modules that use GraphQLWSClient
.
Link to this section Summary
Callbacks
Closes the connection to the server.
Connects to the server.
Connects to the server. Raises on error
Sends a query to the server and returns the result.
Sends a query to the server and returns the result. Raises on error.
Starts the client.
Sends a subscription to the server and returns the subscription ID.
Sends a subscription to the server and returns the subscription ID. Raises on error.
Removes the subscription for the given subscription ID.
Removes the subscription for the given subscription ID. Raises on error.
Link to this section Callbacks
@callback close(timeout()) :: :ok
Closes the connection to the server.
@callback open(timeout()) :: :ok | {:error, Exception.t()}
Connects to the server.
Connects to the server. Raises on error
@callback query(GraphQLWSClient.query(), map(), timeout()) :: {:ok, any()} | {:error, Exception.t()}
Sends a query to the server and returns the result.
@callback query!(GraphQLWSClient.query(), map(), timeout()) :: any() | no_return()
Sends a query to the server and returns the result. Raises on error.
@callback start_link(GenServer.options()) :: GenServer.on_start()
Starts the client.
@callback subscribe(GraphQLWSClient.query(), map(), pid(), timeout()) :: {:ok, GraphQLWSClient.subscription_id()} | {:error, Exception.t()}
Sends a subscription to the server and returns the subscription ID.
@callback subscribe!(GraphQLWSClient.query(), map(), pid(), timeout()) :: GraphQLWSClient.subscription_id() | no_return()
Sends a subscription to the server and returns the subscription ID. Raises on error.
@callback unsubscribe(GraphQLWSClient.subscription_id(), timeout()) :: :ok | {:error, Exception.t()}
Removes the subscription for the given subscription ID.
@callback unsubscribe!(GraphQLWSClient.subscription_id(), timeout()) :: :ok | no_return()
Removes the subscription for the given subscription ID. Raises on error.