'Manually control apollo server cache

Is it possible to manually control the cache in Apollo Server?

I want to be able to configure the server to fetch data once, and then forever cache the following requests until I manually tell it to invalidate the cache and fetch new data the next time the same request is made.

I tried using Memory Cache and Redis cache, but I could not find any docs or examples that do what I want. I know how to set TTL or maxAge, but not how to manually control it.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source