diff --git a/src/Executor/ReferenceExecutor.php b/src/Executor/ReferenceExecutor.php index 001dbd5..6e35f7c 100644 --- a/src/Executor/ReferenceExecutor.php +++ b/src/Executor/ReferenceExecutor.php @@ -259,9 +259,11 @@ class ReferenceExecutor implements ExecutorImplementation return $result->then( null, function ($error) { - $this->exeContext->addError($error); + if ($error instanceof Error) { + $this->exeContext->addError($error); - return $this->exeContext->promises->createFulfilled(null); + return $this->exeContext->promises->createFulfilled(null); + } } ); } diff --git a/src/Type/SchemaValidationContext.php b/src/Type/SchemaValidationContext.php index f00d3e5..5e52164 100644 --- a/src/Type/SchemaValidationContext.php +++ b/src/Type/SchemaValidationContext.php @@ -252,7 +252,7 @@ class SchemaValidationContext if (! $type instanceof NamedType) { $this->reportError( 'Expected GraphQL named type but got: ' . Utils::printSafe($type) . '.', - is_object($type) ? $type->astNode : null + $type instanceof Type ? $type->astNode : null ); continue; }