Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 9 additions & 8 deletions .api-reports/api-report-cache.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import { getApolloCacheMemoryInternals } from '@apollo/client/utilities/internal
import type { GetDataState } from '@apollo/client';
import { getInMemoryCacheMemoryInternals } from '@apollo/client/utilities/internal';
import type { GraphQLScalarType } from 'graphql';
import { handleIncrementalSymbol } from '@apollo/client/utilities/internal';
import type { handleIncrementalSymbol } from '@apollo/client/utilities/internal';
import type { Incremental } from '@apollo/client/incremental';
import type { InlineFragmentNode } from 'graphql';
import type { IsAny } from '@apollo/client/utilities/internal';
Expand Down Expand Up @@ -95,6 +95,10 @@ export abstract class ApolloCache {
// (undocumented)
readonly assumeImmutableResults: boolean;
batch<U>(options: Cache_2.BatchOptions<this, U>): U;
abstract diff<TData = unknown, TVariables extends OperationVariables = OperationVariables>(query: Cache_2.DiffOptions<TData, TVariables> & {
[handleIncrementalSymbol]: DiffIncrementalInfo | undefined;
}): Cache_2.InternalDiffResultWithDataState<TData> | Cache_2.DiffResult<TData>;
// (undocumented)
abstract diff<TData = unknown, TVariables extends OperationVariables = OperationVariables>(query: Cache_2.DiffOptions<TData, TVariables>): Cache_2.DiffResult<TData>;
// (undocumented)
abstract evict(options: Cache_2.EvictOptions): boolean;
Expand Down Expand Up @@ -410,7 +414,6 @@ export interface DiffIncrementalInfo {
// @public (undocumented)
export type DiffQueryAgainstStoreOptions = ReadQueryOptions & {
returnPartialData?: boolean;
[handleIncrementalSymbol]?: true | DiffIncrementalInfo;
};

// @public (undocumented)
Expand Down Expand Up @@ -630,8 +633,6 @@ export namespace InMemoryCache {

// @public (undocumented)
export class InMemoryCache extends ApolloCache {
// (undocumented)
readonly [handleIncrementalSymbol] = true;
constructor(...args: {} extends InMemoryCache.ScalarsOption ? [
config?: InMemoryCacheConfig
] : [config: InMemoryCacheConfig]);
Expand All @@ -646,7 +647,7 @@ export class InMemoryCache extends ApolloCache {
protected config: InMemoryCacheConfig;
// (undocumented)
diff<TData = unknown, TVariables extends OperationVariables = OperationVariables>(query: Cache_2.DiffOptions<TData, TVariables> & {
[handleIncrementalSymbol]: true | DiffIncrementalInfo;
[handleIncrementalSymbol]: DiffIncrementalInfo | undefined;
}): Cache_2.InternalDiffResultWithDataState<TData>;
// (undocumented)
diff<TData = unknown, TVariables extends OperationVariables = OperationVariables>(query: Cache_2.DiffOptions<TData, TVariables>): Cache_2.DiffResult<TData>;
Expand Down Expand Up @@ -1153,11 +1154,11 @@ interface WriteContext extends ReadMergeModifyContext {

// Warnings were encountered during analysis:
//
// src/cache/inmemory/inMemoryCache.ts:461:7 - (ae-incompatible-release-tags) The symbol "[handleIncrementalSymbol]" is marked as @public, but its signature references "DiffIncrementalInfo" which is marked as @internal
// src/cache/core/cache.ts:204:7 - (ae-incompatible-release-tags) The symbol "[handleIncrementalSymbol]" is marked as @public, but its signature references "DiffIncrementalInfo" which is marked as @internal
// src/cache/inmemory/inMemoryCache.ts:456:7 - (ae-incompatible-release-tags) The symbol "[handleIncrementalSymbol]" is marked as @public, but its signature references "DiffIncrementalInfo" which is marked as @internal
// src/cache/inmemory/policies.ts:176:3 - (ae-forgotten-export) The symbol "KeySpecifier" needs to be exported by the entry point index.d.ts
// src/cache/inmemory/policies.ts:179:3 - (ae-forgotten-export) The symbol "ScalarNames" needs to be exported by the entry point index.d.ts
// src/cache/inmemory/types.ts:145:3 - (ae-incompatible-release-tags) The symbol "[handleIncrementalSymbol]" is marked as @public, but its signature references "DiffIncrementalInfo" which is marked as @internal
// src/cache/inmemory/types.ts:149:3 - (ae-forgotten-export) The symbol "KeyFieldsFunction" needs to be exported by the entry point index.d.ts
// src/cache/inmemory/types.ts:147:3 - (ae-forgotten-export) The symbol "KeyFieldsFunction" needs to be exported by the entry point index.d.ts

// (No @packageDocumentation comment for this package)

Expand Down
17 changes: 9 additions & 8 deletions .api-reports/api-report.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,10 @@ export abstract class ApolloCache {
// (undocumented)
readonly assumeImmutableResults: boolean;
batch<U>(options: Cache_2.BatchOptions<this, U>): U;
abstract diff<TData = unknown, TVariables extends OperationVariables = OperationVariables>(query: Cache_2.DiffOptions<TData, TVariables> & {
[handleIncrementalSymbol]: DiffIncrementalInfo | undefined;
}): Cache_2.InternalDiffResultWithDataState<TData> | Cache_2.DiffResult<TData>;
// (undocumented)
abstract diff<TData = unknown, TVariables extends OperationVariables = OperationVariables>(query: Cache_2.DiffOptions<TData, TVariables>): Cache_2.DiffResult<TData>;
// (undocumented)
abstract evict(options: Cache_2.EvictOptions): boolean;
Expand Down Expand Up @@ -1158,7 +1162,6 @@ interface DiffIncrementalInfo {
// @public (undocumented)
export type DiffQueryAgainstStoreOptions = ReadQueryOptions & {
returnPartialData?: boolean;
[handleIncrementalSymbol]?: true | DiffIncrementalInfo;
};

export { disableExperimentalFragmentVariables }
Expand Down Expand Up @@ -1660,8 +1663,6 @@ export namespace InMemoryCache {

// @public (undocumented)
export class InMemoryCache extends ApolloCache {
// (undocumented)
readonly [handleIncrementalSymbol] = true;
constructor(...args: {} extends InMemoryCache.ScalarsOption ? [
config?: InMemoryCacheConfig
] : [config: InMemoryCacheConfig]);
Expand All @@ -1676,7 +1677,7 @@ export class InMemoryCache extends ApolloCache {
protected config: InMemoryCacheConfig;
// (undocumented)
diff<TData = unknown, TVariables extends OperationVariables = OperationVariables>(query: Cache_2.DiffOptions<TData, TVariables> & {
[handleIncrementalSymbol]: true | DiffIncrementalInfo;
[handleIncrementalSymbol]: DiffIncrementalInfo | undefined;
}): Cache_2.InternalDiffResultWithDataState<TData>;
// (undocumented)
diff<TData = unknown, TVariables extends OperationVariables = OperationVariables>(query: Cache_2.DiffOptions<TData, TVariables>): Cache_2.DiffResult<TData>;
Expand Down Expand Up @@ -3250,14 +3251,14 @@ interface WriteContext extends ReadMergeModifyContext {

// Warnings were encountered during analysis:
//
// src/cache/core/cache.ts:127:11 - (ae-forgotten-export) The symbol "MissingTree" needs to be exported by the entry point index.d.ts
// src/cache/core/cache.ts:129:11 - (ae-forgotten-export) The symbol "MissingTree" needs to be exported by the entry point index.d.ts
// src/cache/core/cache.ts:204:7 - (ae-forgotten-export) The symbol "DiffIncrementalInfo" needs to be exported by the entry point index.d.ts
// src/cache/inmemory/policies.ts:104:3 - (ae-forgotten-export) The symbol "FragmentMap" needs to be exported by the entry point index.d.ts
// src/cache/inmemory/policies.ts:176:3 - (ae-forgotten-export) The symbol "KeySpecifier" needs to be exported by the entry point index.d.ts
// src/cache/inmemory/policies.ts:176:3 - (ae-forgotten-export) The symbol "KeyArgsFunction" needs to be exported by the entry point index.d.ts
// src/cache/inmemory/policies.ts:179:3 - (ae-forgotten-export) The symbol "ScalarNames" needs to be exported by the entry point index.d.ts
// src/cache/inmemory/types.ts:145:3 - (ae-forgotten-export) The symbol "DiffIncrementalInfo" needs to be exported by the entry point index.d.ts
// src/cache/inmemory/types.ts:149:3 - (ae-forgotten-export) The symbol "KeyFieldsFunction" needs to be exported by the entry point index.d.ts
// src/cache/inmemory/types.ts:164:3 - (ae-forgotten-export) The symbol "FragmentRegistryAPI" needs to be exported by the entry point index.d.ts
// src/cache/inmemory/types.ts:147:3 - (ae-forgotten-export) The symbol "KeyFieldsFunction" needs to be exported by the entry point index.d.ts
// src/cache/inmemory/types.ts:162:3 - (ae-forgotten-export) The symbol "FragmentRegistryAPI" needs to be exported by the entry point index.d.ts
// src/core/ApolloClient.ts:201:5 - (ae-forgotten-export) The symbol "IgnoreModifier" needs to be exported by the entry point index.d.ts
// src/core/ApolloClient.ts:635:5 - (ae-forgotten-export) The symbol "NextFetchPolicyContext" needs to be exported by the entry point index.d.ts
// src/core/ObservableQuery.ts:375:5 - (ae-forgotten-export) The symbol "QueryManager" needs to be exported by the entry point index.d.ts
Expand Down
11 changes: 11 additions & 0 deletions src/cache/core/cache.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import type { Reference, StoreObject } from "@apollo/client/utilities";
import { cacheSizes, canonicalStringify } from "@apollo/client/utilities";
import { __DEV__ } from "@apollo/client/utilities/environment";
import type {
handleIncrementalSymbol,
IsAny,
NoInfer,
Prettify,
Expand All @@ -45,6 +46,7 @@ import {
import { invariant } from "@apollo/client/utilities/invariant";

import { defaultCacheSizes } from "../../utilities/caching/sizes.js";
import type { DiffIncrementalInfo } from "../inmemory/types.js";

import type { Scalar } from "./Scalar.js";
import type { Cache } from "./types/Cache.js";
Expand Down Expand Up @@ -194,6 +196,15 @@ export abstract class ApolloCache {
* returned if it contains at least one field that can be fulfilled from the
* cache.
*/
public abstract diff<
TData = unknown,
TVariables extends OperationVariables = OperationVariables,
>(
query: Cache.DiffOptions<TData, TVariables> & {
[handleIncrementalSymbol]: DiffIncrementalInfo | undefined;
}
): Cache.InternalDiffResultWithDataState<TData> | Cache.DiffResult<TData>;

public abstract diff<
TData = unknown,
TVariables extends OperationVariables = OperationVariables,
Expand Down
Loading
Loading