reym
Projections/Schema/Field

@aggregateEvents

The @aggregateEvents directive aggregates all events that changed the projection entry. This directive can only be used in conjunction with the [EventEnvelope!]! field type at the root level of a projection:

Example

user.graphql
type User @upsertOn(...) {
    name: String!
    events: [EventEnvelope!]! @aggregateEvents
}

In this case, the events field will contain all events that changed the User projection entry.

Event Envelope

The field type [EventEnvelope!]! is a special field type that can only be used in this form at the root level of a projection (not in a nested object). It will automatically aggregate all events that are applied on the projection entry into an array. Use the type in conjunction with the @aggregateEvents directive. This is useful for debugging.

On this page