How to type queries without inference?
How can I remove
as const
from this and add real types?
3 Replies
continuing-cyan•15mo ago
Not sure I fully understand the problem but maybe queryOptions?
continuing-cyan•15mo ago
Query Options | TanStack Query React Docs
One of the best ways to share queryKey and queryFn between multiple places, yet keep them co-located to one another, is to use the queryOptions helper. At runtime, this helper just returns whatever you pass into it, but it has a lot of advantages when using it with TypeScript. You can define all possible options for a query in one place, and yo...
frail-apricotOP•15mo ago
yep this is it. thanks!