2 Replies
Wohooo @XMDim, you just became a Waspeteer level 1!
Hi @XMDim. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
----------------------
Wasp’s useQuery hook is a wrapper around react-query’s useQuery, and it supports an options object as the third argument. You can use this options object to specify an onSuccess callback, just like you would with react-query.
Here’s how you can use the onSuccess option with Wasp’s useQuery:
This works because Wasp passes the options object directly to react-query’s useQuery under the hood, as described in the documentation:
Wasp's useQuery hook accepts three arguments: ... options: A react-query options object. Use this to change the default behavior for this particular Query.The useQuery Hook – API Reference So, you can use onSuccess, onError, and other react-query options with Wasp’s useQuery. ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ---------------------- Sorry @XMDim, I seem to be having a bit of trouble. Don't worry though, I've pinged my support and they will try to fix me up! :technologist: Perhaps try again in 15mins?