neuron
neuron copied to clipboard
Support subscriptions
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.
Any update on this feature request?
@churcho not really, I haven't gotten the time to get on this myself, although contributions are always welcome. I'll otherwise eventually build it, but I can't promise when 😄