Skip to content

IQueryRepository

Defined in: packages/ddd-core/application/ports/query-repository.port.ts:25

Application-facing read repository contract.

Query handlers depend on this interface rather than ORM/query-builder implementations. Repository adapters may use FromCache internally, but callers receive only the declared TResult.

constructor(
@Inject(QUERY_REPOSITORY.getUser)
private readonly users: IQueryRepository<GetUserQuery, User | null>,
) {}
const user = await this.users.find(query);

TQuery = IQueryOptions

Query object accepted by find.

TResult = unknown

Domain/read result returned to the application layer.

find(query): Promise<TResult>

Defined in: packages/ddd-core/application/ports/query-repository.port.ts:27

Resolves one application query.

TQuery

Promise<TResult>