I have been trying to use the experimental_cache feature, specifically the external caching with redis.
In the documentation (Caching in the Apollo Router - Apollo GraphQL Docs) it states that “it can be tested by building a custom Router binary, with the Cargo feature experimental_cache”.
I have taken this to mean that it should be added to Cargo.toml like this:
[features]
experimental_cache = []
With configuration like this:
supergraph:
apq:
experimental_cache:
in_memory:
limit: 512
redis:
urls: ["redis://..."]
query_planning:
experimental_cache:
in_memory:
limit: 512
redis:
urls: ["redis://..."]
However, doing this gives me the error:
ERROR configuration had errors:
1. /supergraph/apq/experimental_cache
supergraph:
apq:
experimental_cache:
┌ in_memory:
| limit: 512
| redis:
| urls: ["redis://..."]
└-----> Additional properties are not allowed ('redis' was unexpected)
2. /supergraph/query_planning/experimental_cache
limit: 512
redis:
urls: ["redis://..."]
query_planning:
experimental_cache:
┌ in_memory:
| limit: 512
| redis:
| urls: ["redis://..."]
└-----> Additional properties are not allowed ('redis' was unexpected)
2023-01-19T14:03:27.064894Z ERROR no valid configuration was supplied
Error: no valid configuration was supplied
I’m pretty sure I need additional configuration in order to use the redis part (the experimental_cache works fine without it), but it is not described in the documentation.
If someone could point me in the right direction it would be greatly appreciated.
Router version is 1.6.0