From e078c891160ded89f8b1eb89c970400501e20390 Mon Sep 17 00:00:00 2001 From: Martijn Date: Mon, 30 Mar 2026 16:38:09 +0200 Subject: [PATCH] Add documentation for exclusion from GraphQL cache Related PR: https://github.com/statamic/cms/pull/14391 --- content/collections/docs/graphql.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/content/collections/docs/graphql.md b/content/collections/docs/graphql.md index e0daab877..e51b1466a 100644 --- a/content/collections/docs/graphql.md +++ b/content/collections/docs/graphql.md @@ -1589,6 +1589,20 @@ GraphQL uses a basic whole-response cache by default. Each query/variables combi ], ``` +### Cache exclusion + +Responses can be excluded from the whole-response cache by adding their query names to the `exclude` array. + +```php +'cache' => [ + 'expiry' => 60, + 'exclude' => [ + 'ping', + 'user', + ], +], +``` + ### Cache invalidation Cached responses are automatically invalidated when content is changed. Depending on your GraphQL usage and blueprint schema, you may also wish to ignore specific events when invalidating.