mirror of
https://github.com/retailcrm/graphql-php.git
synced 2024-11-26 06:46:02 +03:00
Make 'errors' top property in response array
This commit is contained in:
parent
1c41fb27ed
commit
88b85c9761
@ -54,13 +54,13 @@ class ExecutionResult implements \JsonSerializable
|
|||||||
{
|
{
|
||||||
$result = [];
|
$result = [];
|
||||||
|
|
||||||
if (null !== $this->data) {
|
|
||||||
$result['data'] = $this->data;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!empty($this->errors)) {
|
if (!empty($this->errors)) {
|
||||||
$result['errors'] = array_map($this->errorFormatter, $this->errors);
|
$result['errors'] = array_map($this->errorFormatter, $this->errors);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (null !== $this->data) {
|
||||||
|
$result['data'] = $this->data;
|
||||||
|
}
|
||||||
|
|
||||||
if (!empty($this->extensions)) {
|
if (!empty($this->extensions)) {
|
||||||
$result['extensions'] = (array) $this->extensions;
|
$result['extensions'] = (array) $this->extensions;
|
||||||
|
Loading…
Reference in New Issue
Block a user