Skip to content

Commit

Permalink
Undo unique work, as it was unique from DataLoader already, so this i…
Browse files Browse the repository at this point in the history
…s just extra compute we don't need to consume.
  • Loading branch information
thekevinbrown committed Jan 22, 2025
1 parent fe0e3d9 commit a768b82
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/packages/core/src/base-loader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,15 +57,11 @@ const getBaseLoadOneLoader = <G = unknown, D = unknown>({
}

const fetchRecordsById = async (keys: readonly string[]) => {
const uniqueKeys = [...new Set(keys)];

logger.trace(
`DataLoader: Loading ${gqlTypeName}, ${uniqueKeys.length} record(s): (${uniqueKeys.join(', ')})`
);
logger.trace({ keys }, `DataLoader: Loading ${gqlTypeName}, ${keys.length} record(s)`);
const primaryKeyField = graphweaverMetadata.primaryKeyFieldForEntity(entity) as keyof D;

let listFilter = {
[`${String(primaryKeyField)}_in`]: uniqueKeys,
[`${String(primaryKeyField)}_in`]: keys,
// Note: Typecast here shouldn't be necessary, but FilterEntity<G> doesn't like this.
} as Filter<G>;

Expand Down

0 comments on commit a768b82

Please sign in to comment.