diff --git a/src/GraphQL/Execution/QueryProcessor.php b/src/GraphQL/Execution/QueryProcessor.php index 941b664..a2a7f27 100644 --- a/src/GraphQL/Execution/QueryProcessor.php +++ b/src/GraphQL/Execution/QueryProcessor.php @@ -100,9 +100,9 @@ class QueryProcessor { $metadata->addCacheableDependency($container->get('metadata')); } - // Prevent caching if this is a mutation query. + // Prevent caching if this is a mutation query or an error occurs. $request = $context->getRequest(); - if (!empty($request) && $request->hasMutations()) { + if (!empty($request) && $request->hasMutations() || $context->hasErrors()) { $metadata->setCacheMaxAge(0); }