absinthe-graphql / absinthe_plug

Plug support for Absinthe, the GraphQL toolkit for Elixir
https://hex.pm/packages/absinthe_plug
MIT License
260 stars 163 forks source link

Subscription broker #274

Open maartenvanvliet opened 2 years ago

maartenvanvliet commented 2 years ago

Previously subscriptions over HTTP were handled through SSE. This commits adds a callback so the user can choose to handle it differently. It's modelled after how graphl-ruby does it.

I think this gives the flexibility to the user to implement their own subscription broker implementation. It gives access to the http request to be changed in a way the user sees fit. There's still some work to be done on the Absinthe side for a user, though this can be done in userland by replacing some phases.

absinthe_phoenix could use a similar callback.

See https://github.com/absinthe-graphql/absinthe_plug/pull/217 for previous work.