zf

zenflows testing
git clone https://s.sonu.ch/~srfsh/zf.git
Log | Files | Refs | Submodules | README | LICENSE

no_subscription_on_http.ex (432B)


      1 defmodule Absinthe.GraphiQL.Validation.NoSubscriptionOnHTTP do
      2   @moduledoc false
      3 
      4   use Absinthe.Phase
      5 
      6   alias Absinthe.Blueprint
      7 
      8   def run(blueprint, _) do
      9     case Blueprint.current_operation(blueprint) do
     10       %{type: :subscription} ->
     11         {:error,
     12          {:http_method,
     13           "Subscriptions cannot be run over HTTP. Please configure a websocket connection"}}
     14 
     15       _ ->
     16         {:ok, blueprint}
     17     end
     18   end
     19 end