Skip to content

Commit

Permalink
When resolving batches of related items, only retrieve unique Ids
Browse files Browse the repository at this point in the history
  • Loading branch information
molomby committed Feb 27, 2024
1 parent 45c0340 commit 29b8b9c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/core/src/lib/core/queries/output-field.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
)

Expand Down

0 comments on commit 29b8b9c

Please sign in to comment.