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.
Example
Section titled “Example”constructor( @Inject(QUERY_REPOSITORY.getUser) private readonly users: IQueryRepository<GetUserQuery, User | null>,) {}
const user = await this.users.find(query);Type Parameters
Section titled “Type Parameters”TQuery
Section titled “TQuery”TQuery = IQueryOptions
Query object accepted by find.
TResult
Section titled “TResult”TResult = unknown
Domain/read result returned to the application layer.
Methods
Section titled “Methods”find()
Section titled “find()”find(
query):Promise<TResult>
Defined in: packages/ddd-core/application/ports/query-repository.port.ts:27
Resolves one application query.
Parameters
Section titled “Parameters”TQuery
Returns
Section titled “Returns”Promise<TResult>