Describe the bug
If I manually set a type on the generic useQuery<> or on the onSuccess callback typescript will not fail regarding of what is returned by the actual query function. It should fail and prevent returning something wrong when we type the query elsewhere
Your minimal, reproducible example
https://stackblitz.com/edit/vitejs-vite-vspsam?file=src%2FApp.tsx,src%2Fmain.tsx&terminal=dev
Steps to reproduce
Go to https://stackblitz.com/edit/vitejs-vite-vspsam?file=src%2FApp.tsx,src%2Fmain.tsx&terminal=dev and check the code
Expected behavior
typescript should fail
How often does this bug happen?
Every time
Screenshots or Videos
No response
Platform
all
TanStack Query version
4.20.9
TypeScript version
4.9.4
Additional context
No response