Skip to content

Commit

Permalink
Use the restrict method instead.
Browse files Browse the repository at this point in the history
  • Loading branch information
mandiwise authored and glasser committed Jul 20, 2021
1 parent 2e8fb12 commit ee2ea53
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions federation-js/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,12 +98,12 @@ export const entitiesField: GraphQLFieldConfig<any, any> = {
);
}

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);
}
}

Expand Down

0 comments on commit ee2ea53

Please sign in to comment.