Skip to content

Commit 68ad0fa

Browse files
committed
Update api report
1 parent 4ac2375 commit 68ad0fa

5 files changed

Lines changed: 205 additions & 40 deletions

File tree

.api-reports/api-report-cache.api.md

Lines changed: 48 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import type { AsStoreObject } from '@apollo/client/utilities';
99
import { canonicalStringify } from '@apollo/client/utilities';
1010
import type { DataValue } from '@apollo/client';
1111
import type { DeepPartial } from '@apollo/client/utilities';
12+
import type { DeferInfoTrie } from '@apollo/client/utilities/internal';
1213
import type { DocumentNode } from 'graphql';
1314
import type { DocumentNode as DocumentNode_2 } from '@apollo/client';
1415
import type { ExtensionsWithStreamInfo } from '@apollo/client/utilities/internal';
@@ -21,6 +22,7 @@ import { getApolloCacheMemoryInternals } from '@apollo/client/utilities/internal
2122
import type { GetDataState } from '@apollo/client';
2223
import { getInMemoryCacheMemoryInternals } from '@apollo/client/utilities/internal';
2324
import type { GraphQLScalarType } from 'graphql';
25+
import { handleIncrementalSymbol } from '@apollo/client/utilities/internal';
2426
import type { Incremental } from '@apollo/client/incremental';
2527
import type { InlineFragmentNode } from 'graphql';
2628
import type { IsAny } from '@apollo/client/utilities/internal';
@@ -35,6 +37,7 @@ import type { RemoveIndexSignature } from '@apollo/client/utilities/internal';
3537
import type { SelectionSetNode } from 'graphql';
3638
import type { StoreObject } from '@apollo/client/utilities';
3739
import type { StoreValue } from '@apollo/client/utilities';
40+
import type { StreamInfoTrie } from '@apollo/client/utilities/internal';
3841
import { Trie } from '@wry/trie';
3942
import type { TypedDocumentNode } from '@apollo/client';
4043
import type { TypeOverrides } from '@apollo/client';
@@ -226,6 +229,32 @@ namespace Cache_2 {
226229
cache: infer TCache;
227230
} ? TCache extends ApolloCache ? TCache : "The cache type declared in TypeOverrides does not extend `ApolloCache` and cannot be used with Apollo Client. See https://www.apollographql.com/docs/react/data/typescript#declaring-the-cache-type." : ApolloCache;
228231
// (undocumented)
232+
type InternalDiffResultWithDataState<TData> = {
233+
result: DataValue.Complete<TData>;
234+
complete: true;
235+
missing?: never;
236+
dataState: "complete";
237+
fromOptimisticTransaction?: boolean;
238+
} | {
239+
result: DataValue.Streaming<TData> | null;
240+
complete: false;
241+
missing?: never;
242+
dataState: "streaming";
243+
fromOptimisticTransaction?: boolean;
244+
} | {
245+
result: DataValue.Partial<TData> | null;
246+
complete: false;
247+
missing?: MissingFieldError;
248+
dataState: "partial";
249+
fromOptimisticTransaction?: boolean;
250+
} | {
251+
result: null;
252+
complete: false;
253+
missing?: MissingFieldError;
254+
dataState: "empty";
255+
fromOptimisticTransaction?: boolean;
256+
};
257+
// (undocumented)
229258
interface ModifyOptions<Entity extends Record<string, any> = Record<string, any>> {
230259
// (undocumented)
231260
broadcast?: boolean;
@@ -370,9 +399,18 @@ interface DeleteModifier {
370399
// @public (undocumented)
371400
const _deleteModifier: unique symbol;
372401

402+
// @internal @deprecated (undocumented)
403+
export interface DiffIncrementalInfo {
404+
// (undocumented)
405+
deferInfo?: DeferInfoTrie;
406+
// (undocumented)
407+
streamInfo?: StreamInfoTrie;
408+
}
409+
373410
// @public (undocumented)
374411
export type DiffQueryAgainstStoreOptions = ReadQueryOptions & {
375412
returnPartialData?: boolean;
413+
[handleIncrementalSymbol]?: true | DiffIncrementalInfo;
376414
};
377415

378416
// @public (undocumented)
@@ -592,6 +630,8 @@ export namespace InMemoryCache {
592630

593631
// @public (undocumented)
594632
export class InMemoryCache extends ApolloCache {
633+
// (undocumented)
634+
readonly [handleIncrementalSymbol] = true;
595635
constructor(...args: {} extends InMemoryCache.ScalarsOption ? [
596636
config?: InMemoryCacheConfig
597637
] : [config: InMemoryCacheConfig]);
@@ -605,7 +645,11 @@ export class InMemoryCache extends ApolloCache {
605645
// (undocumented)
606646
protected config: InMemoryCacheConfig;
607647
// (undocumented)
608-
diff<TData = unknown, TVariables extends OperationVariables = OperationVariables>(options: Cache_2.DiffOptions<TData, TVariables>): Cache_2.DiffResult<TData>;
648+
diff<TData = unknown, TVariables extends OperationVariables = OperationVariables>(query: Cache_2.DiffOptions<TData, TVariables> & {
649+
[handleIncrementalSymbol]: true | DiffIncrementalInfo;
650+
}): Cache_2.InternalDiffResultWithDataState<TData>;
651+
// (undocumented)
652+
diff<TData = unknown, TVariables extends OperationVariables = OperationVariables>(query: Cache_2.DiffOptions<TData, TVariables>): Cache_2.DiffResult<TData>;
609653
// (undocumented)
610654
evict(options: Cache_2.EvictOptions): boolean;
611655
// (undocumented)
@@ -1109,9 +1153,11 @@ interface WriteContext extends ReadMergeModifyContext {
11091153

11101154
// Warnings were encountered during analysis:
11111155
//
1156+
// src/cache/inmemory/inMemoryCache.ts:460:7 - (ae-incompatible-release-tags) The symbol "[handleIncrementalSymbol]" is marked as @public, but its signature references "DiffIncrementalInfo" which is marked as @internal
11121157
// src/cache/inmemory/policies.ts:176:3 - (ae-forgotten-export) The symbol "KeySpecifier" needs to be exported by the entry point index.d.ts
11131158
// src/cache/inmemory/policies.ts:179:3 - (ae-forgotten-export) The symbol "ScalarNames" needs to be exported by the entry point index.d.ts
1114-
// src/cache/inmemory/types.ts:139:3 - (ae-forgotten-export) The symbol "KeyFieldsFunction" needs to be exported by the entry point index.d.ts
1159+
// 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
1160+
// src/cache/inmemory/types.ts:149:3 - (ae-forgotten-export) The symbol "KeyFieldsFunction" needs to be exported by the entry point index.d.ts
11151161

11161162
// (No @packageDocumentation comment for this package)
11171163

.api-reports/api-report-incremental.api.md

Lines changed: 25 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,7 @@ class Defer20220824Handler implements Incremental.Handler<Defer20220824Handler.C
7474
// Warning: (ae-forgotten-export) The symbol "DeferRequest" needs to be exported by the entry point index.d.ts
7575
//
7676
// (undocumented)
77-
startRequest<TData extends Record<string, unknown>>(_: {
78-
query: DocumentNode;
79-
}): DeferRequest<TData>;
77+
startRequest<TData extends Record<string, unknown>>(_: Incremental.StartRequestOptions): DeferRequest<TData>;
8078
}
8179
export { Defer20220824Handler }
8280
export { Defer20220824Handler as GraphQL17Alpha2Handler }
@@ -180,9 +178,7 @@ export class GraphQL17Alpha9Handler implements Incremental.Handler<GraphQL17Alph
180178
// Warning: (ae-forgotten-export) The symbol "IncrementalRequest" needs to be exported by the entry point index.d.ts
181179
//
182180
// @internal @deprecated (undocumented)
183-
startRequest<TData>(_: {
184-
query: DocumentNode;
185-
}): IncrementalRequest<TData>;
181+
startRequest<TData>(_: Incremental.StartRequestOptions): IncrementalRequest<TData>;
186182
}
187183

188184
// @public (undocumented)
@@ -196,19 +192,35 @@ export namespace Incremental {
196192
// (undocumented)
197193
prepareRequest: (request: ApolloLink.Request) => ApolloLink.Request;
198194
// (undocumented)
199-
startRequest: <TData extends Record<string, unknown>>(request: {
200-
query: DocumentNode;
201-
}) => IncrementalRequest<Chunk, TData>;
195+
startRequest: <TData extends Record<string, unknown>>(request: Incremental.StartRequestOptions) => IncrementalRequest<Chunk, TData>;
202196
}
203197
// (undocumented)
204198
export interface IncrementalRequest<Chunk extends Record<string, unknown>, TData> {
199+
// (undocumented)
200+
getPendingType?: (id: string) => "defer" | "stream";
205201
// (undocumented)
206202
handle: (cacheData: TData | DeepPartial<TData> | undefined | null, chunk: Chunk) => FormattedExecutionResult<TData>;
207203
// (undocumented)
208204
hasNext: boolean;
205+
// (undocumented)
206+
pending?: Array<Incremental.PendingResult>;
209207
}
210208
// (undocumented)
211209
export type Path = ReadonlyArray<string | number>;
210+
// (undocumented)
211+
export interface PendingResult {
212+
// (undocumented)
213+
id: string;
214+
// (undocumented)
215+
label?: string;
216+
// (undocumented)
217+
path: Incremental.Path;
218+
}
219+
// @internal @deprecated (undocumented)
220+
export interface StartRequestOptions {
221+
// (undocumented)
222+
query: DocumentNode;
223+
}
212224
// @internal @deprecated (undocumented)
213225
export interface StreamFieldInfo {
214226
// (undocumented)
@@ -220,10 +232,14 @@ export namespace Incremental {
220232

221233
// @public (undocumented)
222234
class IncrementalRequest<TData> implements Incremental.IncrementalRequest<GraphQL17Alpha9Handler.Chunk<TData>, TData> {
235+
// (undocumented)
236+
getPendingType(id: string): "defer" | "stream";
223237
// (undocumented)
224238
handle(cacheData: TData | DeepPartial<TData> | null | undefined, chunk: GraphQL17Alpha9Handler.Chunk<TData>): FormattedExecutionResult<TData>;
225239
// (undocumented)
226240
hasNext: boolean;
241+
// (undocumented)
242+
get pending(): GraphQL17Alpha9Handler.PendingResult[];
227243
}
228244

229245
// @public (undocumented)

.api-reports/api-report-utilities.api.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,15 @@ export interface CacheSizes {
4040
"inMemoryCache.executeSelectionSet": number;
4141
"inMemoryCache.executeSubSelectedArray": number;
4242
"inMemoryCache.maybeBroadcastWatch": number;
43+
"inMemoryCache.prunePartialBoundaries": number;
44+
"inMemoryCache.prunePartialStreamArray": number;
4345
"PersistedQueryLink.persistedQueryHashes": number;
4446
"queryManager.getDocumentInfo": number;
4547
"removeTypenameFromVariables.getVariableDefinitions": number;
4648
canonicalStringify: number;
4749
checkDocument: number;
50+
isDeferredFragment: number;
51+
isStreamField: number;
4852
print: number;
4953
}
5054

.api-reports/api-report-utilities_internal.api.md

Lines changed: 36 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -86,21 +86,6 @@ export type ClassicSignature = SignatureStyle extends "classic" ? unknown : neve
8686
// @internal @deprecated
8787
export function cloneDeep<T>(value: T): T;
8888

89-
// @public (undocumented)
90-
interface CollectionContext {
91-
// (undocumented)
92-
exclude: SelectionNode;
93-
// Warning: (ae-incompatible-release-tags) The symbol "fragmentMap" is marked as @public, but its signature references "FragmentMap" which is marked as @internal
94-
//
95-
// (undocumented)
96-
fragmentMap: FragmentMap;
97-
}
98-
99-
// Warning: (ae-forgotten-export) The symbol "CollectionContext" needs to be exported by the entry point index.d.ts
100-
//
101-
// @internal @deprecated
102-
export function collectSiblingFields(selectionSet: SelectionSetNode, context: CollectionContext, visitedFragments?: Map<string, FieldMap>): FieldMap;
103-
10489
// @public
10590
export function combineLatestBatched<T>(observables: Array<Observable<T> & {
10691
dirty?: boolean;
@@ -182,6 +167,12 @@ type DeepOmitArray<T extends any[], K> = {
182167
// @public (undocumented)
183168
type DeepOmitPrimitive = Primitive | Function;
184169

170+
// @internal @deprecated
171+
export const deferInfoSymbol: unique symbol;
172+
173+
// @internal @deprecated
174+
export type DeferInfoTrie = Trie<true>;
175+
185176
// @public (undocumented)
186177
type Directives = {
187178
[directiveName: string]: {
@@ -237,11 +228,6 @@ export interface ExtensionsWithStreamInfo extends Record<string, unknown> {
237228
};
238229
}
239230

240-
// @public (undocumented)
241-
export type FieldMap = {
242-
[fieldName: string]: FieldMap | true;
243-
};
244-
245231
// @public (undocumented)
246232
export function filterMap<T, R>(fn: (value: T, context: undefined) => R | undefined): OperatorFunction<T, R>;
247233

@@ -288,6 +274,8 @@ export const getApolloClientMemoryInternals: (() => {
288274
executeSelectionSet: number | undefined;
289275
executeSubSelectedArray: number | undefined;
290276
maybeBroadcastWatch: number | undefined;
277+
prunePartialBoundaries: number | undefined;
278+
prunePartialStreamArray: number | undefined;
291279
} | undefined;
292280
fragmentRegistry?: {
293281
findFragmentSpreads: number | undefined;
@@ -335,6 +323,8 @@ export const getInMemoryCacheMemoryInternals: (() => {
335323
executeSelectionSet: number | undefined;
336324
executeSubSelectedArray: number | undefined;
337325
maybeBroadcastWatch: number | undefined;
326+
prunePartialBoundaries: number | undefined;
327+
prunePartialStreamArray: number | undefined;
338328
};
339329
fragmentRegistry: {
340330
findFragmentSpreads: number | undefined;
@@ -377,6 +367,9 @@ const globalCaches: {
377367
// @internal @deprecated (undocumented)
378368
export function graphQLResultHasError(result: FormattedExecutionResult<any>): boolean;
379369

370+
// @internal @deprecated
371+
export const handleIncrementalSymbol: unique symbol;
372+
380373
// @internal @deprecated (undocumented)
381374
export function hasDirectives(names: string[], root: ASTNode, all?: boolean): boolean;
382375

@@ -389,8 +382,8 @@ export type IsAny<T> = 0 extends 1 & T ? true : false;
389382
// @internal @deprecated
390383
export const isArray: (a: any) => a is any[] | readonly any[];
391384

392-
// @public (undocumented)
393-
export function isDeferredFragment(fragmentSelection: InlineFragmentNode | FragmentSpreadNode, variables: OperationVariables): boolean;
385+
// @internal @deprecated (undocumented)
386+
export const isDeferredFragment: (fragmentSelection: FragmentSpreadNode | InlineFragmentNode, variables: OperationVariables | undefined) => boolean;
394387

395388
// @internal @deprecated (undocumented)
396389
export function isDocumentNode(value: unknown): value is DocumentNode;
@@ -414,6 +407,9 @@ export function isNonNullObject(obj: unknown): obj is Record<string | number, an
414407
// @internal @deprecated (undocumented)
415408
export function isPlainObject(obj: unknown): obj is Record<string | number, any>;
416409

410+
// @internal @deprecated (undocumented)
411+
export const isStreamField: (field: FieldNode, variables: OperationVariables | undefined) => boolean;
412+
417413
// @public (undocumented)
418414
export function isTypenameField(field: FieldNode): boolean;
419415

@@ -425,6 +421,11 @@ export type LazyType<T> = T & {
425421
// @internal @deprecated (undocumented)
426422
export function makeReference(id: string): Reference;
427423

424+
// Warning: (ae-incompatible-release-tags) The symbol "makeStreamInfoTrie" is marked as @public, but its signature references "StreamInfoTrie" which is marked as @internal
425+
//
426+
// @public (undocumented)
427+
export function makeStreamInfoTrie(): StreamInfoTrie;
428+
428429
// @internal @deprecated
429430
export function makeUniqueId(prefix: string): string;
430431

@@ -538,12 +539,25 @@ export function storeKeyNameFromField(field: FieldNode, variables?: Object): str
538539
// @public (undocumented)
539540
let storeKeyNameStringify: (value: any) => string;
540541

542+
// @public (undocumented)
543+
export class StreamArrayState {
544+
constructor(path: Incremental.Path);
545+
// (undocumented)
546+
depend(): void;
547+
// (undocumented)
548+
get streamPosition(): number;
549+
set streamPosition(value: number);
550+
// (undocumented)
551+
truncate: boolean;
552+
}
553+
541554
// @public
542555
export const streamInfoSymbol: unique symbol;
543556

544557
// @internal @deprecated (undocumented)
545558
export type StreamInfoTrie = Trie<{
546559
current: Incremental.StreamFieldInfo;
560+
state: StreamArrayState;
547561
previous?: {
548562
incoming: unknown;
549563
streamFieldInfo: Incremental.StreamFieldInfo;

0 commit comments

Comments
 (0)