InferredQuerySchemaSource

class InferredQuerySchemaSource(modelSource: QueryModelSource, typeResolver: (QuerySchemaContext) -> Class<*> = ::payloadOwnerType) : QuerySchemaSource

Declares the fields a QueryModelSource infers from the domain types of a built-in model.

The model decides which types to describe: a Snapshot's payload is the aggregate state; an EventStream's payload (body.body) is one variant per domain event type, each tagged with its bodyType, and body.bodyType lists the event types. Field annotations get their query meaning here: Sensitive becomes a MaskRule, QueryTemporal and standard date formats become Temporal encodings, QueryReference and AggregateId members become References. Declarations are cached per model, type and bounded context.

Parameters

modelSource

the type inference that describes each domain type.

typeResolver

the type that owns a model's payload: the state type of a Snapshot, the aggregate type of an EventStream (whose event types are read from the aggregate's metadata).

Constructors

Link copied to clipboard
constructor(modelSource: QueryModelSource, typeResolver: (QuerySchemaContext) -> Class<*> = ::payloadOwnerType)

Properties

Link copied to clipboard
open override val priority: Int

Functions

Link copied to clipboard
open override fun load(context: QuerySchemaContext): Flux<QuerySchemaDeclaration>

Types are described once per model; their declaration is shared by every context unless a QueryReference refers into the model's own bounded context, which then has one per context.