Rule
Rule10mo ago

Error using createTRPCQueryUtils

Here is my code.
const trpc = createTRPCReact<TRPCRouter>();
const queryClient = new QueryClient();
const trpcQueryUtils = createTRPCQueryUtils({ queryClient, client: trpc });
const trpc = createTRPCReact<TRPCRouter>();
const queryClient = new QueryClient();
const trpcQueryUtils = createTRPCQueryUtils({ queryClient, client: trpc });
The line three is giving me this error when hovering on client
createUtilityFunctions.d.ts(10, 5): The expected type comes from property 'client' which is declared here on type 'CreateQueryUtilsOptions<AnyRouter>'

The property 'links' in your router collides with a built-in method, rename this router or procedure on your backend." | "The property 'query' in your router collides with a built-in method, rename this router or procedure on your backend.'.
createUtilityFunctions.d.ts(10, 5): The expected type comes from property 'client' which is declared here on type 'CreateQueryUtilsOptions<AnyRouter>'

The property 'links' in your router collides with a built-in method, rename this router or procedure on your backend." | "The property 'query' in your router collides with a built-in method, rename this router or procedure on your backend.'.
0 Replies
No replies yetBe the first to reply to this messageJoin

Did you find this page helpful?