new v5 query options typescript question
Hi! I was wondering if there is a good way to infer the queryOptions' queryKey type via QueryFunctionContext without creating additional a function to generate query key. below is the TS playground, I know it is running into circular errors in the example. thanks!
https://www.typescriptlang.org/play?#code/JYWwDg9gTgLgBAbwFBzgVwM4FMCKatQCeANCnAI75EDyYMwEAdhqangYQGJqMDG9TAMJMYWAB4xSAXzgAzKBBBwA5AAEYAQ2abeAawD0ULBv4BaSh2VIkMQmCxwAChqgaQGOAF44AJSy9oABMAHgwYKGBGAHNiRDhgQIAuOABGACYAZjgpAD5rW3s4diIAaSxCABU7B28-GDQoRir7YIKsCFk4KKwYYsJaAWYcgG1lC1Ly5QBdawDtOR7eAAtuPkGvOAAKOdEJZL7V-gZGYUZdmGC+ssrqnIBKLxzEMjmwuGHYsBc3DCmNnfEMAAdONCNcyEZ6o04IwsAB3JwKEDAbCbTZGDAQAA2ADcsA9PE9kKhUJCGow4BjsXjNl9XO4gQk7mQpMypLMmG9ur0qP06McPN5Ngg4HSftlks56RgCXlUKCBgLhWR5bzrslRqIwpEospPt93FNWCTQZxGMlZIsVjwjkxjagsIwNAAjLFYJJwABCEGxxkYtINGEZgTuxtZ1nEkFgcFe8EwuF5nCtG02suepJ65PQ2D6m25fUVnOFosDyRFCWS6SyMlZbKQQA
TS Playground - An online editor for exploring TypeScript and JavaS...
The Playground lets you write TypeScript or JavaScript online in a safe and sharable way.
3 Replies
harsh-harlequin•3y ago
no, I don't think so. I'd inline the queryFn
harsh-harlequin•3y ago
TS Playground - An online editor for exploring TypeScript and JavaS...
The Playground lets you write TypeScript or JavaScript online in a safe and sharable way.
harsh-harlequin•3y ago
TS Playground - An online editor for exploring TypeScript and JavaS...
The Playground lets you write TypeScript or JavaScript online in a safe and sharable way.