Access Mutation Data
Hello Guys,
What is the best way to access data returned by a mutation?
This functions returns the new created invitation
I tried mutation.data.data but it doesnt always works. Also i dont know if its better to access in the onSuccess Function or just after the block.
Does anyone know a reliable way to access this returned data.
Thanks in advance
4 Replies
sunny-greenOP•2y ago
I thing i got it.
is this the best way?:
conscious-sapphire•2y ago
Depends on what you want to do. OnSuccess only gives you a callback. Mutation.data gives you the option to use it in a component.
sunny-greenOP•2y ago
I just need the data returned from rhe mutation since i need the id for a email that will be sent
So i guess this is the best way
I got now
conscious-sapphire•2y ago
Yeah, that should work 🙂