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

-

variables

null

GraphQL query variables

config

{ cache?: boolean }

null

Caching configuration

Responses

Param
Type
Default Value
Description

response

null

Response object from GraphQL query.

Last updated

#300: add-user-details

Change request updated