Replies: 1 comment
-
https://tanstack.com/query/v5/docs/framework/react/typescript#registering-a-global-error |
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
-
In this situation, the type of
data
is inferred asCustomResponse
, while the type oferror
is not inferred asCustomError
.I only want to specify the response type and error type for the API fetcher function part, and I don't want to enter any generics for the query call part.
I just want to make
data
anderror
types of inference just by passing the API fetcher function toqueryFn
ormutationFn
.Is there a way to do this? Or is the
TError
type designed to be impossible to infer withqueryFn
ormutationFn
?Thx :)
Beta Was this translation helpful? Give feedback.
All reactions