Skip to content

Commit b76e38c

Browse files
committed
Checking a string key on an array is not valid, narrow the type with Array.isArray instead.
1 parent cfbc023 commit b76e38c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/execution/execute.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ export function execute(args: ExecutionArgs): PromiseOrValue<ExecutionResult> {
170170
const exeContext = buildExecutionContext(args);
171171

172172
// Return early errors if execution context failed.
173-
if (!('schema' in exeContext)) {
173+
if (Array.isArray(exeContext)) {
174174
return { errors: exeContext };
175175
}
176176

@@ -1090,7 +1090,7 @@ export function createSourceEventStream(
10901090
const exeContext = buildExecutionContext(args);
10911091

10921092
// Return early errors if execution context failed.
1093-
if (!('schema' in exeContext)) {
1093+
if (Array.isArray(exeContext)) {
10941094
return { errors: exeContext };
10951095
}
10961096

0 commit comments

Comments
 (0)