Skip to main content

useQuery()

useQuery(options, queryClient)

function useQuery<TData, TError>(options, queryClient?): Tanstack.UseQueryResult<TData, TError>

Type parameters

Type parameterValue
TDataunknown
TErrorError

Parameters

ParameterType
optionsUseQueryOptions<TData, TError, TData, QueryKey> & PowerSyncQueryOptions<any> & { query: undefined; }
queryClient?QueryClient

Returns

Tanstack.UseQueryResult<TData, TError>

useQuery(options, queryClient)

function useQuery<TData, TError>(options, queryClient?): Tanstack.UseQueryResult<TData[], TError>

Type parameters

Type parameterValue
TDataunknown
TErrorError

Parameters

ParameterType
optionsUseQueryOptions<TData[], TError, TData[], QueryKey> & PowerSyncQueryOptions<any> & { query: string | CompilableQuery<TData>; }
queryClient?QueryClient

Returns

Tanstack.UseQueryResult<TData[], TError>