Fix linting issue and typos.

(cherry picked from commit c33e41f2bf)
This commit is contained in:
chriszarate 2018-12-02 07:43:51 +07:00 committed by Vladimir Razuvaev
parent 1e778d259e
commit 9ada606919
2 changed files with 4 additions and 8 deletions

View File

@ -96,8 +96,8 @@ class OperationParams
$instance->readOnly = (bool) $readonly; $instance->readOnly = (bool) $readonly;
// Apollo server/client compatibility: look for the queryid in extensions // Apollo server/client compatibility: look for the queryid in extensions
if (isset($params['extensions']['persistedQuery']['sha256Hash']) && empty($instance->query) && empty($instance->queryid)) { if (isset($params['extensions']['persistedQuery']['sha256Hash']) && empty($instance->query) && empty($instance->queryId)) {
$instance->queryId = $params['extensions']['persistedQuery']['sha256Hash']; $instance->queryId = $params['extensions']['persistedQuery']['sha256Hash'];
} }
return $instance; return $instance;

View File

@ -335,12 +335,8 @@ class RequestParsingTest extends TestCase
public function testParsesApolloPersistedQueryJSONRequest() : void public function testParsesApolloPersistedQueryJSONRequest() : void
{ {
$queryId = 'my-query-id'; $queryId = 'my-query-id';
$extensions = [ $extensions = ['persistedQuery' => ['sha256Hash' => $queryId]];
'persistedQuery' => [
'sha256Hash' => $queryId,
],
];
$variables = ['test' => 1, 'test2' => 2]; $variables = ['test' => 1, 'test2' => 2];
$operation = 'op'; $operation = 'op';