Skip to content

Commit 846cbd0

Browse files
committed
fix projectionHelper: make projection flat
1 parent 72813c7 commit 846cbd0

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/resolvers/helpers/projection.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ import type {
77
export function projectionHelper(resolveParams: ExtendedResolveParams): void {
88
const projection = resolveParams.projection;
99
if (projection) {
10-
resolveParams.query = resolveParams.query.select(projection); // eslint-disable-line
10+
const flatProjection = {};
11+
Object.keys(projection).forEach(key => {
12+
flatProjection[key] = !!projection[key];
13+
});
14+
resolveParams.query = resolveParams.query.select(flatProjection); // eslint-disable-line
1115
}
1216
}

0 commit comments

Comments
 (0)