Skip to content

Infinite scroll query

Set infinite to generate useInfiniteQuery hooks, naming the cursor query parameter, the first page value, and the path to the next cursor on the response.

kubb.config.ts
typescript
import { 
defineConfig
} from 'kubb/config'
import {
pluginTs
} from '@kubb/plugin-ts'
import {
pluginFetch
} from '@kubb/plugin-fetch'
import {
pluginVueQuery
} from '@kubb/plugin-vue-query'
export default
defineConfig
({
input
: './petStore.yaml',
output
: {
path
: './src/gen',
clean
: true },
plugins
: [
pluginTs
(),
pluginFetch
(),
pluginVueQuery
({
infinite
: {
queryParam
: 'next_page',
initialPageParam
: 0,
nextParam
: 'pagination.next.cursor',
}, }), ], })