Simon
Simon12mo ago

v10, passing useQuery options, queryKey mandatory?

I have a simple query like this
const me = api.user.me.useQuery(undefined, {
enabled: true,
})
const me = api.user.me.useQuery(undefined, {
enabled: true,
})
which results in an error Property 'queryKey' is missing in type .... So I have to pass the queryKey eventho it should be automatically generated?
Solution:
hm, anyways it seems to work now, maybe a restart of VS code. I will close as solved
Jump to solution
3 Replies
SebasPtsch
SebasPtsch12mo ago
if you've installed react query v5 with trpc v10 this error will ocur. Make sure that you have v4 of tanstack query installed
Simon
SimonOP12mo ago
Oups, my mistake, I meant v11
"@trpc/client": "11.0.0-next-beta.193",
"@trpc/next": "11.0.0-next-beta.193",
"@trpc/react-query": "11.0.0-next-beta.193",
"@trpc/server": "11.0.0-next-beta.193",
"@trpc/client": "11.0.0-next-beta.193",
"@trpc/next": "11.0.0-next-beta.193",
"@trpc/react-query": "11.0.0-next-beta.193",
"@trpc/server": "11.0.0-next-beta.193",
Solution
Simon
Simon12mo ago
hm, anyways it seems to work now, maybe a restart of VS code. I will close as solved

Did you find this page helpful?