Skip to content

Commit af742d8

Browse files
committed
fix(resolvers): stop calling Object.assign with boolean arguments
1 parent bf70f7f commit af742d8

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
- update `@types/graphql` to latest version (`^0.13.3`)
77
### Fixes
88
- fix throwing error when `of => objectType` wasn't provided in abstract resolver class
9+
- fix calling `Object.assign` with boolean arguments (#111)
910

1011
## v0.12.2
1112
### Features

src/resolvers/validate-arg.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,11 @@ export async function validateArg<T extends Object>(
1212
return arg;
1313
}
1414

15-
const validatorOptions: ValidatorOptions = Object.assign({}, globalValidate, argValidate);
15+
const validatorOptions: ValidatorOptions = Object.assign(
16+
{},
17+
typeof globalValidate === "object" ? globalValidate : {},
18+
typeof argValidate === "object" ? argValidate : {},
19+
);
1620
if (validatorOptions.skipMissingProperties !== false) {
1721
validatorOptions.skipMissingProperties = true;
1822
}

0 commit comments

Comments
 (0)