Using makeExecutableSchema shows cacheControl hints on all fields, using mergeSchemas only shows cacheControl hints on root fields:
https://launchpad.graphql.com/r9lmrp989n correctly shows (with cacheControl enabled):
"cacheControl": {
"version": 1,
"hints": [
{
"path": [
"myTest"
],
"maxAge": 120
},
{
"path": [
"myTest",
0,
"title"
],
"maxAge": 60
},
{
"path": [
"myTest",
0,
"description"
],
"scope": "PRIVATE"
}
]
}
Now using mergeSchemas instead of makeExecutableSchema gives:
"cacheControl": {
"version": 1,
"hints": [
{
"path": [
"myTest"
],
"maxAge": 0
}
]
}
@stubailo I am interesting in helping contribute to this. I saw a lot of issues that are similar to this (a combo of directives + stitching), and I am wondering if there is any active work being done?
Do we already know where the gaps exist? Thanks! 😄
I think I solved the reason causing this issue in PR #569. Can you confirm that recreating astNode property solves your issue?
@BassT I'll test it using your PR and report back.
I just tested locally on v2.17.0 and the cache hints were propagated appropriately.
I realized that in v2.17.0 cache hints are only working for GraphQL types. I submitted PR #580, which also makes cache hints work for fields (and therefore queries).
Going to work on passing through dynamic cache hints as well as part of #890
@mfix22 if you're still interested let's talk soon!
Most helpful comment
I just tested locally on
v2.17.0and the cache hints were propagated appropriately.