mirror of
https://github.com/retailcrm/graphql-php.git
synced 2024-11-21 20:36:05 +03:00
Error handling and schema validation improvements (#404)
This commit is contained in:
parent
84a52c6c76
commit
ed1746e800
@ -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);
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user