You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We currently use a library to build a series of query options with narrowed error types (because we know exactly what error should result from the queryFn. useQuery works fine with these query options but useQueries does not.
This may be related to #3991 but couldn't find a related issue
The inference trick to provide a different type for Error via onError only works when inlined.
FYI, in v5, we have moved away from unknown and made Error the default type, and we're also going to provide a way to override the Error type globally.
Describe the bug
We currently use a library to build a series of query options with narrowed error types (because we know exactly what error should result from the
queryFn
.useQuery
works fine with these query options butuseQueries
does not.This may be related to #3991 but couldn't find a related issue
Your minimal, reproducible example
https://codesandbox.io/s/silly-sanderson-e95c55?file=/src/App.tsx
Steps to reproduce
Expected behavior
As a user, I expected useQueries to behave similarly to useQuery and accept the same queryOptions.
How often does this bug happen?
Every time
Screenshots or Videos
No response
Platform
Doesn't make a difference
TanStack Query version
4.20.9
TypeScript version
4.9.4
Additional context
No response
The text was updated successfully, but these errors were encountered: