UseQueryReturnType

The return type of the useQuery hook comprises the data, error logs, and loading indicators.

Example

{
  "data": {},
  "error": {},
  "loading": false
}

Type Signature

type UseQueryReturnType = {
  data: any;
  error: any;
  loading: boolean;
};

Fields

ParamTypeDefault ValueDescription

data

any

null

Response data from GraphQL query if API call succeeds.

error

any

null

Error logs from GraphQL query if API call failed.

loading

boolean

false

Returns true to indicate if the API call is in a loading state, otherwise false.

Last updated

Was this helpful?