TanStackT
TanStackโ€ข3y agoโ€ข
3 replies
brilliant-orange

Getting http response code status in useQuery?

Hi there ๐Ÿ‘‹

I'm new in react/react-query I've just wanted to ask if is it possible to access the http response code with useQuery? I'm using useQuery to fetch data from an api and I wanted to display different error messages in case 403 and 401 response codes?

thanks!
Was this page helpful?