mirror of
https://github.com/retailcrm/graphql-php.git
synced 2024-11-22 04:46:04 +03:00
Removing data elements from response if the error throwing
This commit is contained in:
parent
ec0985619f
commit
c7f114d90b
@ -311,7 +311,10 @@ class Executor
|
||||
return null;
|
||||
})
|
||||
->then(function ($data) {
|
||||
return new ExecutionResult((array) $data, $this->exeContext->errors);
|
||||
if ($data === null){
|
||||
$data = (array) $data;
|
||||
}
|
||||
return new ExecutionResult($data, $this->exeContext->errors);
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -732,7 +732,6 @@ class NonNullTest extends \PHPUnit_Framework_TestCase
|
||||
';
|
||||
|
||||
$expected = [
|
||||
'data' => null,
|
||||
'errors' => [
|
||||
FormattedError::create($this->nonNullSyncError->getMessage(), [new SourceLocation(2, 17)])
|
||||
]
|
||||
@ -750,7 +749,6 @@ class NonNullTest extends \PHPUnit_Framework_TestCase
|
||||
$ast = Parser::parse($doc);
|
||||
|
||||
$expected = [
|
||||
'data' => null,
|
||||
'errors' => [
|
||||
FormattedError::create($this->nonNullPromiseError->getMessage(), [new SourceLocation(2, 17)]),
|
||||
]
|
||||
@ -789,7 +787,6 @@ class NonNullTest extends \PHPUnit_Framework_TestCase
|
||||
$ast = Parser::parse($doc);
|
||||
|
||||
$expected = [
|
||||
'data' => null,
|
||||
'errors' => [
|
||||
[
|
||||
'debugMessage' => 'Cannot return null for non-nullable field DataType.nonNullPromise.',
|
||||
|
Loading…
Reference in New Issue
Block a user