Skip to main content

useQuery

Callable

  • useQuery<TChainId, TQuery>(query: TQuery, options?: ChainComposableOptions<TChainId>): PromiseLikeAsyncState<InferQueryArgumentResult<TChainId, TQuery>>

  • Composable for querying data from chain, and returning the response.


    Type parameters

    • TChainId: any
    • TQuery: any

    Parameters

    • query: TQuery

      The function to create the query

    • optionaloptions: ChainComposableOptions<TChainId>

      Additional options

    Returns PromiseLikeAsyncState<InferQueryArgumentResult<TChainId, TQuery>>

    The data response