absinthe v1.4.16 Absinthe.Subscription.Pubsub behaviour View Source

Pubsub behaviour expected by Absinthe to power subscriptions

Absinthe does not require any particular backend to support subscriptions, but it does require that any candidate pubsub implement a couple of functions.

In addition to the type signatures there are a couple of recommended implementation suggestions associated with each function, be sure to read the docs for each.

Note: with the Absinthe.Phoenix package a Phoenix endpoint can be used for pubsub.

Link to this section Summary

Callbacks

Publish the results of a particular subscription document. This should be a local node broadcast. If you can

Subscribe the current process via a given topic

Link to this section Types

Link to this section Callbacks

Link to this callback publish_mutation(proxy_topic, mutation_result, subscribed_fields) View Source
publish_mutation(
  proxy_topic :: binary(),
  mutation_result :: term(),
  subscribed_fields :: list()
) :: term()
Link to this callback publish_subscription(topic, data) View Source
publish_subscription(topic :: binary(), data :: map()) :: term()

Publish the results of a particular subscription document. This should be a local node broadcast. If you can

Link to this callback subscribe(topic) View Source
subscribe(topic :: binary()) :: term()

Subscribe the current process via a given topic