Data Router ยท console.warn
join aggregate "{name}" is not a { fn, field...
Printed by Data Router, prefixed [lattice], since 1.84.0.
Warnings reference › data-router:join-aggregate-bad-spec
- Identifier
data-router:join-aggregate-bad-spec- Raised by
- Data Router
- Since
- 1.84.0
What happened
A rollup-onto-parent join's aggregate entry is not the { fn, field? } object the router reduces over - it is missing a string fn (a bare value, say). The named result is omitted and the other reducers still compute.
The fix
Give each aggregate a { fn, field? } object: the reducer name and, for every fn except count, the child field.
The smallest fix
join: { from: 'line', foreignKey: 'orderId', many: true, aggregate: { lines: { fn: 'count' } } }
Reference
Covered in full at the API reference.