Skip to content

Commit be6eabc

Browse files
committed
improvement
1 parent f51424a commit be6eabc

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

packages/schema/src/plugins/zod/transformer.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -352,8 +352,9 @@ export default class Transformer {
352352
if (mappedInputTypeName.includes('NestedInput')) {
353353
candidates.push(...candidates.map((name) => name.replace('NestedInput', 'Input')));
354354
}
355-
const foundInputType = this.inputObjectTypes.find((it) => candidates.includes(it.name));
356-
const finalMappedName = foundInputType ? foundInputType.name : mappedInputTypeName;
355+
356+
const finalMappedName =
357+
candidates.find((name) => this.inputObjectTypes.some((it) => it.name === name)) ?? mappedInputTypeName;
357358

358359
processedInputType = { ...inputType, type: finalMappedName };
359360
}

0 commit comments

Comments
 (0)