@@ -248,7 +248,7 @@ public function executeOperation(OperationParams $params, GraphQLContext $contex
248248 $ params ->variables ,
249249 null ,
250250 $ params ->operation ,
251- $ params ->queryId
251+ $ params ->queryId ,
252252 );
253253 } catch (\Throwable $ throwable ) {
254254 return $ this ->toSerializableArray (
@@ -264,7 +264,7 @@ public function executeOperation(OperationParams $params, GraphQLContext $contex
264264 *
265265 * @api
266266 */
267- public function parse (string $ query , string &$ hash = null ): DocumentNode
267+ public function parse (string $ query , ? string &$ hash = null ): DocumentNode
268268 {
269269 $ cacheConfig = $ this ->configRepository ->get ('lighthouse.query_cache ' );
270270 $ hash = hash ('sha256 ' , $ query );
@@ -385,29 +385,25 @@ protected function parseQuery(string $query): DocumentNode
385385 ]);
386386 }
387387
388-
389388 /**
390389 * Execute the validation rules that are cacheable.
391390 *
392391 * @return array<Error>
393- *
394- * @throws \Exception
395392 */
396393 protected function executeAndCacheValidationRules (
397394 SchemaType $ schema ,
398395 ?string $ schemaHash ,
399396 DocumentNode $ query ,
400- ?string $ queryHash
401- ): array
402- {
403- if (!$ this ->providesValidationRules instanceof ProvidesCacheableValidationRules) {
397+ ?string $ queryHash ,
398+ ): array {
399+ if (! $ this ->providesValidationRules instanceof ProvidesCacheableValidationRules) {
404400 return [];
405401 }
406402
407403 $ validationRules = $ this ->providesValidationRules ->cacheableValidationRules ();
408404 foreach ($ validationRules as $ rule ) {
409405 if ($ rule instanceof QueryComplexity) {
410- throw new \InvalidArgumentException (" QueryComplexity rule should not be registered in cacheableValidationRules " );
406+ throw new \InvalidArgumentException (' QueryComplexity rule should not be registered in cacheableValidationRules ' );
411407 }
412408 }
413409
@@ -422,7 +418,7 @@ protected function executeAndCacheValidationRules(
422418 /** @var CacheFactory $cacheFactory */
423419 $ cacheFactory = Container::getInstance ()->make (CacheFactory::class);
424420 $ store = $ cacheFactory ->store ($ cacheConfig ['store ' ]);
425- if ($ store ->get ($ cacheKey ) === true ){
421+ if ($ store ->get ($ cacheKey ) === true ) {
426422 return [];
427423 }
428424
@@ -432,6 +428,7 @@ protected function executeAndCacheValidationRules(
432428 }
433429
434430 $ store ->put ($ cacheKey , true , $ cacheConfig ['ttl ' ]);
431+
435432 return [];
436433 }
437434}
0 commit comments