FetchQuery

The return type of the fetchQuery function comprises of the data, error logs, loading indicator, and pagination object.

Example

{
  "data": {},
  "error": {},
  "hasNextPage": true,
  "hasPrevPage": true,
  "getNextPage": () => {},
  "getPrevPage": () => {}
}

Type Signature

type FetchQuery = {
  data: any;
  error: any;
  hasNextPage: boolean;
  hasPrevPage: boolean;
  getNextPage: () => Promise<FetchQuery | null>;
  getPrevPage: () => Promise<FetchQuery | null>;
};

Fields

Param
Type
Default Value
Description

data

any?

null

Response data from GraphQL query if API call succeeds.

error

any?

null

Error logs from GraphQL query if API call failed.

hasNextPage

boolean

false

Indicate if there is any next page.

hasPrevPage

boolean

false

Indicate if there is any previous page.

getNextPage

-

Function to get data in the next page.

getPrevPage

-

Function to get data in the previous page.

Last updated

#300: add-user-details

Change request updated