mirror of
https://github.com/retailcrm/graphql-php.git
synced 2024-11-25 06:16:05 +03:00
Error handling and schema validation improvements (#404)
This commit is contained in:
parent
84a52c6c76
commit
ed1746e800
@ -259,10 +259,12 @@ class ReferenceExecutor implements ExecutorImplementation
|
|||||||
return $result->then(
|
return $result->then(
|
||||||
null,
|
null,
|
||||||
function ($error) {
|
function ($error) {
|
||||||
|
if ($error instanceof Error) {
|
||||||
$this->exeContext->addError($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) {
|
if (! $type instanceof NamedType) {
|
||||||
$this->reportError(
|
$this->reportError(
|
||||||
'Expected GraphQL named type but got: ' . Utils::printSafe($type) . '.',
|
'Expected GraphQL named type but got: ' . Utils::printSafe($type) . '.',
|
||||||
is_object($type) ? $type->astNode : null
|
$type instanceof Type ? $type->astNode : null
|
||||||
);
|
);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user