Replies: 1 comment 2 replies
-
TanStack Query doesn't make requests - it manages promises. So no, it doesn't automatically handle HTTP status codes because you can write a queryFn that is simply: So if you want to handle http headers, you need to extract the headers from the response (depending on how YOU do http requests, because TanStack Query doesn't make the request), return it from |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
I was wondering if useQuery is handling 503 HTTP errors. In particular the
retry
option.https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/503
Common causes are a server that is down for maintenance or that is overloaded. This response should be used for temporary conditions and the Retry-After HTTP header should, if possible, contain the estimated time for the recovery of the service.
Is tanstack query handling that header as intended?
Beta Was this translation helpful? Give feedback.
All reactions