@Deprecated @PublicApi public class CacheControl extends java.lang.Object
To best use this class you need to pass a CacheControl object to each DataFetcher
and have them decide on
the caching hint values.
The easiest way to do this is create a CacheControl object at query start and pass it in as a "context" object via ExecutionInput.getGraphQLContext()
and then have
each DataFetcher
that wants to make cache control hints use that.
Then at the end of the query you would call addTo(graphql.ExecutionResult)
to record the cache control hints into the ExecutionResult
extensions map as per the specification.
Modifier and Type | Class and Description |
---|---|
static class |
CacheControl.Scope
Deprecated.
If the scope is set to PRIVATE, this indicates anything under this path should only be cached per-user,
unless the value is overridden on a sub path.
|
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CACHE_CONTROL_EXTENSION_KEY
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
ExecutionResult |
addTo(ExecutionResult executionResult)
Deprecated.
- Apollo has deprecated the Cache Control specification
|
CacheControl |
hint(DataFetchingEnvironment dataFetchingEnvironment,
CacheControl.Scope scope)
Deprecated.
- Apollo has deprecated the Cache Control specification
|
CacheControl |
hint(DataFetchingEnvironment dataFetchingEnvironment,
java.lang.Integer maxAge)
Deprecated.
- Apollo has deprecated the Cache Control specification
|
CacheControl |
hint(DataFetchingEnvironment dataFetchingEnvironment,
java.lang.Integer maxAge,
CacheControl.Scope scope)
Deprecated.
- Apollo has deprecated the Cache Control specification
|
CacheControl |
hint(ResultPath path,
CacheControl.Scope scope)
Deprecated.
- Apollo has deprecated the Cache Control specification
|
CacheControl |
hint(ResultPath path,
java.lang.Integer maxAge)
Deprecated.
- Apollo has deprecated the Cache Control specification
|
CacheControl |
hint(ResultPath path,
java.lang.Integer maxAge,
CacheControl.Scope scope)
Deprecated.
- Apollo has deprecated the Cache Control specification
|
static CacheControl |
newCacheControl()
Deprecated.
- Apollo has deprecated the Cache Control specification
|
public static final java.lang.String CACHE_CONTROL_EXTENSION_KEY
@Deprecated public CacheControl hint(ResultPath path, java.lang.Integer maxAge, CacheControl.Scope scope)
path
- the path to the field that has the cache control hintmaxAge
- the caching time in secondsscope
- the scope of the cache control hint@Deprecated public CacheControl hint(ResultPath path, CacheControl.Scope scope)
path
- the path to the field that has the cache control hintscope
- the scope of the cache control hint@Deprecated public CacheControl hint(ResultPath path, java.lang.Integer maxAge)
path
- the path to the field that has the cache control hintmaxAge
- the caching time in seconds@Deprecated public CacheControl hint(DataFetchingEnvironment dataFetchingEnvironment, java.lang.Integer maxAge, CacheControl.Scope scope)
dataFetchingEnvironment
- the path to the field that has the cache control hintmaxAge
- the caching time in secondsscope
- the scope of the cache control hint@Deprecated public CacheControl hint(DataFetchingEnvironment dataFetchingEnvironment, java.lang.Integer maxAge)
dataFetchingEnvironment
- the path to the field that has the cache control hintmaxAge
- the caching time in seconds@Deprecated public CacheControl hint(DataFetchingEnvironment dataFetchingEnvironment, CacheControl.Scope scope)
dataFetchingEnvironment
- the path to the field that has the cache control hintscope
- the scope of the cache control hint@Deprecated public static CacheControl newCacheControl()
@Deprecated public ExecutionResult addTo(ExecutionResult executionResult)
ExecutionResult
object back outexecutionResult
- the starting execution result object