fetchQuery

Fetch data from Airstack by calling queries to the Airstack API. If you need any pagination, use fetchQueryWithPagination instead.

Pre-requisites

  • Calling init function

Example

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

const { data, error } = await fetchQuery(query, variables, config);

Function Signature

fetchQuery(
  query: string,
  variables?: Variables,
  config: Config
): Promise<Pick<FetchQuery, "data" | "error">>

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