Query Docs
Examples
- Simple
- Basic
- Basic w/ GraphQL-Request
- Default Query Function
- Playground
- Algolia
- Chat example (streaming)
- Shadow DOM
- Devtools Embedded Panel
- Star Wars
- Rick And Morty
- Offline Queries and Mutations
- Suspense
- Batching
- Auto Refetching / Polling / Realtime
- Optimistic Updates
- Pagination
- Load-More & Infinite Scroll
- Infinite query with Max pages
- Prefetching
Preact Example: Infinite Query With Max Pages
import { render } from 'preact'
import { QueryClient, QueryClientProvider } from '@tanstack/preact-query'
import App from './App'
import { worker } from './mocks'
const queryClient = new QueryClient()
const rootElement = document.getElementById('root')
if (!rootElement) throw new Error('Missing #root element')
worker.start({ onUnhandledRequest: 'bypass' }).then(() => {
render(
<QueryClientProvider client={queryClient}>
<App />
</QueryClientProvider>,
rootElement,
)
})