Created
January 3, 2018 03:44
-
-
Save xuxucode/1ea55ba024eeb5b1bf4e6734f4dc9ce8 to your computer and use it in GitHub Desktop.
Revisions
-
xuxucode created this gist
Jan 3, 2018 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,15 @@ 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); }