Skip to content

Commit b4b0d4c

Browse files
andrew0EmrysMyrddin
authored andcommitted
address review comments
1 parent 88602c3 commit b4b0d4c

File tree

2 files changed

+5
-11
lines changed

2 files changed

+5
-11
lines changed

.changeset/breezy-feet-greet.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
'@envelop/core': patch
2+
'@envelop/core': minor
33
---
44

55
Handle incremental execution errors in useErrorHandler

packages/core/test/plugins/use-error-handler.spec.ts

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import {
55
collectAsyncIteratorValues,
66
createTestkit,
77
} from '@envelop/testing';
8-
import { ExecutionResult, IncrementalExecutionResult, Plugin } from '@envelop/types';
8+
import { Plugin } from '@envelop/types';
99
import { normalizedExecutor } from '@graphql-tools/executor';
1010
import { makeExecutableSchema } from '@graphql-tools/schema';
1111
import { createGraphQLError } from '@graphql-tools/utils';
@@ -168,15 +168,9 @@ describe('useErrorHandler', () => {
168168
],
169169
schema,
170170
);
171-
const result = (await testInstance.execute(`query { ... @defer { foo } }`)) as
172-
| ExecutionResult
173-
| IncrementalExecutionResult
174-
| AsyncIterableIterator<ExecutionResult>
175-
| AsyncIterableIterator<IncrementalExecutionResult>;
176-
if ('next' in result) {
177-
for await (const _r of result) {
178-
}
179-
}
171+
const result = await testInstance.execute(`query { ... @defer { foo } }`);
172+
assertStreamExecutionValue(result);
173+
await collectAsyncIteratorValues(result);
180174

181175
expect(mockHandler).toHaveBeenCalledWith(expect.objectContaining({ phase: 'execution' }));
182176
});

0 commit comments

Comments
 (0)