We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4dc9b62 commit 374b195Copy full SHA for 374b195
1 file changed
src/GraphQL/Execution/Processor.php
@@ -181,8 +181,11 @@ public function getCacheTags() {
181
* {@inheritdoc}
182
*/
183
public function getCacheMaxAge() {
184
- // Already controlled by cache metadata on mutation plugins. This
185
- // is a safety net for custom schemas.
186
- return $this->executionContext->getRequest()->hasMutations() ? 0 : $this->metadata->getCacheMaxAge();
+ // Prevent caching if this is a mutation query.
+ if (($request = $this->executionContext->getRequest()) && $request->hasMutations()) {
+ return 0;
187
+ }
188
+
189
+ return $this->metadata->getCacheMaxAge();
190
}
191
0 commit comments