Query Key Factory type not inferred for old data in queryClient.setQueryData
So I am playing around with the query key factory and looking for patterns to establish that I will use, and the first "roadblock" I hit is with queryClient.setQueryData.
If I decide to give it
string[] myself, I get a typescript error.
If I dont give it a type, I also get a typescript error on the spread

3 Replies
rich-copper•3y ago
setQueryData<string[]>like-goldOP•3y ago
cant it somehow be inferred or connected to the query factory? i thought that was one of the problems this package was supposed to solve

like-goldOP•3y ago
because now, to be able to satisfy the setQueryData, I also need to import all of my types for my requests on all of my queries
here its a simple string[] but i have more complex types on other queries