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/node";

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

Function Signature

type FetchQuery = {
  data: any;
  error: any;
}

type Variables = Record<string, any>

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

Params

Responses

Last updated

Was this helpful?