Skip to content

Commit 5cea229

Browse files
committed
Add test
1 parent eae6f5a commit 5cea229

File tree

2 files changed

+11
-6
lines changed

2 files changed

+11
-6
lines changed

src/validation/__tests__/VariablesInAllowedPositionRule-test.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -370,6 +370,16 @@ describe('Validates OneOf Input Objects', () => {
370370
`);
371371
});
372372

373+
it('Undefined variable in oneOf input object', () => {
374+
expectErrors(`
375+
{
376+
complicatedArgs {
377+
oneOfArgField(oneOfArg: { stringField: $undefinedVariable })
378+
}
379+
}
380+
`).toDeepEqual([]);
381+
});
382+
373383
it('Forbids one nullable variable', () => {
374384
expectErrors(`
375385
query ($string: String) {

src/validation/rules/ValuesOfCorrectTypeRule.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -82,12 +82,7 @@ export function ValuesOfCorrectTypeRule(
8282
}
8383

8484
if (type.isOneOf) {
85-
validateOneOfInputObject(
86-
context,
87-
node,
88-
type,
89-
fieldNodeMap,
90-
);
85+
validateOneOfInputObject(context, node, type, fieldNodeMap);
9186
}
9287
},
9388
ObjectField(node) {

0 commit comments

Comments
 (0)