query-layer
Query Layer Patterns
Reference Repositories
- TanStack Query: async state management for data fetching
Upstream Grounding
When TanStack Query behavior, Svelte adapter types, cache invalidation semantics, optimistic updates, or mutation lifecycle callbacks affect correctness, ask DeepWiki a narrow question against tanstack/query before relying on memory. Use it to orient, then verify decisive details against local installed types, source, or official docs before changing code.
Skip DeepWiki for stable basics and repo-local patterns already documented below.
The query/RPC layer is the reactive bridge between UI components and the service layer. It wraps service functions or observable operations with caching, mutation lifecycle state, invalidation, and direct imperative access using TanStack Query and WellCrafted factories.
Related Skills: See
services-layerfor the service layer these queries consume. Seesveltefor Svelte-specific TanStack Query patterns. Seeerror-handlingfor toast/report patterns after Results reach the UI boundary.
When to Apply This Skill
Use this pattern when you need to: