From 9ada6069193c7f2ffd63435d283b42590ac2333a Mon Sep 17 00:00:00 2001 From: chriszarate Date: Sun, 2 Dec 2018 07:43:51 +0700 Subject: [PATCH] Fix linting issue and typos. (cherry picked from commit c33e41f2bf44b20b3d79b00d335c3a5ea5975116) --- src/Server/OperationParams.php | 4 ++-- tests/Server/RequestParsingTest.php | 8 ++------ 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/src/Server/OperationParams.php b/src/Server/OperationParams.php index a76f86e..65edfc8 100644 --- a/src/Server/OperationParams.php +++ b/src/Server/OperationParams.php @@ -96,8 +96,8 @@ class OperationParams $instance->readOnly = (bool) $readonly; // Apollo server/client compatibility: look for the queryid in extensions - if (isset($params['extensions']['persistedQuery']['sha256Hash']) && empty($instance->query) && empty($instance->queryid)) { - $instance->queryId = $params['extensions']['persistedQuery']['sha256Hash']; + if (isset($params['extensions']['persistedQuery']['sha256Hash']) && empty($instance->query) && empty($instance->queryId)) { + $instance->queryId = $params['extensions']['persistedQuery']['sha256Hash']; } return $instance; diff --git a/tests/Server/RequestParsingTest.php b/tests/Server/RequestParsingTest.php index 75412b1..f935281 100644 --- a/tests/Server/RequestParsingTest.php +++ b/tests/Server/RequestParsingTest.php @@ -335,12 +335,8 @@ class RequestParsingTest extends TestCase public function testParsesApolloPersistedQueryJSONRequest() : void { - $queryId = 'my-query-id'; - $extensions = [ - 'persistedQuery' => [ - 'sha256Hash' => $queryId, - ], - ]; + $queryId = 'my-query-id'; + $extensions = ['persistedQuery' => ['sha256Hash' => $queryId]]; $variables = ['test' => 1, 'test2' => 2]; $operation = 'op';