TanStackT
TanStack4y ago
26 replies
ordinary-sapphire

useQuery with POST and body

I have this mutation whose response I need, and there is no corresponding query for this mutation.

However, only reason why I set this up as a mutation is cause it is POST request and needs body.

It seems to me I would benefit if this could be query not mutation, but if query can make POST request and I can provide body to it, as I need this response cached.

Any idea if this is possible to do?
Was this page helpful?