Skip to content

Latest commit

 

History

History
55 lines (42 loc) · 2.2 KB

usequerywithpagination.md

File metadata and controls

55 lines (42 loc) · 2.2 KB
description layout
Fetch data from Airstack by calling queries to the Airstack API with pagination included. If you don't need pagination, use useQuery instead.
title description tableOfContents outline pagination
visible
true
visible
true
visible
true
visible
visible
true

useQueryWithPagination

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 - Airstack API key
variables Variables? null GraphQL query variables
configAndCallbacks ConfigAndCallbacks? null Additional configurations and callbacks.

Responses

Param Type Default Value Description
response UseQueryWithPaginationReturnType - Response from the hook that will return data, error logs, loading state, and pagination.