Replies: 1 comment
-
Beta Was this translation helpful? Give feedback.
0 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 recently got into tanstack Query and I am amazed by how smooth everything works, so first of all massive thanks to the creators/maintainers ♥.
I was wondering one thing, is it possible to get an extend of an Error through useQuery.
Example query:
this query can return a PostgrestError which looks like this:
However, the Error returned in the useQuery hook is still of type Error. This makes a lot of sense since how would useQuery know what kind of Error is returned, and an Error can basically be anything.
Was just wondering how other developers handle these kind of cases, to still get typesafety on Errors returned from useQuery.
For some reason type assertion is not working either for me (the following never logs anything):
Help is greatly appreciated!
Beta Was this translation helpful? Give feedback.
All reactions