A note on this project's origins:
This library was built by a developer with minimal Rust experience, with significant assistance from Claude (Opus 4.5). It's an honest attempt to bring TanStack Query patterns to the GPUI ecosystem.
This is not production-ready. It's an early alpha (v0.0.1) that needs:
- More comprehensive unit tests (aspiring to follow standards set by
tokio,serde, etc.)- Real-world battle testing
- API refinement based on community feedback
Contributions, criticism, and feedback are warmly welcomed. If you're an experienced Rustacean, your guidance would be invaluable. Open an issue, submit a PR, or just tell us what we got wrong.
spawn_query;
Features
spawn_query/spawn_mutation— One-liner async execution with automatic state management- Stale-while-revalidate — Show cached data instantly while fetching fresh data
- Automatic retries — Exponential backoff for transient failures
- Cache invalidation — Hierarchical key patterns for precise cache control
- GPUI-native — Built for GPUI's context and reactive model
Installation
[]
= "0.0.1"
Quick Start
use ;
use *;
Mutations
use ;
let mutation = new;
spawn_mutation;
Query Keys
Hierarchical keys for cache management:
// Simple key
let key = new;
// Nested key
let key = new.push.push;
// Invalidate all user queries
client.invalidate;
Configuration
use ;
let query = new
.with_options;
Why rs-query?
If you're building GPUI apps with async data fetching, you've probably written this pattern dozens of times:
cx.spawn;
rs-query handles loading states, caching, retries, and cache invalidation — so you can focus on your app.
Roadmap
- Comprehensive test suite
- Benchmarks
- Query devtools
- Infinite queries
- Optimistic updates
- Persistence adapters
Contributing
This project needs your help! Whether you're:
- An experienced Rustacean who can improve the internals
- A GPUI user who can provide real-world feedback
- Someone who can write tests and documentation
...we'd love to hear from you. See CONTRIBUTING.md or open an issue.
License
MIT — Built by DreamStack