hey guys, I was wondering, if you deleted an enti...
# prisma-whats-new
r
hey guys, I was wondering, if you deleted an entity via a mutation and that entity was previously part of an array of another query. Is it better to do use the
update
feature and pass in an empty array manually or just refetch that query.
a
Refetch is the most predictable solution
r
I realised there might be an in between solution. Take the id thats returned from the deletion and delete the object with that id from the array
a
As long as it's a single object, and it didn't have any child relations that you also need to clean up, that's fine. But if you add relations to it at a later stage, you're probably going to switch to refetch anyways. Don't optimize too soon, it's easier to maintain...
r
got it, ill keep that in mind
thanks!
😎 1