You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I need to use a standard RESTful API for my chat bot, where each interaction involves sending a POST request with a user message. The server data remains unchanged by these requests, as each message is simply sent to retrieve a response. Given this setup, I’m uncertain whether useMutation or useQuery is more appropriate. Which hook best fits this use case, and why?
Currently, I’m leaning toward useMutation since it allows me to manually trigger each request without needing to cache any data. But I'm still not sure..
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I need to use a standard RESTful API for my chat bot, where each interaction involves sending a POST request with a user message. The server data remains unchanged by these requests, as each message is simply sent to retrieve a response. Given this setup, I’m uncertain whether
useMutation
oruseQuery
is more appropriate. Which hook best fits this use case, and why?Currently, I’m leaning toward
useMutation
since it allows me to manually trigger each request without needing to cache any data. But I'm still not sure..Beta Was this translation helpful? Give feedback.
All reactions