error when using a query
Type '{ name: string; }' is not assignable to type 'null | undefined'.
4 Replies
query works fine, just getting a type error here and I cant figure out why. I made a carbon copy of another route, modified the names
You have to use it outside of the array
.useQuery(["supabase.get-user-settings"], { name: "test" });
The first argument is telling rq what to fetch (array of keys)
Then the second one is the one you need - query paramstried this, got this:
Argument of type '{ name: string; }' is not assignable to parameter of type 'UseTRPCQueryOptions<"supabase.get-user-settings", unknown, any, any, TRPCClientErrorLike<Router<{}, unknown, {},
Sorry for being inactive, did not have much time today
It's hard for me to tell exactly what's wrong, but I would suggest checking your code with docs
I think I could actually be wrong about the usage haha, mixed up V10 and v9
I would probably just restart Vs code and use the code you had previously