diff --git a/src/core/QueryManager.ts b/src/core/QueryManager.ts index da601fca5b1..07e32e94abe 100644 --- a/src/core/QueryManager.ts +++ b/src/core/QueryManager.ts @@ -1534,24 +1534,16 @@ export class QueryManager { public maskOperation(options: MaskOperationOptions) { const { document, data } = options; - const { cache } = this; - if (!this.dataMasking) { - return data; - } - - return maskOperation(data, document, cache); + return this.dataMasking ? maskOperation(data, document, this.cache) : data; } public maskFragment(options: MaskFragmentOptions) { const { data, fragment, fragmentName } = options; - const { cache } = this; - - if (!this.dataMasking) { - return data; - } - return maskFragment(data, fragment, cache, fragmentName); + return this.dataMasking ? + maskFragment(data, fragment, this.cache, fragmentName) + : data; } private fetchQueryByPolicy(