From 23a808050bd7a433d75295ce537bcbaf7c6ec873 Mon Sep 17 00:00:00 2001 From: Jerel Miller Date: Fri, 23 Aug 2024 22:49:22 -0600 Subject: [PATCH] Use ternary to handle masking in QueryManager --- src/core/QueryManager.ts | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) 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(