Skip to content

Commit

Permalink
Return null in tests with mock cache
Browse files Browse the repository at this point in the history
  • Loading branch information
jerelmiller committed Jan 24, 2025
1 parent 776ba03 commit 659d610
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/__tests__/dataMasking.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import {
import { ObservableStream, spyOnConsole } from "../testing/internal";
import { invariant } from "../utilities/globals";
import { createFragmentRegistry } from "../cache/inmemory/fragmentRegistry";
import { DeepPartial, isSubscriptionOperation } from "../utilities";
import { isSubscriptionOperation } from "../utilities";
import { MaskedDocumentNode } from "../masking";

const NO_CACHE_WARNING =
Expand Down Expand Up @@ -5838,7 +5838,7 @@ describe("client.mutate", () => {

class TestCache extends ApolloCache<unknown> {
public diff<T>(query: Cache.DiffOptions): DataProxy.DiffResult<T> {
return { result: {} as DeepPartial<T>, complete: false };
return { result: null, complete: false };
}

public evict(): boolean {
Expand Down
3 changes: 1 addition & 2 deletions src/cache/core/__tests__/cache.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,14 @@ import { ApolloCache } from "../cache";
import { Cache, DataProxy } from "../..";
import { Reference } from "../../../utilities/graphql/storeUtils";
import { expectTypeOf } from "expect-type";
import { DeepPartial } from "../../../utilities";

class TestCache extends ApolloCache<unknown> {
constructor() {
super();
}

public diff<T>(query: Cache.DiffOptions): DataProxy.DiffResult<T> {
return { result: {} as DeepPartial<T>, complete: false };
return { result: null, complete: false };
}

public evict(): boolean {
Expand Down

0 comments on commit 659d610

Please sign in to comment.