method IQueryBus.execute
IQueryBus.execute<TResult = unknown>(query: CqrsQuery): Promise<TResult>

Executes a query.

Type Parameters

TResult = unknown

The expected result type

Parameters

The query to execute

Return Type

Promise<TResult>

The handler's result

Throws

HandlerNotFoundError

(from the plugin) — as a REJECTION — if no handler is registered for query.type

TypeError

— as a REJECTION — if query.type is not a string

Usage

import { type IQueryBus } from "common/src/index.ts";