Don't treat top level m2os as relational

This commit is contained in:
rijkvanzanten
2020-10-15 10:40:08 -04:00
parent 1634ff2500
commit 5e1a54aee7

View File

@@ -83,12 +83,11 @@ export default async function getASTFromQuery(
for (const field of fields) {
const isRelational =
field.includes('.') ||
// We'll always treat top level o2m fields as a related item. This is an alias field, otherwise it won't return
// anything
!!relations.find(
(relation) =>
(relation.many_collection === parentCollection &&
relation.many_field === field) ||
(relation.one_collection === parentCollection &&
relation.one_field === field)
relation.one_collection === parentCollection && relation.one_field === field
);
if (isRelational) {