Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion lib/absinthe/plug/graphiql.ex
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,6 @@ defmodule Absinthe.Plug.GraphiQL do
interface: :playground | :advanced | :simple,
default_headers: {module, atom},
default_url: binary,
assets: Keyword.t(),
socket: module,
socket_url: binary
]
Expand Down
12 changes: 7 additions & 5 deletions lib/absinthe/plug/graphiql/assets.ex
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ defmodule Absinthe.Plug.GraphiQL.Assets do
@moduledoc """
"""

@config Application.compile_env(:absinthe_plug, Absinthe.Plug.GraphiQL)
@default_config [
source: :smart,
local_url_path: "/absinthe_graphiql",
Expand Down Expand Up @@ -72,10 +71,13 @@ defmodule Absinthe.Plug.GraphiQL.Assets do
]}
]

if @config do
def assets_config, do: Keyword.merge(@default_config, Keyword.get(config, :assets, []))
else
def assets_config, do: @default_config
def assets_config do
runtime_config =
:absinthe_plug
|> Application.get_env(Absinthe.Plug.GraphiQL, [])
|> Keyword.get(:assets, [])

Keyword.merge(@default_config, runtime_config)
end

def get_assets do
Expand Down