Quick Start Guide
Get up and running with Solid Query in just a few minutes. This guide will walk you through creating a simple application that fetches and displays data.Complete Example
Here’s a complete working example to get you started:Step-by-Step Guide
Let’s break down the key concepts:Query Keys
Query keys are how Solid Query identifies and caches your data. They can be simple strings or arrays:Working with Suspense
Solid Query integrates seamlessly with SolidJS Suspense:Dependent Queries
Sometimes you need to fetch data that depends on other data:Pagination Example
Handle paginated data with ease:Infinite Queries
For infinite scroll or “load more” functionality:Optimistic Updates
Update the UI immediately while the mutation is in progress:Best Practices
Follow these best practices for optimal performance and maintainability:
- Use Query Keys Consistently: Keep your query keys organized and consistent across your application
-
Set Appropriate Stale Time: Configure
staleTimebased on how often your data changes - Handle All States: Always handle loading, error, and success states
-
Use Query Options Helper: Create reusable query configurations with
queryOptions - Leverage Suspense: Use Suspense boundaries for better loading experiences
- Invalidate Wisely: Invalidate queries after mutations to keep data fresh
Next Steps
TypeScript
Learn about TypeScript integration and type safety
DevTools
Debug your queries with Solid Query DevTools