<
How to Mock tRPC Communication on Storybook with MSW

2024-03-07

tRPC is a framework that allows you to easily build type-safe APIs. During development, if you want to proceed with front-end development on Storybook without waiting for the backend implementation, you can mock the API using Mock Service Worker (MSW). This article explains how to mock tRPC communication with MSW using maloguertin/msw-trpc. As a practical example, the sample code is shared on the GitHub repository silverbirder/trpc-msw-storybook-nextjs....