IQueryBus

Represents a query bus.


interface IQueryBus<QueryBase extends IQuery = IQuery> {
  execute<TResult>(query: Query<TResult>): Promise<TResult>
}

Methods

execute()

Executes a query.

Overload #1

execute<T extends QueryBase, TResult = any>(query: T): Promise<TResult>

Parameters

Option Type Description
query T

The query to execute.

Returns

Promise<TResult>


Overload #2

execute<TResult>(query: Query<TResult>, asyncContext: AsyncContext): Promise<TResult>

Parameters

Option Type Description
query Query

The query to execute.

asyncContext AsyncContext

Returns

Promise<TResult>


Overload #3

execute<T extends QueryBase, TResult = any>(query: T, asyncContext: AsyncContext): Promise<TResult>

Parameters

Option Type Description
query T

The query to execute.

asyncContext AsyncContext

Returns

Promise<TResult>