diff --git a/packages/core/src/lib/core/queries/output-field.ts b/packages/core/src/lib/core/queries/output-field.ts index a86e9e6ea82..527b8be8c23 100644 --- a/packages/core/src/lib/core/queries/output-field.ts +++ b/packages/core/src/lib/core/queries/output-field.ts @@ -109,10 +109,11 @@ async function fetchRelatedItems ( return toFetch.map(() => undefined) } + const toFetchUnique = Array.from(new Set(toFetch)) const resolvedWhere = await accessControlledFilter( foreignList, context, - { [idFieldKey]: { in: toFetch } }, + { [idFieldKey]: { in: toFetchUnique } }, accessFilters )