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