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
agartha
10/13/2017, 9:11 AM
Refetch is the most predictable solution
r
rein
10/13/2017, 9:19 AM
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
agartha
10/13/2017, 9:24 AM
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...