Skip to content

Commit

Permalink
Dummy implementation of a fix
Browse files Browse the repository at this point in the history
  • Loading branch information
binaryseed committed Apr 4, 2018
1 parent 79a915e commit 88e5461
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions lib/absinthe/type/built_ins/introspection.ex
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,10 @@ defmodule Absinthe.Type.BuiltIns.Introspection do
%{serialize: serializer} ->
{:ok, inspect(serializer.(value))}

map when is_map(map) ->
externalized = to_external(value)
{:ok, inspect(externalized)}

_ ->
{:ok, to_string(value)}
end
Expand All @@ -293,6 +297,15 @@ defmodule Absinthe.Type.BuiltIns.Introspection do
end
end

def to_external(map) when is_map(map) do
Enum.into(map, %{}, fn {key, value} ->
{Absinthe.Adapter.LanguageConventions.to_external_name(to_string(key), :argument),
to_external(value)}
end)
end

def to_external(value), do: value

object :__enumvalue, name: "__EnumValue" do
field :name, :string

Expand Down

0 comments on commit 88e5461

Please sign in to comment.