Skip to main content
Version: 11.x

Type Alias: QueryLike<TRoot, TProcedure>

QueryLike<TRoot, TProcedure>: object

Use to request a query route which matches a given query procedure's interface

Type Parameters

Type Parameter
TRoot extends AnyRootTypes
TProcedure extends AnyProcedure

Type declaration

useQuery()

useQuery: (variables, opts?) => InferQueryResult<TRoot, TProcedure>

Parameters

ParameterType
variablesinferProcedureInput<TProcedure>
opts?InferQueryOptions<TRoot, TProcedure, any>

Returns

InferQueryResult<TRoot, TProcedure>

useSuspenseQuery()

useSuspenseQuery: (variables, opts?) => UseTRPCSuspenseQueryResult<inferProcedureOutput<TProcedure>, TRPCClientErrorLike<TRoot>>

Parameters

ParameterType
variablesinferProcedureInput<TProcedure>
opts?InferQueryOptions<TRoot, TProcedure, any>

Returns

UseTRPCSuspenseQueryResult<inferProcedureOutput<TProcedure>, TRPCClientErrorLike<TRoot>>

Defined in

packages/react-query/src/shared/polymorphism/queryLike.ts:19