Reuse a mutation with dependency #1341
-
Hi, I am little confused on a use case and could use some help. Currently I handle this in the component like
My question is, how do I make the The only way I can think of is in the mutation fn to check the cache first or fetch the order. Is this an acceptable way? Or is the more better way to do it?
Or..., For my app almost every mutation depends on the |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
I would add it to the custom
if you change the return type to something like this, you can spread it onto a button and it will be disabled as long as you have no orderId:
|
Beta Was this translation helpful? Give feedback.
I would add it to the custom
useOrder
hook, or create another one:if you change the return type to something like this, you can spread it onto a button and it will be disabled as long as you have no orderId: