Support Apollo Cache Control Specification #1315
-
Support Apollo Cache Control SpecificationApollo Cache Control exposes cache control hints for an individual request under a cacheControl key in extensions. codeThis can be easily implemented by modifying line 45 of GraphQLRequestHandler as follows.
How to useCall below code at resolver.
response sample
CautionIf any resolver doesn't call the cacheControl.hint() function, the cacheControl will still appear in the response as following.
This is a specification of CacheControl in graphql-java. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Hello 👋 |
Beta Was this translation helpful? Give feedback.
Hello 👋
GraphQLRequestHandler
is an open class so you can easily extend it and implement the cache control logic above.