Data Router ยท console.warn
join with a fn `localKey` needs an explicit string/fn `foreignKey`; ignoring the join.
Printed by Data Router, prefixed [lattice], since 1.39.0.
Warnings reference › data-router:join-no-foreignkey
- Identifier
data-router:join-no-foreignkey- Raised by
- Data Router
- Since
- 1.39.0
What happened
When localKey is a field *name*, the router uses the same name on the lookup side by default. When it is a function there is no name to reuse, so the lookup side has to be named explicitly; it was not, and the join was dropped.
The fix
Add foreignKey - a field name on the lookup rows, or a function that reads one.
The smallest fix
join: { from: 'customers', localKey: (r) => r.cust.id, foreignKey: 'id', fields: ['name'] }
Reference
Covered in full at the API reference.