Query Docs
Examples
- Simple
- Basic
- Basic w/ GraphQL-Request
- Default Query Function
- SolidStart 1
- Astro
- Offline Queries and Mutations
- Playground
- Algolia
- Chat example (streaming)
- Shadow DOM
- Devtools Embedded Panel
- Star Wars (Solid Router)
- Rick And Morty (Solid Router)
- Solid Router
- Suspense
- Batching
- Auto Refetching / Polling / Realtime (SolidStart 2)
- Optimistic Updates (SolidStart 2)
- Pagination (SolidStart 2)
- Prefetching (SolidStart 2)
Solid Example: Optimistic Updates
import { ErrorBoundary, Suspense } from 'solid-js'
import ApproachTabs from '~/components/ApproachTabs'
export default function Home() {
return (
<main
style={{ 'max-width': '600px', margin: '0 auto', padding: '2rem 1rem' }}
>
<h1>Optimistic Updates with TanStack Query</h1>
<p style={{ color: '#666', 'margin-bottom': '1.5rem' }}>
Add todos to see optimistic updates in action. The server randomly fails
~30% of the time so you can observe automatic rollback.
</p>
<ErrorBoundary
fallback={(error) => <p style={{ color: 'red' }}>{error.message}</p>}
>
<Suspense fallback={<p>Loading todos…</p>}>
<ApproachTabs />
</Suspense>
</ErrorBoundary>
</main>
)
}