Skip to content

Commit 749b77c

Browse files
committed
add test for error from completeValue in AsyncIterable resolver
1 parent 401d13b commit 749b77c

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

src/execution/__tests__/lists-test.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,24 @@ describe('Execute: Accepts async iterables as list value', () => {
103103
],
104104
});
105105
});
106+
107+
it('Handles errors from `completeValue` in AsyncIterables', async () => {
108+
async function* listField() {
109+
yield await 'two';
110+
yield await {};
111+
}
112+
113+
expect(await complete({ listField })).to.deep.equal({
114+
data: { listField: ['two', null] },
115+
errors: [
116+
{
117+
message: 'String cannot represent value: {}',
118+
locations: [{ line: 1, column: 3 }],
119+
path: ['listField', 1],
120+
},
121+
],
122+
});
123+
});
106124
});
107125

108126
describe('Execute: Handles list nullability', () => {

0 commit comments

Comments
 (0)