Fix a bug that was not automatically adding the join column to the select list when populated

This commit is contained in:
Convly 2022-10-20 15:32:51 +02:00
parent 65feb971b8
commit b4f4b499b9

View File

@ -83,7 +83,13 @@ const processPopulate = (populate, ctx) => {
continue;
}
// make sure id is present for future populate queries
// Make sure to query the join column value if needed,
// so that we can apply the populate later on
if (attribute.joinColumn) {
qb.addSelect(attribute.joinColumn.name);
}
// Make sure id is present for future populate queries
if (_.has('id', meta.attributes)) {
qb.addSelect('id');
}