description |
layout |
Fetch data from Airstack by calling queries to the Airstack API with pagination included. If you don't need pagination, use fetchQuery instead. |
title |
description |
tableOfContents |
outline |
pagination |
|
|
|
|
|
|
fetchQueryWithPagination
import { fetchQueryWithPagination } from "@airstack/airstack-react";
const { data, error, hasNextPage, hasPrevPage, getNextPage, getPrevPage } =
await fetchQueryWithPagination(query, variables, config);
function fetchQueryWithPagination(
query: string,
variables?: Variables,
config?: { cache?: boolean }
): Promise<FetchQuery>
Param |
Type |
Default Value |
Description |
query |
string |
- |
Airstack GraphQL query |
variables |
Variables |
null |
GraphQL query variables |
config |
{ cache?: boolean } |
null |
Caching configuration |
Param |
Type |
Default Value |
Description |
response |
Promise< FetchQuery > |
null |
Response object from GraphQL query . |