diff --git a/src/__tests__/client.ts b/src/__tests__/client.ts index c810a705fad..a0f822d3e1b 100644 --- a/src/__tests__/client.ts +++ b/src/__tests__/client.ts @@ -3319,7 +3319,6 @@ describe('@connection', () => { // again to perform an additional transition. this.nextFetchPolicy = fetchPolicy => { ++nextFetchPolicyCallCount; - expect(fetchPolicy).toBe("cache-and-network"); return "cache-first"; }; return "cache-and-network"; @@ -3372,9 +3371,8 @@ describe('@connection', () => { client.cache.evict({ fieldName: "count" }); } else if (handleCount === 6) { expect(result.data).toEqual({ count: 2 }); - expect(nextFetchPolicyCallCount).toBe(3); + expect(nextFetchPolicyCallCount).toBe(4); expect(obs.options.fetchPolicy).toBe("cache-first"); - expect(obs.options.nextFetchPolicy).toBeUndefined(); setTimeout(resolve, 50); } else { reject("too many results"); diff --git a/src/core/ObservableQuery.ts b/src/core/ObservableQuery.ts index a0825f65888..25bb97179e5 100644 --- a/src/core/ObservableQuery.ts +++ b/src/core/ObservableQuery.ts @@ -732,11 +732,6 @@ export function applyNextFetchPolicy( } = options; if (nextFetchPolicy) { - // The options.nextFetchPolicy transition should happen only once, but it - // should also be possible (though uncommon) for a nextFetchPolicy function - // to set options.nextFetchPolicy to perform an additional transition. - options.nextFetchPolicy = void 0; - // When someone chooses "cache-and-network" or "network-only" as their // initial FetchPolicy, they often do not want future cache updates to // trigger unconditional network requests, which is what repeatedly