diff --git a/lib/absinthe/blueprint/schema/enum_type_definition.ex b/lib/absinthe/blueprint/schema/enum_type_definition.ex index fa8fe7f882..59951c605f 100644 --- a/lib/absinthe/blueprint/schema/enum_type_definition.ex +++ b/lib/absinthe/blueprint/schema/enum_type_definition.ex @@ -30,7 +30,6 @@ defmodule Absinthe.Blueprint.Schema.EnumTypeDefinition do errors: [Absinthe.Phase.Error.t()] } - @spec build(t, any) :: Absinthe.Type.Enum.t() def build(type_def, _schema) do %Absinthe.Type.Enum{ identifier: type_def.identifier, diff --git a/lib/absinthe/schema/notation/sdl_render.ex b/lib/absinthe/schema/notation/sdl_render.ex index 9eda182dfb..e7fb38b700 100644 --- a/lib/absinthe/schema/notation/sdl_render.ex +++ b/lib/absinthe/schema/notation/sdl_render.ex @@ -109,7 +109,14 @@ defmodule Absinthe.Schema.Notation.SDL.Render do nil value when is_atom(value) -> - definition = Enum.find(type_definitions, fn d -> input_value.type == d.identifier end) + typ = + case input_value.type do + %Absinthe.Blueprint.TypeReference.NonNull{of_type: t} -> t + %Absinthe.Blueprint.TypeReference.List{of_type: t} -> t + t -> t + end + + definition = Enum.find(type_definitions, fn d -> typ == d.identifier end) case definition do nil -> diff --git a/test/absinthe/schema/sdl_render_test.exs b/test/absinthe/schema/sdl_render_test.exs index 2eb9db992f..cb4e584ba9 100644 --- a/test/absinthe/schema/sdl_render_test.exs +++ b/test/absinthe/schema/sdl_render_test.exs @@ -198,7 +198,7 @@ defmodule Absinthe.Schema.SdlRenderTest do arg :times, :integer, default_value: 10, description: "The number of times" arg :time_interval, :integer arg :time_string, :string, default_value: "2021" - arg :order_status, :order_status, default_value: :processing + arg :order_status, non_null(:order_status), default_value: :processing end field :search, :search_result @@ -259,7 +259,7 @@ defmodule Absinthe.Schema.SdlRenderTest do timeString: String = "2021" - orderStatus: OrderStatus = PROCESSING + orderStatus: OrderStatus! = PROCESSING ): String search: SearchResult }