(
document: DocumentNode,
numCalls: number,
rootValue: unknown = {},
)
| 170 | } |
| 171 | |
| 172 | async function completeAsync( |
| 173 | document: DocumentNode, |
| 174 | numCalls: number, |
| 175 | rootValue: unknown = {}, |
| 176 | ) { |
| 177 | const result = await experimentalExecuteIncrementally({ |
| 178 | schema, |
| 179 | document, |
| 180 | rootValue, |
| 181 | }); |
| 182 | |
| 183 | assert('initialResult' in result); |
| 184 | |
| 185 | const iterator = result.subsequentResults[Symbol.asyncIterator](); |
| 186 | |
| 187 | const promises: Array< |
| 188 | PromiseOrValue< |
| 189 | IteratorResult< |
| 190 | InitialIncrementalExecutionResult | SubsequentIncrementalExecutionResult |
| 191 | > |
| 192 | > |
| 193 | > = [{ done: false, value: result.initialResult }]; |
| 194 | for (let i = 0; i < numCalls; i++) { |
| 195 | promises.push(iterator.next()); |
| 196 | } |
| 197 | // eslint-disable-next-line @typescript-eslint/await-thenable |
| 198 | return Promise.all(promises); |
| 199 | } |
| 200 | |
| 201 | describe('Execute: stream directive', () => { |
| 202 | it('Can stream a list field', async () => { |
no test coverage detected