From 88b85c9761b0334208606fecdb2ceff507c375ed Mon Sep 17 00:00:00 2001 From: Vladimir Razuvaev Date: Tue, 4 Jul 2017 16:29:30 +0700 Subject: [PATCH] Make 'errors' top property in response array --- src/Executor/ExecutionResult.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Executor/ExecutionResult.php b/src/Executor/ExecutionResult.php index a034d15..2628a69 100644 --- a/src/Executor/ExecutionResult.php +++ b/src/Executor/ExecutionResult.php @@ -54,13 +54,13 @@ class ExecutionResult implements \JsonSerializable { $result = []; - if (null !== $this->data) { - $result['data'] = $this->data; - } - if (!empty($this->errors)) { $result['errors'] = array_map($this->errorFormatter, $this->errors); } + + if (null !== $this->data) { + $result['data'] = $this->data; + } if (!empty($this->extensions)) { $result['extensions'] = (array) $this->extensions;