useQueryWithPagination

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

Pre-requisites

  • Calling init function

Example

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

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

Function Signature

function useQueryWithPagination(
  query: string,
  variables?: Variables
): useQueryWithPaginationReturnType

Params

Param
Type
Default Value
Description

query

string

-

variables

null

GraphQL query variables

configAndCallbacks

null

Additional configurations and callbacks.

Responses

Param
Type
Default Value
Description

response

-

Response from the hook that will return data, error logs, loading state, and pagination.

Last updated

Was this helpful?

#946:

Change request updated