mirror of
https://github.com/ash-project/ash_graphql.git
synced 2024-09-20 05:13:33 +12:00
fix: destroys can still have input objects
This commit is contained in:
parent
70bdcf3216
commit
053cef4a65
1 changed files with 52 additions and 54 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue