fix: destroys can still have input objects

This commit is contained in:
Zach Daniel 2021-05-21 10:56:10 -04:00
parent 70bdcf3216
commit 053cef4a65

View file

@ -366,13 +366,11 @@ defmodule AshGraphql.Resource do
action = Ash.Resource.Info.action(resource, mutation.action)
args =
case(
mutation_fields(
case mutation_fields(
resource,
schema,
action,
mutation.type
)
) do
[] ->
[]
@ -530,9 +528,6 @@ defmodule AshGraphql.Resource do
__reference__: ref(__ENV__)
}
if mutation.type == :destroy do
[result]
else
case mutation_fields(
resource,
schema,
@ -553,7 +548,6 @@ defmodule AshGraphql.Resource do
[input, result]
end
end
end)
end
@ -626,6 +620,9 @@ defmodule AshGraphql.Resource do
)
attribute_fields =
if action.type == :destroy && !action.soft? do
[]
else
resource
|> Ash.Resource.Info.public_attributes()
|> Enum.filter(fn attribute ->
@ -654,6 +651,7 @@ defmodule AshGraphql.Resource do
__reference__: ref(__ENV__)
}
end)
end
argument_fields =
action.arguments