diff --git a/federation-js/src/types.ts b/federation-js/src/types.ts index eeb592033..b1fe857fe 100644 --- a/federation-js/src/types.ts +++ b/federation-js/src/types.ts @@ -98,12 +98,12 @@ export const entitiesField: GraphQLFieldConfig = { ); } - if (info.cacheControl && info.cacheControl.cacheHint.replace) { + if (info.cacheControl?.cacheHint?.restrict) { const cacheHint: CacheHint | undefined = info.cacheControl.cacheHintFromType(type); - if (cacheHint) { - info.cacheControl.cacheHint.replace(cacheHint); + if (cacheHint?.maxAge || cacheHint?.scope) { + info.cacheControl.cacheHint.restrict(cacheHint); } }