UseLazyQueryWithPaginationReturnType

The return type of the useLazyQueryWithPagination hook comprises of the manual fetching function, data, error logs, loading indicator, and pagination object.

Example

[
  (variables) => {
    "data": {},
    "error": {},
    "pagination": {
      "getNextPage": () => {},
      "getPrevPage": () => {}
    }
  },
  {
    "data": {},
    "error": {},
    "loading": false,
    "pagination": {
      "hasNextPage": true,
      "hasPrevPage": true,
      "getNextPage": () => {},
      "getPrevPage": () => {}
    }
  }
]

Type Signature

type LazyHookReturnType = [
  (variables?: Variables) => Promise<
    {
      data: any;
      error: any;
      pagination: Omit<Pagination, "getNextPage" | "getPrevPage">;
    }
  >,
  {
    data: any;
    error: any;
    loading: boolean;
    pagination: Pagination;
  }
];

Items

ParamTypeDefault ValueDescription

fetch

(variables?: Variables) => Promise<Omit<UseQueryReturnType, "loading">>

-

The function that can be triggered manually to call the GraphQL query.

state

-

The current data, error logs, and loading state from the latest GraphQL query call.

Last updated

Was this helpful?