     conn
   end
 
-  defp allow_graphiql? do
+  defp allow_graphiql?(opts) do
     config = Application.get_env(:plug_graphql, __MODULE__, [])
-    Keyword.get(config, :allow_graphiql, false)
+    allow? = Keyword.get(config, :allow_graphiql, false)
+    Map.merge(opts, %{allow_graphiql?: allow?})
   end
 end

    conn = assign(conn, :graphql_options, opts)
    conn = super(conn, opts)

    conn = if allow_graphiql? do
      GraphQL.Plug.GraphiQL.call(conn, opts)
    else
      GraphQL.Plug.Endpoint.call(conn, opts)

    json_decoder: Poison

  def init(opts) do
    opts
    |> GraphQL.Plug.Endpoint.init
    |> allow_graphiql?
  end

  def call(conn, opts) do
