fetchQueryWithPagination

Fetch data from Airstack by calling queries to the Airstack API with pagination included. If you don't need pagination, use fetchQuery instead.

Pre-requisites

  • Calling init function

Example

import { fetchQueryWithPagination } from "@airstack/airstack-react";

const { data, error, hasNextPage, hasPrevPage, getNextPage, getPrevPage } =
  await fetchQueryWithPagination(query, variables, config);

Function Signature

function fetchQueryWithPagination(
  query: string,
  variables?: Variables,
  config?: { cache?: boolean }
): Promise<FetchQuery>

Params

Param
Type
Default Value
Description

query

string

-

Airstack GraphQL query

variables

null

GraphQL query variables

config

{ cache?: boolean }

null

Caching configuration

Responses

Param
Type
Default Value
Description

response

Promise<FetchQuery>

null

Response object from GraphQL query.

Last updated

Was this helpful?

#946:

Change request updated