From 9b0271f53f176bb8aeecacf32631be54e32978a1 Mon Sep 17 00:00:00 2001 From: Ben Newman Date: Mon, 20 Jul 2020 18:26:21 -0400 Subject: [PATCH] Shorter default for getObservableFromLink deduplication parameter. --- src/core/QueryManager.ts | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/src/core/QueryManager.ts b/src/core/QueryManager.ts index 29f7af022ab..b614974774b 100644 --- a/src/core/QueryManager.ts +++ b/src/core/QueryManager.ts @@ -681,19 +681,13 @@ export class QueryManager { query: DocumentNode, context: any, variables?: OperationVariables, - deduplication?: boolean, + deduplication: boolean = + // Prefer context.queryDeduplication if specified. + context?.queryDeduplication ?? + this.queryDeduplication, ): Observable> { let observable: Observable>; - // Set default deduplication value if arg was not passed - if(typeof deduplication === 'undefined') { - if(typeof context === 'object' && 'queryDeduplication' in context) { - deduplication = context.queryDeduplication - } else { - deduplication = this.queryDeduplication - } - } - const { serverQuery } = this.transform(query); if (serverQuery) { const { inFlightLinkObservables, link } = this;