From b76e38cd434431aa2e8b72f607fec8ac25af37d5 Mon Sep 17 00:00:00 2001 From: Matt Hargett Date: Thu, 16 Jun 2022 20:55:03 -0700 Subject: [PATCH] Checking a string key on an array is not valid, narrow the type with Array.isArray instead. --- src/execution/execute.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/execution/execute.ts b/src/execution/execute.ts index be0323ca76..9c5f5b4dd4 100644 --- a/src/execution/execute.ts +++ b/src/execution/execute.ts @@ -170,7 +170,7 @@ export function execute(args: ExecutionArgs): PromiseOrValue { const exeContext = buildExecutionContext(args); // Return early errors if execution context failed. - if (!('schema' in exeContext)) { + if (Array.isArray(exeContext)) { return { errors: exeContext }; } @@ -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 }; }