-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Parent
Part of #739
Context
Read models currently use class-based metadata:
interface ReadModelMetadata<TReadModel extends ReadModelInterface = ReadModelInterface> {
readonly class: Class<ReadModelInterface>
readonly properties: Array<PropertyMetadata>
readonly authorizer: ReadModelAuthorizer
readonly before: NonNullable<ReadModelFilterHooks<TReadModel>['before']>
}Projections are stored separately in config:
projections: Record<EntityName, Array<ProjectionMetadata>>
unProjections: Record<EntityName, Array<ProjectionMetadata>>Proposed Changes
- Create
readModel()DSL function inpackages/core/src/dsl/read-model.ts - Create
projection()DSL function (or integrate with read model) - Update metadata types to remove class references
- Update read model reader and searcher to use new metadata
- Reimplement decorators as wrappers
- Update GraphQL subscription infrastructure
Design Considerations
- Read models are the query side of CQRS — they need property metadata for GraphQL
- Projections link entities to read models — the DSL needs a clean way to express this
- Read models have authorization and before hooks (similar to commands)
- GraphQL subscriptions use read model classes — needs careful migration
Acceptance Criteria
-
readModel()andprojection()DSL functions created - Metadata updated to data-oriented format
- Decorators reimplemented as wrappers
- GraphQL queries and subscriptions work with new metadata
- All existing tests pass
- New tests for DSL definitions
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request