From 57de1780dd1f57125aeb96897456f0589fa718ba Mon Sep 17 00:00:00 2001 From: rijkvanzanten Date: Mon, 13 Sep 2021 14:13:52 -0400 Subject: [PATCH] Fix childNode fetching --- api/src/database/run-ast.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/api/src/database/run-ast.ts b/api/src/database/run-ast.ts index 76cd2ec17b..7115698e81 100644 --- a/api/src/database/run-ast.ts +++ b/api/src/database/run-ast.ts @@ -163,7 +163,11 @@ async function parseCurrentLevel( const fieldNodes = columnsToSelect.map( (column: string) => - children.find((childNode) => childNode.fieldKey === column) ?? { type: 'field', name: column, fieldKey: column } + children.find((childNode) => childNode.type === 'field' && childNode.fieldKey === column) ?? { + type: 'field', + name: column, + fieldKey: column, + } ) as FieldNode[]; return { fieldNodes, nestedCollectionNodes, primaryKeyField };