I think I’m running into a bug. When you delete a ...
# prisma-whats-new
g
I think I’m running into a bug. When you delete a node, the mutation result should be able to return all the fields of the deleted node. It doesn’t look like its returning any relations though. I’m just getting null for those fields
n
@gmuresan Thanks for the report, we're aware of this current limitation. It's captured in this feature request: https://github.com/graphcool/feature-requests/issues/108
g
thanks
y
@gmuresan Just curious. When would you need this kind of functionality?
n
For now you have to query the node before deleting it 🙂
g
I have a tree of objects. object A contains many object B. Object B contains many object C. When I want to delete an object C, I want to use updateQueries to remove C from B without doing a refetch
I can just iterate through all the B’s and find out which one contains the deleted C
n
Right I see
g
but it would be easier if I knew exactly which B to look in
n
yea it might be worth to query it beforehand
g
is there a better way to do this?
n
I don't see a better way currently
g
I have the query already. but in the update queries callback I don’t have access to the React props
for apollo
n
I can just iterate through all the B’s and find out which one contains the deleted C
are you literally iterating them? You can use
filter
g
not literally
filter still iterates anyway
n
right
looks like the best approach