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';