Skip to content

Commit

Permalink
Ensure getResultsFromLink writes results using original options.
Browse files Browse the repository at this point in the history
  • Loading branch information
benjamn committed May 13, 2022
1 parent 44df04d commit b4ffcb6
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/core/QueryManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import {
makeUniqueId,
isDocumentNode,
isNonNullObject,
cloneDeep,
} from '../utilities';
import { ApolloError, isApolloError } from '../errors';
import {
Expand Down Expand Up @@ -1034,6 +1035,10 @@ export class QueryManager<TStore> {
): Observable<ApolloQueryResult<TData>> {
const requestId = queryInfo.lastRequestId = this.generateRequestId();

// Make sure we write the result below using the same options we were given,
// even though the input object may have been modified in the meantime.
options = cloneDeep(options);

return asyncMap(
this.getObservableFromLink(
queryInfo.document!,
Expand Down

0 comments on commit b4ffcb6

Please sign in to comment.