What problem does it solve?
This Skill provides clear, standardized patterns for integrating TRPC with Tanstack Query, eliminating guesswork and ensuring type-safe, efficient API interactions. It streamlines both backend and frontend development, reducing common errors and accelerating feature delivery.
Core Features & Use Cases
- Type-Safe API Development: Guides the creation of TRPC routers and procedures with Zod validation for robust, error-resistant APIs.
- Efficient Data Fetching: Demonstrates optimal patterns for
useQuery and useMutation with Tanstack Query, ensuring performant data handling.
- Automated Cache Invalidation: Ensures data consistency across your application by automatically invalidating relevant queries after mutations.
- Use Case: Generate a new TRPC mutation for updating a user profile, including input validation, secure database interaction, and automatic cache invalidation for related user data queries, saving development time and ensuring correctness.
Quick Start
Using the trpc-patterns skill, create a new TRPC query for fetching a list of products, ensuring it uses protectedProcedure and proper database function calls.