View Source GraphQLWSClient.Drivers.Gun (GraphQL-over-Websocket Client v0.1.2)

A driver using the :gun library to connect to the GraphQL websocket.

usage

Usage

The Gun driver is configured as default driver using Jason as default encoder and decoder. However, you still need to install the particular libraries yourself if you want to use them, so add these to your deps.

{:gun, "~> 2.0"},
{:jason, "~> 1.4"},

custom-json-library

Custom JSON Library

To customize the JSON library that is used by the Gun driver, you can set a custom :driver option when starting the client.

GraphQLWSClient.start_link(
  host: "example.com",
  driver: {GraphQLWSClient.Drivers.Gun, json_library: Poison},
  # more options here...
)

Or you can set it in the configuration for your custom client.

import Config

config :my_app, MyGraphQLWSClient,
  driver: {GraphQLWSClient.Drivers.Gun, json_library: Poison}