Skip to content

Support subscriptions #33

@uesteibar

Description

@uesteibar

It would be great to implement support for subscriptions using websockex. The usage could roughly be:

defmodule SubscriptionExample do
  use Neuron.Subscription

  @url "https://my.awesome.graphql/endpoint"
  @query """
  subscription {
    user {
      name
    }
  }
  """

  def start_link(state) do
    Neuron.Subscription.start_link(@url, @query, __MODULE__, state)
  end

  def handle_update(data, state) do
    IO.puts "Received Update - #{inspect data}"

    {:ok, state}
  end
end

Which would be very similar to how websockex works.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions