Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions src/execution/__tests__/oneof-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,30 @@ describe('Execute: Handles OneOf Input Objects', () => {
});
});

it('accepts multiple variable key as long as only one has a value', () => {
// NOTE: This is an *invalid* query, but it should be an *executable* query.
const query = `
query ($a: String, $b: String) {
test(input: { a: $a, b: $b }) {
a
b
}
}
`;
const result = executeQuery(query, rootValue, {
a: 'abc',
});

expectJSON(result).toDeepEqual({
data: {
test: {
a: 'abc',
b: null,
},
},
});
});

it('rejects a variable with multiple non-null keys', () => {
const query = `
query ($input: TestInputObject!) {
Expand Down