Skip to content

Commit

Permalink
Shorter default for getObservableFromLink deduplication parameter.
Browse files Browse the repository at this point in the history
  • Loading branch information
benjamn committed Jul 20, 2020
1 parent c85c804 commit 9b0271f
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions src/core/QueryManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -681,19 +681,13 @@ export class QueryManager<TStore> {
query: DocumentNode,
context: any,
variables?: OperationVariables,
deduplication?: boolean,
deduplication: boolean =
// Prefer context.queryDeduplication if specified.
context?.queryDeduplication ??
this.queryDeduplication,
): Observable<FetchResult<T>> {
let observable: Observable<FetchResult<T>>;

// 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;
Expand Down

0 comments on commit 9b0271f

Please sign in to comment.