Skip to content

Commit f2a6e9d

Browse files
committed
add less than one value case
1 parent d9342ba commit f2a6e9d

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

src/execution/__tests__/variables-test.ts

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1167,6 +1167,28 @@ describe('Execute: Handles inputs', () => {
11671167
});
11681168
});
11691169

1170+
it('errors with OneOf Input Object with no fields', () => {
1171+
const result = executeQuery(`
1172+
{
1173+
fieldWithOneOfObjectInput(input: {})
1174+
}
1175+
`);
1176+
1177+
expectJSON(result).toDeepEqual({
1178+
data: {
1179+
fieldWithOneOfObjectInput: null,
1180+
},
1181+
errors: [
1182+
{
1183+
message:
1184+
'Argument "input" of type "TestOneOfInputObject" has invalid value { }.',
1185+
path: ['fieldWithOneOfObjectInput'],
1186+
locations: [{ line: 3, column: 44 }],
1187+
},
1188+
],
1189+
});
1190+
});
1191+
11701192
it('errors with OneOf Input Object with a single null value', () => {
11711193
const result = executeQuery(`
11721194
{

0 commit comments

Comments
 (0)