View Source GraphQLWSClient.Config (GraphQL-over-Websocket Client v0.1.2)
A struct containing the configuration for a client.
Link to this section Summary
Functions
Builds a new config.
Link to this section Types
@type t() :: %GraphQLWSClient.Config{ backoff_interval: non_neg_integer(), connect_on_start: boolean(), connect_timeout: timeout(), driver: module() | {module(), Keyword.t() | %{optional(atom()) => any()}}, host: String.t(), init_payload: any(), init_timeout: timeout(), path: String.t(), port: :inet.port_number(), upgrade_timeout: timeout() }
Link to this section Functions
Builds a new config.
options
Options
:backoff_interval
- The number of milliseconds to wait before trying to reconnect to the server.:connect_on_start
- Determines whether to immediately connect to the server as soon as the client is started. When set tofalse
, you need to manually connect by callingGraphQLWSClient.open/1
. Defaults totrue
.:connect_timeout
- The connection timeout. Defaults to5000
.:driver
- The driver module to use. Defaults toGraphQLWSClient.Drivers.Gun
.:host
- The host to connect to. This is ignored when:url
is specified instead.:init_payload
- The payload send together with theconnection_init
message. Is useful when you need to authenticate a connection with a token, for instance.:init_timeout
- The number of milliseconds to wait for aconnection_ack
after initiating the connection. Defaults to5000
.:path
- The path on the server. This is ignored when:url
is specified instead. Defaults to"/"
.:port
- The port to connect to. This is ignored when:url
is specified instead.:upgrade_timeout
- The number of milliseconds to wait for a connection upgrade. Defaults to5000
.:url
- The URL of the websocket to connect to. Overwrites the:host
,:port
and:path
options.