UseLazyQueryReturnType

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

Example

[
  "fetch": (variables) => {
    "data": {},
    "error": {}
  },
  "state": {
    "data": {},
    "error": {},
    "loading": false
  }
]

TypeSignature

type UseLazyQueryReturnType = [
  (variables?: Variables) => Promise<Omit<UseQueryReturnType, "loading">>,
  UseQueryReturnType
];

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?