Describe the bug#
v5 looks awesome, thanks for your work on it! :D
We're using wrapper composables to separate usage logic from implementation (e.g., we don't want to have logic for handling optimistic updating inside our components), but we're still allowing users to pass in tanstack options so that the components can be responsible for stuff like refetch intervals.
The UseQueryOptions type has changed, so we were expecting to have to make some changes, but we're unable to resolve one of the errors. The minimal example looks like code that should 100% work and the error doesn't make much sense, which is why I've opened an issue instead of a discussion!
Interestingly, the error is slightly different on the TS playground than locally. Locally, the error can be fixed by specifying initialData: undefined, but that doesn't fix the issue on TS playground.
Your minimal, reproducible example#
https://www.typescriptlang.org/play?#code/JYWwDg9gTgLgBAbzgVwM4FMCKz1QJ4A0cMeY6cAqhtrngPJgzAQB2qcAvnAGZQQhwA5AAEYAQzbiAxgGsA9ADccAWgCOOfIICwAKF0kycAGIQIAJXSpIbcgF5EPUwC44qGFGAsA5pwDcu7mQWKSZWFAwTCBp8AAoIRmY2AH4XKiwNegTWVAAeSIsrbPQAPgBKRF04OCh0GGQoFnD02hiESqq4dVoAaXQ8FwBtQW5TQQBdAnaqsVQ8YM6MoxYY8radDo6auoaHEYgXQQAjMShBTjgZ41MC6wx-dY6OSYeqgDp3+NC2Z6quVDEmKhuMBLMRSOgINw4J9EqhSvcOEA
Steps to reproduce#
- go to link
- see error
Expected behavior#
As a user, I'd expect to be able to create wrapper composables, but it looks like what was previously possible is no longer.
How often does this bug happen?#
Every time
Screenshots or Videos#
No response
Platform#
typescript 5.2.2
Tanstack Query adapter#
vue-query
TanStack Query version#
5.0.0
TypeScript version#
5.2.2
Additional context#
No response
hm, weird. The same thing works for react-query:
https://www.typescriptlang.org/play?#code/JYWwDg9gTgLgBAbzgVwM4FMCKz1QJ4A0cMeY6cAqhtrngPJgzAQB2qcAvnAGZQQhwA5AAEYAQzbiAxgGsA9FHRipMALQBHHPkEBYAFD6SZOADEIEAErpUkNuQC8iHuYBccVDCjAWAc04BufW5kFhVmFhQMMwgafAAKCEZw1AB+NyosLXok1lQAHmirG1z0AD4ASkR9ODhFGGQoCLRM2jiEapq4TVoAaXQ8NwBtQW5zQQBdAg6asVQ8UK6skxY4yva9Ts66hoikUYg3QQAjMShBTjhZ03Mi2wxAjc6OKceagDoPxKZcl5quVDETFQ3GA1mIpHQEG4cC+yXKDw4QA
@DamianOsipiuk FYI