useQuery
Callable
Type parameters
- TChainId: any
- TQuery: (builder: Query<[], ChainDescriptorOf<TChainId>>) => any
Parameters
builder: TQuery
The function to create the query
optionaloptions: ChainComposableOptions<TChainId>
Additional options
Returns (DeepReadonly<MutableAsyncState<FlatHead<InferQueryPayload<Exclude<ReturnType<Exclude<UnwrapRef<TQuery>, Falsy>>, Falsy>>>, QueryError, undefined>> & { refresh: () => void } & PromiseLike<AsyncState<FlatHead<InferQueryPayload<Exclude<ReturnType<Exclude<UnwrapRef<TQuery>, Falsy>>, Falsy>>>, QueryError, FlatHead<InferQueryPayload<Exclude<ReturnType<Exclude<UnwrapRef<TQuery>, Falsy>>, Falsy>>>>>) | (DeepReadonly<MutableAsyncState<FlatHead<InferQueryPayload<Exclude<ReturnType<Exclude<UnwrapRef<TQuery>, Falsy>>, Falsy>>>, unknown, undefined>> & { refresh: () => void } & PromiseLike<AsyncState<FlatHead<InferQueryPayload<Exclude<ReturnType<Exclude<UnwrapRef<TQuery>, Falsy>>, Falsy>>>, QueryError, FlatHead<InferQueryPayload<Exclude<ReturnType<Exclude<UnwrapRef<TQuery>, Falsy>>, Falsy>>>>>)
The data response
Composable for querying data from chain, and returning the response.