hachoter
Explore posts from serversTTCTheo's Typesafe Cult
•Created by hachoter on 9/19/2023 in #questions
trpc client does not have a property query
I think this is an issue on my end here is how I am defining everything
import { assetsRouter } from "../apps/routes";
import { t } from "./t";
export const appRouter = t.router({
menus: menusRouter
});
// export type definition of API
export type AppRouter = typeof appRouter;
import { createTRPCProxyClient, httpBatchLink } from '@trpc/client';
import type { AppRouter } from '../../../api/trpc/server';
export const client = createTRPCProxyClient<AppRouter>({
links: [
httpBatchLink({
url: 'http://127.0.0.1:4000/trpc'
})
]
});
```
But when I try to query like this client.assets.images.query I get an error property query does not exist, it correctly infers the type assets etc... but not query
This is an express/sveltekit project but I understand trpc does not need any special configuration for this
2 replies