Skip to content

Commit

Permalink
Checking a string key on an array is not valid, narrow the type with …
Browse files Browse the repository at this point in the history
…Array.isArray instead.
  • Loading branch information
matthargett committed Jun 17, 2022
1 parent cfbc023 commit b76e38c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/execution/execute.ts
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ export function execute(args: ExecutionArgs): PromiseOrValue<ExecutionResult> {
const exeContext = buildExecutionContext(args);

// Return early errors if execution context failed.
if (!('schema' in exeContext)) {
if (Array.isArray(exeContext)) {
return { errors: exeContext };
}

Expand Down Expand Up @@ -1090,7 +1090,7 @@ export function createSourceEventStream(
const exeContext = buildExecutionContext(args);

// Return early errors if execution context failed.
if (!('schema' in exeContext)) {
if (Array.isArray(exeContext)) {
return { errors: exeContext };
}

Expand Down

0 comments on commit b76e38c

Please sign in to comment.