tanstack-query-integration

Integrate TanStack Query with oRPC for typed data fetching and caching.

1|Updated Nov 19, 2025
One-click install
npx skills add https://github.com/CatOfJupit3r/ultimate-starter --skill tanstack-query-integration
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: tanstack-query-integration
Source: https://github.com/CatOfJupit3r/ultimate-starter/tree/main/.github/skills/tanstack-query-integration
Command: npx skills add https://github.com/CatOfJupit3r/ultimate-starter --skill tanstack-query-integration

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Provides a structured approach to integrate TanStack Query with oRPC, enabling typed data fetching, caching, and reliable UI updates across client routes.

Core Features & Use Cases

  • Type-safe query and mutation hooks via generated queryOptions and mutationOptions.
  • Cache invalidation, prefetching, and route-loader integration for seamless data freshness.
  • Support for optimistic updates and safe error rollback in mutations.

Quick Start

Import the tanstack-query-integration utilities and begin using the generated query options in your components.

Frequently Asked Questions about tanstack-query-integration

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I integrate TanStack Query with oRPC for type-safe data fetching?

Integrate TanStack Query with oRPC by importing generated queryOptions and mutationOptions utilities to enable strictly typed data fetching, caching, and reliable UI updates across client routes.

What is the best way to handle optimistic updates and rollback in TanStack Query mutations?

Handle optimistic updates in TanStack Query mutations by applying mutationOptions that support safe error rollback strategies, ensuring the UI state automatically reverts if the server request fails.

How do I use route loaders for TanStack Query cache invalidation and prefetching?

Use route loaders to execute prefetching and cache invalidation by importing queryOptions, ensuring seamless data freshness by hydrating the cache before navigating to the target route.

Does oRPC support generated query keys for TanStack Query cache invalidation?

Yes, oRPC supports TanStack Query cache invalidation by utilizing generated query keys and exported queryOptions, allowing you to safely manage and invalidate specific cached server states.

Can I export queryOptions and mutationOptions for TanStack Query integration?

Yes, you can export queryOptions and mutationOptions utilities to structure typed data fetching, manage cache invalidation, and support optimistic UI updates seamlessly within your application components.