API Reference
QueryManager
Constructor Options
interface QueryManagerOptions<T, F> {
name: string
queryClient: QueryClient
listFn?: (limit: number, offset: number, filters?: F) => Promise<T[]>
retrieveFn: (id: QueryItem['id']) => Promise<T>
createFn: (data: Partial<T>) => Promise<T>
updateFn: (data: Partial<T>) => Promise<T>
deleteFn: (id: QueryItem['id']) => Promise<unknown>
listLimit?: number
useListEffect?: (query: any) => void
}
Methods
useList(options?)
: List query with infinite scrolluseRetrieve(id, options?)
: Single item queryuseCreate(options?)
: Create mutation with optimistic updatesuseUpdate(options?)
: Update mutation with optimistic updatesuseDelete(options?)
: Delete mutation with optimistic updatesprefetchRetrieve(id, options?)
: Prefetch single item