What is the best way to handle upserts in a <soft-...
# orm-help
r
What is the best way to handle upserts in a soft-delete middleware? I tried adding
params.args.where.deletedAt = null
, but that throws an error because
Copy code
Argument where of type PostWhereUniqueInput needs exactly one argument, but you provided id and deletedAt. Please choose one.
The first idea that comes to mind is to intercept the call, check if the resource exists or not, then replace the action with
create
or
update
, but honestly, this doesn’t sound right.