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
When using Omit<UseQueryOptions<IUser, Error, IUser>, 'queryKey'> for defining options in a wrapper function, TypeScript fails to infer the correct types for properties inside options. For example, the select option does not show any type inference.
That's very weird. The issue does not affect the equivalent UseQueryOptions type in React Query, but does affect Vue Query, so seems to be something to do with the Vue types
Describe the bug
Description:
When using
Omit<UseQueryOptions<IUser, Error, IUser>, 'queryKey'>
for defining options in a wrapper function, TypeScript fails to infer the correct types for properties inside options. For example, the select option does not show any type inference.Code Example
Your minimal, reproducible example
https://www.typescriptlang.org/play/?ssl=18&ssc=14&pln=18&pc=27#code/JYWwDg9gTgLgBAbwFBzgVwM4FMCKatQCeANCnAKrZ4GEDyYMwEAdhqQL5wBmUEIcAcgACMAIasxAYwDWAegBu+ALQBHfEQEBuJKEixEcAEpYuxOMAzHTcKCbicefQYqwCkO5jAJdRkrHABJSgJEMmZRECwALjgMGChgZgBzUlRRJOi4ZjQQACMCVLhRABNi2wwMGLiE5KR2d0SvKB8-CmxjNTjqIlDUNCgAGxirAB5qxKSAPm1UCAYmVhjaEGAYEeDuunmWDBGg7CgzAFEoXkPA4KhJswE1GgBpLEIBabr3LAAPPXhJHfhMLAdTAwS5wAC8cAAFMg+oNCnNGDs6jFgkCuupCABKcGTXo2LAwfrMdBUDF7S7HU7QSbQsioO5ER6EGIAbQEtjucUuAjM-QGAF1CvSMQAxZgxUQYQjMSRQ7Fg3Ew1DK2yEqDE0QAd1EqzgAAVeCtsAA6coQAbyLC05U2rIRTICYriZjPIW29KZADMAAY3TaSmUsBUYgADAPlSpwAAkCD57BDdOV7ExifYbuNGYRCwwZGTbyQvwkRVKEfB+K4kIEAAsYDAwJVZLIPs2PsbfiABCnC3ESSEIQC0SCDtb0IMJSWg2wyFmdjElahsAMsLm6pigA
Steps to reproduce
/
Expected behavior
The options parameter in
useRequstUser
should provide type inference for fields likeselect
How often does this bug happen?
None
Screenshots or Videos
No response
Platform
macOS
Chrome
Tanstack Query adapter
None
TanStack Query version
5.62.2
TypeScript version
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: