Skip to content

Commit 3efd208

Browse files
committed
chore: update cache control instrumentation documentation
1 parent af4ca9e commit 3efd208

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

graphql-java-support/src/main/java/com/apollographql/federation/graphqljava/caching/CacheControlInstrumentation.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@
1818
* A GraphQL Java Instrumentation that computes a max age for an operation based on @cacheControl
1919
* directives.
2020
*
21+
* By default, this instrumentation will only set the `Cache-Control` `max-age` value IF positive int
22+
* value is provided. If you would rather want to return explicit `max-age=0` values, you need to
23+
* explicitly opt-in to this behavior by specifying `allowZeroMaxAge=true` constructor value.
24+
*
2125
* <p>You can retrieve the "max-age=..." header value with a {@link GraphQLContext}: <code>
2226
* String cacheControlHeader = CacheControlInstrumentation.cacheControlContext(context);
2327
* </code>

0 commit comments

Comments
 (0)