View Source GraphQLWSClient.Event (GraphQL Websocket Client v2.0.2)

A event for a subscription.

The struct consists of these fields:

  • :payload - Either the result, an error or nil, dependent on the :type field.
  • :subscription_id - A UUID identifying the subscription. This matches the subscription ID that is returned by GraphQLWSClient.subscribe/3.
  • :type - Indicates whether the event contains payload data (:next), there is no more data to receive (:complete) or an error occurred (:error).

Summary

Types

@type complete() :: %GraphQLWSClient.Event{
  payload: nil,
  subscription_id: GraphQLWSClient.subscription_id(),
  type: :complete
}
@type error() :: %GraphQLWSClient.Event{
  payload: Exception.t(),
  subscription_id: GraphQLWSClient.subscription_id(),
  type: :error
}
@type next() :: %GraphQLWSClient.Event{
  payload: any(),
  subscription_id: GraphQLWSClient.subscription_id(),
  type: :next
}
@type t() :: complete() | error() | next()