T
TanStack10mo ago
extended-salmon

Extract the queryfn return type from a queryOptions object

Is there a typescript helper I can extract the queryfn return type from a queryOptions object Like below
const todosQuery = queryOptions({
queryKey: ['todos'],
queryFn: fetchTodos,
staleTime: 5000,
})
const todosQuery = queryOptions({
queryKey: ['todos'],
queryFn: fetchTodos,
staleTime: 5000,
})
0 Replies
No replies yetBe the first to reply to this messageJoin

Did you find this page helpful?