I want to write a middleware where I test if data received from the subscription is authorized (even though I can subscribe to specific topics/ids/… I just want to add that additional security).
For this I need to know in the Absinthe middleware whether I deal with a WebSocket or an http connection. What is the best way to test this?
For now I write unless match?(%{conn: _}, resolution.context)
but this might not be safe, not sure.