Skip to content

Commit 374b195

Browse files
committed
Fixing cache max age on processor.
1 parent 4dc9b62 commit 374b195

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

src/GraphQL/Execution/Processor.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -181,8 +181,11 @@ public function getCacheTags() {
181181
* {@inheritdoc}
182182
*/
183183
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();
184+
// Prevent caching if this is a mutation query.
185+
if (($request = $this->executionContext->getRequest()) && $request->hasMutations()) {
186+
return 0;
187+
}
188+
189+
return $this->metadata->getCacheMaxAge();
187190
}
188191
}

0 commit comments

Comments
 (0)