T
TanStack8mo ago
ratty-blush

When using an infiniteQuery on a POST request, it doesn't cache the request.

Is it true that Queries that use POST requests are treated like mutations and are not being cached, or cache is assigned only for Mutations? because my data wont cache when I use query with POST
1 Reply
extended-salmon
extended-salmon8mo ago
TanStack Query doesn't know anything about the actual http request, just if a promise that's returned from queryFn is resolved and if it resulted in an error. If you know an API call will change server state use a mutation for that.

Did you find this page helpful?