Skip to content

Commit

Permalink
fix: define map input types w/ nested input types
Browse files Browse the repository at this point in the history
  • Loading branch information
zachdaniel committed Feb 5, 2024
1 parent 099540c commit d00ae4e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 2 additions & 0 deletions lib/graphql/resolver.ex
Original file line number Diff line number Diff line change
Expand Up @@ -2106,10 +2106,12 @@ defmodule AshGraphql.Graphql.Resolver do
end
end

# sobelow_skip ["DOS.StringToAtom"]
defp mutation_result_type(mutation_name) do
String.to_atom("#{mutation_name}_result")
end

# sobelow_skip ["DOS.StringToAtom"]
defp page_type(resource, pagination, relay?) do
type = AshGraphql.Resource.Info.type(resource)

Expand Down
8 changes: 4 additions & 4 deletions lib/resource/resource.ex
Original file line number Diff line number Diff line change
Expand Up @@ -2664,10 +2664,10 @@ defmodule AshGraphql.Resource do
attribute.type.graphql_input_type(attribute.constraints)

true ->
map_type(resource, attribute.name, _input? = true)
map_type(resource, attribute.name, true)
end
else
map_type(resource, attribute.name, _input? = true)
map_type(resource, attribute.name, true)
end
else
nil
Expand Down Expand Up @@ -2833,10 +2833,10 @@ defmodule AshGraphql.Resource do
name: to_string(name),
type:
if Keyword.get(attribute, :allow_nil?, true) do
do_field_type(type, nil, nil, false)
do_field_type(type, nil, nil, true)
else
%Absinthe.Blueprint.TypeReference.NonNull{
of_type: do_field_type(type, nil, nil, false)
of_type: do_field_type(type, nil, nil, true)
}
end
}
Expand Down

0 comments on commit d00ae4e

Please sign in to comment.