Create tRPC MSW handlers with createTRPCMsw
mainUse createTRPCMsw to generate a proxy object that infers types from your tRPC AppRouter. This proxy allows you to define MSW handlers for your queries and mutations using a syntax similar to the tRPC client.
Note: You must provide a links configuration (similar to a tRPC client) to createTRPCMsw.
import { createTRPCMsw } from 'msw-trpc'
import type { AppRouter } from 'path/to/your/router'
export const trpcMsw = createTRPCMsw<AppRouter>({
links: [ /* your tRPC links here */ ]
})