You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I use git submodule in the project, and install all the dependencies
// client.ts
// @packages is the submodule path
import type { AppRouter } from '@packages/trpc/src/trpc-admin/index'
import { createTRPCClient, httpLink } from '@trpc/client'
import type { inferRouterInputs, inferRouterOutputs } from '@trpc/server'
export type RouterInput = inferRouterInputs<AppRouter>
export type RouterOutput = inferRouterOutputs<AppRouter>
type a = RouterOutput['iam']['signIn']
In the frontend, only RouterInputcan inter the type, and I don't use andy data transformers
import iam from './routes/iam';
import { router } from './trpc';
export const appRouter = router({
iam, // iam is a plain object
});
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I use git submodule in the project, and install all the dependencies
In the frontend, only
RouterInput
can inter the type, and I don't use andy data transformersIn the backend , it can infer the type
Beta Was this translation helpful? Give feedback.
All reactions