Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
136 commits
Select commit Hold shift + click to select a range
ae66ac9
Add failing tests for useFragment with lists
jerelmiller Oct 13, 2025
9f2e982
Add initial pass implementation for useFragment with list
jerelmiller Oct 13, 2025
1d52bea
Update type test
jerelmiller Oct 13, 2025
ce739a5
Remove unneeded null return
jerelmiller Oct 13, 2025
e5f722b
Fix incorrect assertions
jerelmiller Oct 13, 2025
314c248
Ensure array changes identities to rerender updated data
jerelmiller Oct 13, 2025
93d3876
Add overloads for client/cache.watchFragment
jerelmiller Oct 13, 2025
a29e004
Handle masking
jerelmiller Oct 13, 2025
87c09f0
Add failing list tests for watchFragment
jerelmiller Oct 13, 2025
607d149
Add first implementation in core
jerelmiller Oct 13, 2025
4906e6a
Don't allow for reobserve
jerelmiller Oct 13, 2025
c73fb8f
Fix incorrect application of data masking in client.watchFragment
jerelmiller Oct 13, 2025
456c372
Warn on invalid id sooner
jerelmiller Oct 13, 2025
e9bb759
Allow `from` as `null` internally in client.watchFragment
jerelmiller Oct 13, 2025
6b3d53d
Switch to client.watchFragment with from array in useFragment
jerelmiller Oct 13, 2025
bb76dbe
Add tests for getCurrentResult
jerelmiller Oct 14, 2025
e5ef39e
Add getCurrentResult to watchFragment result
jerelmiller Oct 14, 2025
7b6701e
Update test
jerelmiller Oct 14, 2025
326c76a
Move comment down
jerelmiller Oct 14, 2025
39a5300
Use observable.getCurrentResult in useFragment
jerelmiller Oct 14, 2025
57a26f0
Emit stable value to maintain referential equality
jerelmiller Oct 14, 2025
28ab461
Move observable to useMemo
jerelmiller Oct 14, 2025
290c497
Combine useDeepMemos
jerelmiller Oct 14, 2025
6472131
Rename lastResult to currentResult
jerelmiller Oct 14, 2025
ffbecf4
Cast to any for now
jerelmiller Oct 14, 2025
8406991
Add tests for lists with data masking
jerelmiller Oct 14, 2025
c2f5eef
Add getCurrentResult tests for data masking
jerelmiller Oct 14, 2025
9f65334
Add test to check unmask with getCurrentResult
jerelmiller Oct 14, 2025
b5262c1
Handle mask migrate mode with getCurrentResult
jerelmiller Oct 14, 2025
57bc5dd
Inline object assign
jerelmiller Oct 14, 2025
0943c50
Add failing tests for reobserve
jerelmiller Oct 14, 2025
07a54c4
Add stubs and types for reobserve
jerelmiller Oct 14, 2025
ec33b34
Throw when changing `from` to array/non-array
jerelmiller Oct 14, 2025
78ee493
Remove unneeded NoInfer
jerelmiller Oct 14, 2025
8b0aca4
Move reobserve tests to own file
jerelmiller Oct 15, 2025
ff1c38c
Add failing test for reobserve with non-array item
jerelmiller Oct 15, 2025
6fcb461
Ensure getCurrentResult returns stable value
jerelmiller Oct 15, 2025
527227f
Add test to ensure watchFragment can be subscribed multiple times
jerelmiller Oct 15, 2025
23e2556
Assert on cache watch count as well
jerelmiller Oct 15, 2025
562be54
Use shareReplay
jerelmiller Oct 15, 2025
ab994cd
Track subscribed as boolean
jerelmiller Oct 15, 2025
8da2fc0
Check watch count instead
jerelmiller Oct 15, 2025
79f43ee
Add toHaveNumWatches matcher
jerelmiller Oct 15, 2025
0489443
Use new matcher
jerelmiller Oct 15, 2025
2c74083
Add failing test for reordering items
jerelmiller Oct 15, 2025
9515f74
Matcher grammar
jerelmiller Oct 15, 2025
597da6e
Show actual number of watches in message
jerelmiller Oct 15, 2025
02642de
Add colors
jerelmiller Oct 15, 2025
605a9b3
Add failing test for subscribing to same object more than once
jerelmiller Oct 15, 2025
67cbad6
Update assertion without batching for now
jerelmiller Oct 15, 2025
065fcbd
Switch to observables for watches
jerelmiller Oct 15, 2025
4c85f2a
Remove problematic code for now
jerelmiller Oct 15, 2025
a0b3167
Swap order
jerelmiller Oct 15, 2025
15eea8f
Update types and tests to expect data as array instead of result as a…
jerelmiller Oct 15, 2025
88c7288
Remove undefined from DeepPartial arrays
jerelmiller Oct 16, 2025
f998f7a
Emit value as data array
jerelmiller Oct 16, 2025
5861126
Ensure observable doesn't complete with empty array
jerelmiller Oct 16, 2025
1aba667
Handle state for getCurrentResult
jerelmiller Oct 16, 2025
079ebd6
Update test for checking warnings
jerelmiller Oct 16, 2025
7e87ff8
Fix some types and remove some unneeded code in getCurrentResult
jerelmiller Oct 16, 2025
970dfe8
Extract toResult
jerelmiller Oct 16, 2025
61bd145
Fix more types
jerelmiller Oct 16, 2025
b31aaaa
Ensure object identity remains the same
jerelmiller Oct 16, 2025
18adffa
Remove unneeded setting of current result
jerelmiller Oct 16, 2025
fbb4666
Make ids an observable
jerelmiller Oct 16, 2025
d358f5b
Fix assertion
jerelmiller Oct 16, 2025
ab57616
Handle changing ids with reobserve
jerelmiller Oct 16, 2025
c00dc97
Add check to ensure change to item in list is picked up
jerelmiller Oct 16, 2025
c21de59
Add waits when checking watch size
jerelmiller Oct 16, 2025
61a2841
Only unsubscribe from watches that are dropped between reobserve
jerelmiller Oct 16, 2025
8939849
Extract helper
jerelmiller Oct 16, 2025
39db861
Combine functions
jerelmiller Oct 16, 2025
ec071f9
Combine functions
jerelmiller Oct 16, 2025
18242b8
Allow null in from when its a list and change return to null
jerelmiller Oct 16, 2025
33fda9e
Fix comment
jerelmiller Oct 16, 2025
9860500
Fix type issue
jerelmiller Oct 16, 2025
c0a9bda
Add test to getCurrentResult to make sure it works with subscription …
jerelmiller Oct 16, 2025
4f9f9f8
Use reobserve in useFragment
jerelmiller Oct 16, 2025
52d4afa
Better handle changing options
jerelmiller Oct 16, 2025
d5267f8
Update changing options test with better assertions
jerelmiller Oct 16, 2025
79f037b
Add back test for change of from value
jerelmiller Oct 16, 2025
bc4c828
Allow null in reobserve
jerelmiller Oct 16, 2025
066ca7d
Fix missing type on partial result
jerelmiller Oct 16, 2025
a5cdb4f
Add reobserve test with null
jerelmiller Oct 16, 2025
400fcd7
Update useSuspenseFragment to handle timing of watch cleanup
jerelmiller Oct 16, 2025
a2b3635
Remove unneeded wrap
jerelmiller Oct 16, 2025
5aeaa4a
Add more assertions in test case
jerelmiller Oct 16, 2025
6a52f47
Remove comment on null
jerelmiller Oct 17, 2025
c73afb5
Rename variables
jerelmiller Oct 17, 2025
fae8a7d
Set currentResult in toResult
jerelmiller Oct 17, 2025
edf7bf2
Add combineLatestBatched
jerelmiller Oct 17, 2025
1309593
Batch updates to same object together
jerelmiller Oct 17, 2025
8387f27
Update comment
jerelmiller Oct 17, 2025
294adeb
Adjust comments
jerelmiller Oct 17, 2025
79a9d29
Cleanup a test
jerelmiller Oct 17, 2025
03cd866
Set result to complete if from contains null
jerelmiller Oct 17, 2025
86e7691
Fix type error
jerelmiller Oct 17, 2025
f308103
Update types for useSuspenseFragment
jerelmiller Oct 17, 2025
821211b
Use more overloads for useFragment
jerelmiller Oct 17, 2025
c1c70f6
Add more overloads instead of generics
jerelmiller Oct 17, 2025
04132ac
Add new helper for rendering
jerelmiller Oct 17, 2025
2681b75
Deprecate old helper
jerelmiller Oct 17, 2025
a13ab66
Add failing tests for useSuspenseFragment with lists
jerelmiller Oct 17, 2025
181e904
Add missing dep
jerelmiller Oct 17, 2025
7b289a8
Fix typo
jerelmiller Oct 18, 2025
60dd2ba
Handle from array in suspense cache
jerelmiller Oct 18, 2025
81e03a0
Handle lists for useSuspenseFragment
jerelmiller Oct 18, 2025
d920d65
Update API report
jerelmiller Oct 18, 2025
ac156b2
Expect stable array in cache key
jerelmiller Oct 18, 2025
ea23351
Use reobserve for more efficient change of id
jerelmiller Oct 18, 2025
3d5f40a
Adjust comment
jerelmiller Oct 18, 2025
e1cacb1
Update size limits
jerelmiller Oct 18, 2025
46a7965
Rename type
jerelmiller Oct 18, 2025
6714fa7
Fix incorrect type in cache.watchFragment
jerelmiller Oct 18, 2025
91e4eb3
Ignore useSuspenseFragment nested tests for React 17
jerelmiller Oct 18, 2025
b6fc41d
Update exports snapshot
jerelmiller Oct 18, 2025
a5969a5
Rename WatchFragmentObservable to ObservableFragment
jerelmiller Oct 20, 2025
4f3069b
Prevent memory leak when unsubscribing from watch
jerelmiller Oct 20, 2025
a77d2f2
Add another test to useSuspenseFragment
jerelmiller Oct 20, 2025
f66e681
TODO changeset
jerelmiller Oct 20, 2025
27029ee
Changesets
jerelmiller Oct 20, 2025
4ccc6aa
Tweak comment
jerelmiller Oct 20, 2025
6250da6
Simplify types
jerelmiller Oct 20, 2025
34d0269
Rename ApolloClient.WatchFragmentObservable to ObservableFragment
jerelmiller Oct 21, 2025
d4072da
Rerun api report
jerelmiller Oct 21, 2025
aa5edba
Change note to a tip
jerelmiller Oct 21, 2025
b0ad8c0
Fix typo
jerelmiller Oct 21, 2025
de61508
Add section for array with useFragment to docs
jerelmiller Oct 21, 2025
1d0e27c
Fix typo
jerelmiller Oct 21, 2025
30418b3
Remove the observable from watches on unsubscribe
jerelmiller Oct 22, 2025
14aff28
More comments
jerelmiller Oct 22, 2025
82e1a21
Add test to ensure transitions work correctly
jerelmiller Oct 22, 2025
cd1f626
Update test to fail with too many watchers
jerelmiller Oct 22, 2025
d73c809
Add comment
jerelmiller Oct 22, 2025
e57bbc2
Print watch ids
jerelmiller Oct 22, 2025
da3e9c2
Fix typo
jerelmiller Oct 22, 2025
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
37 changes: 32 additions & 5 deletions .api-reports/api-report-cache.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,20 +39,34 @@ type AllFieldsModifier<Entity extends Record<string, any>> = Modifier<Entity[key

// @public (undocumented)
export namespace ApolloCache {
// (undocumented)
export interface ObservableFragment<TData = unknown> extends Observable<ApolloCache.WatchFragmentResult<TData>> {
getCurrentResult: () => ApolloCache.WatchFragmentResult<TData>;
reobserve: (options: ApolloCache.WatchFragmentReobserveOptions<TData>) => void;
}
// (undocumented)
export type WatchFragmentFromValue<TData> = StoreObject | Reference | FragmentType<NoInfer_2<TData>> | string;
export interface WatchFragmentOptions<TData = unknown, TVariables extends OperationVariables = OperationVariables> {
fragment: DocumentNode | TypedDocumentNode<TData, TVariables>;
fragmentName?: string;
from: StoreObject | Reference | FragmentType<NoInfer_2<TData>> | string;
from: ApolloCache.WatchFragmentFromValue<TData> | Array<ApolloCache.WatchFragmentFromValue<TData> | null>;
optimistic?: boolean;
variables?: TVariables;
}
// (undocumented)
export interface WatchFragmentReobserveOptions<TData = unknown> {
// (undocumented)
from: TData extends Array<any> ? Array<StoreObject | Reference | FragmentType<TData> | string | null> : StoreObject | Reference | FragmentType<TData> | string;
}
export type WatchFragmentResult<TData = unknown> = ({
complete: true;
missing?: never;
} & GetDataState<TData, "complete">) | ({
} & GetDataState<TData, "complete">) | {
complete: false;
missing: MissingTree;
} & GetDataState<TData, "partial">);
missing?: MissingTree;
data: TData extends Array<infer TItem> ? Array<DataValue.Partial<TItem | null>> : DataValue.Partial<TData>;
dataState: "partial";
};
}

// @public (undocumented)
Expand Down Expand Up @@ -106,7 +120,20 @@ export abstract class ApolloCache {
updateQuery<TData = unknown, TVariables extends OperationVariables = OperationVariables>(options: Cache_2.UpdateQueryOptions<TData, TVariables>, update: (data: Unmasked<TData> | null) => Unmasked<TData> | null | void): Unmasked<TData> | null;
// (undocumented)
abstract watch<TData = unknown, TVariables extends OperationVariables = OperationVariables>(watch: Cache_2.WatchOptions<TData, TVariables>): () => void;
watchFragment<TData = unknown, TVariables extends OperationVariables = OperationVariables>(options: ApolloCache.WatchFragmentOptions<TData, TVariables>): Observable<ApolloCache.WatchFragmentResult<Unmasked<TData>>>;
// (undocumented)
watchFragment<TData = unknown, TVariables extends OperationVariables = OperationVariables>(options: ApolloCache.WatchFragmentOptions<TData, TVariables> & {
from: Array<ApolloCache.WatchFragmentFromValue<TData>>;
}): ApolloCache.ObservableFragment<Array<Unmasked<TData>>>;
// (undocumented)
watchFragment<TData = unknown, TVariables extends OperationVariables = OperationVariables>(options: ApolloCache.WatchFragmentOptions<TData, TVariables> & {
from: Array<null>;
}): ApolloCache.ObservableFragment<Array<null>>;
// (undocumented)
watchFragment<TData = unknown, TVariables extends OperationVariables = OperationVariables>(options: ApolloCache.WatchFragmentOptions<TData, TVariables> & {
from: Array<ApolloCache.WatchFragmentFromValue<TData> | null>;
}): ApolloCache.ObservableFragment<Array<Unmasked<TData> | null>>;
// (undocumented)
watchFragment<TData = unknown, TVariables extends OperationVariables = OperationVariables>(options: ApolloCache.WatchFragmentOptions<TData, TVariables>): ApolloCache.ObservableFragment<Unmasked<TData>>;
// (undocumented)
abstract write<TData = unknown, TVariables extends OperationVariables = OperationVariables>(write: Cache_2.WriteOptions<TData, TVariables>): Reference | undefined;
writeFragment<TData = unknown, TVariables extends OperationVariables = OperationVariables>({ data, fragment, fragmentName, variables, overwrite, id, broadcast, }: Cache_2.WriteFragmentOptions<TData, TVariables>): Reference | undefined;
Expand Down
21 changes: 18 additions & 3 deletions .api-reports/api-report-core.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,11 @@ export namespace ApolloClient {
extensions?: Record<string, unknown>;
}
// (undocumented)
export interface ObservableFragment<TData = unknown> extends Observable_2<ApolloClient.WatchFragmentResult<TData>> {
getCurrentResult: () => ApolloClient.WatchFragmentResult<TData>;
reobserve: (options: ApolloCache.WatchFragmentReobserveOptions<TData>) => void;
}
// (undocumented)
export interface Options {
assumeImmutableResults?: boolean;
cache: ApolloCache;
Expand Down Expand Up @@ -295,7 +300,7 @@ export namespace ApolloClient {
// (undocumented)
export type WatchFragmentOptions<TData = unknown, TVariables extends OperationVariables = OperationVariables> = ApolloCache.WatchFragmentOptions<TData, TVariables>;
// (undocumented)
export type WatchFragmentResult<TData = unknown> = ApolloCache.WatchFragmentResult<TData>;
export type WatchFragmentResult<TData = unknown> = ApolloCache.WatchFragmentResult<MaybeMasked<TData>>;
export type WatchQueryOptions<TData = unknown, TVariables extends OperationVariables = OperationVariables> = {
fetchPolicy?: WatchQueryFetchPolicy;
nextFetchPolicy?: WatchQueryFetchPolicy | ((this: WatchQueryOptions<TData, TVariables>, currentFetchPolicy: WatchQueryFetchPolicy, context: NextFetchPolicyContext<TData, TVariables>) => WatchQueryFetchPolicy);
Expand Down Expand Up @@ -367,7 +372,17 @@ export class ApolloClient {
subscribe<TData = unknown, TVariables extends OperationVariables = OperationVariables>(options: ApolloClient.SubscribeOptions<TData, TVariables>): SubscriptionObservable<ApolloClient.SubscribeResult<MaybeMasked<TData>>>;
// (undocumented)
version: string;
watchFragment<TData = unknown, TVariables extends OperationVariables = OperationVariables>(options: ApolloClient.WatchFragmentOptions<TData, TVariables>): Observable_2<ApolloClient.WatchFragmentResult<MaybeMasked<TData>>>;
watchFragment<TData = unknown, TVariables extends OperationVariables = OperationVariables>(options: ApolloClient.WatchFragmentOptions<TData, TVariables> & {
from: Array<ApolloCache.WatchFragmentFromValue<TData>>;
}): ApolloClient.ObservableFragment<Array<TData>>;
watchFragment<TData = unknown, TVariables extends OperationVariables = OperationVariables>(options: ApolloClient.WatchFragmentOptions<TData, TVariables> & {
from: Array<null>;
}): ApolloClient.ObservableFragment<Array<null>>;
// (undocumented)
watchFragment<TData = unknown, TVariables extends OperationVariables = OperationVariables>(options: ApolloClient.WatchFragmentOptions<TData, TVariables> & {
from: Array<ApolloCache.WatchFragmentFromValue<TData> | null>;
}): ApolloClient.ObservableFragment<Array<TData | null>>;
watchFragment<TData = unknown, TVariables extends OperationVariables = OperationVariables>(options: ApolloClient.WatchFragmentOptions<TData, TVariables>): ApolloClient.ObservableFragment<TData>;
watchQuery<TData = unknown, TVariables extends OperationVariables = OperationVariables>(options: ApolloClient.WatchQueryOptions<TData, TVariables>): ObservableQuery<TData, TVariables>;
writeFragment<TData = unknown, TVariables extends OperationVariables = OperationVariables>(options: ApolloClient.WriteFragmentOptions<TData, TVariables>): Reference_2 | undefined;
writeQuery<TData = unknown, TVariables extends OperationVariables = OperationVariables>(options: ApolloClient.WriteQueryOptions<TData, TVariables>): Reference_2 | undefined;
Expand Down Expand Up @@ -1140,7 +1155,7 @@ export type WatchQueryOptions<TVariables extends OperationVariables = OperationV

// Warnings were encountered during analysis:
//
// src/core/ApolloClient.ts:362:5 - (ae-forgotten-export) The symbol "NextFetchPolicyContext" needs to be exported by the entry point index.d.ts
// src/core/ApolloClient.ts:385:5 - (ae-forgotten-export) The symbol "NextFetchPolicyContext" needs to be exported by the entry point index.d.ts
// src/core/ObservableQuery.ts:368:5 - (ae-forgotten-export) The symbol "QueryManager" needs to be exported by the entry point index.d.ts
// src/core/QueryManager.ts:180:5 - (ae-forgotten-export) The symbol "MutationStoreValue" needs to be exported by the entry point index.d.ts

Expand Down
62 changes: 54 additions & 8 deletions .api-reports/api-report-react.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,21 @@ export type BackgroundQueryHookOptions<TData = unknown, TVariables extends Opera
// @public
export function createQueryPreloader(client: ApolloClient): PreloadQueryFunction;

// Warning: (ae-forgotten-export) The symbol "FromPrimitive" needs to be exported by the entry point index.d.ts
//
// @public (undocumented)
type From<TData> = FromPrimitive<TData> | Array<FromPrimitive<TData>>;

// Warning: (ae-forgotten-export) The symbol "FromPrimitive_2" needs to be exported by the entry point index.d.ts
//
// @public (undocumented)
type From_2<TData> = FromPrimitive_2<TData> | Array<FromPrimitive_2<TData>>;

// @public (undocumented)
type From<TData> = StoreObject_2 | Reference_2 | FragmentType<NoInfer_2<TData>> | string | null;
type FromPrimitive<TData> = StoreObject | Reference | FragmentType<NoInfer_2<TData>> | string | null;

// @public (undocumented)
type FromPrimitive_2<TData> = StoreObject_2 | Reference_2 | FragmentType<NoInfer_2<TData>> | string | null;

// @public (undocumented)
export function getApolloContext(): ReactTypes.Context<ApolloContextValue>;
Expand Down Expand Up @@ -388,6 +401,21 @@ export namespace useBackgroundQuery {
// @public @deprecated (undocumented)
export type UseBackgroundQueryResult<TData = unknown, TVariables extends OperationVariables = OperationVariables> = useBackgroundQuery.Result<TData, TVariables>;

// @public
export function useFragment<TData = unknown, TVariables extends OperationVariables = OperationVariables>(options: useFragment.Options<TData, TVariables> & {
from: Array<NonNullable<From<TData>>>;
}): useFragment.Result<Array<TData>>;

// @public
export function useFragment<TData = unknown, TVariables extends OperationVariables = OperationVariables>(options: useFragment.Options<TData, TVariables> & {
from: Array<null>;
}): useFragment.Result<Array<null>>;

// @public
export function useFragment<TData = unknown, TVariables extends OperationVariables = OperationVariables>(options: useFragment.Options<TData, TVariables> & {
from: Array<From<TData>>;
}): useFragment.Result<Array<TData | null>>;

// @public
export function useFragment<TData = unknown, TVariables extends OperationVariables = OperationVariables>(options: useFragment.Options<TData, TVariables>): useFragment.Result<TData>;

Expand Down Expand Up @@ -426,18 +454,20 @@ export namespace useFragment {
client?: ApolloClient;
fragment: DocumentNode_2 | TypedDocumentNode_2<TData, TVariables>;
fragmentName?: string;
from: StoreObject | Reference | FragmentType<NoInfer_2<TData>> | string | null;
from: From<TData>;
optimistic?: boolean;
variables?: NoInfer_2<TVariables>;
}
// (undocumented)
export type Result<TData> = ({
complete: true;
missing?: never;
} & GetDataState<MaybeMasked_2<TData>, "complete">) | ({
} & GetDataState<MaybeMasked_2<TData>, "complete">) | {
complete: false;
missing?: MissingTree;
} & GetDataState<MaybeMasked_2<TData>, "partial">);
data: TData extends Array<infer TItem> ? Array<DataValue.Partial<TItem | null>> : DataValue.Partial<TData>;
dataState: "partial";
};
}

// @public @deprecated (undocumented)
Expand Down Expand Up @@ -912,9 +942,24 @@ export namespace useSubscription {
}
}

// @public
export function useSuspenseFragment<TData = unknown, TVariables extends OperationVariables = OperationVariables>(options: useSuspenseFragment.Options<TData, TVariables> & {
from: Array<NonNullable<FromPrimitive_2<TData>>>;
}): useSuspenseFragment.Result<Array<TData>>;

// @public
export function useSuspenseFragment<TData = unknown, TVariables extends OperationVariables = OperationVariables>(options: useSuspenseFragment.Options<TData, TVariables> & {
from: Array<null>;
}): useSuspenseFragment.Result<Array<null>>;

// @public
export function useSuspenseFragment<TData = unknown, TVariables extends OperationVariables = OperationVariables>(options: useSuspenseFragment.Options<TData, TVariables> & {
from: Array<FromPrimitive_2<TData>>;
}): useSuspenseFragment.Result<Array<TData | null>>;

// @public
export function useSuspenseFragment<TData, TVariables extends OperationVariables = OperationVariables>(options: useSuspenseFragment.Options<TData, TVariables> & {
from: NonNullable<From<TData>>;
from: NonNullable<From_2<TData>>;
}): useSuspenseFragment.Result<TData>;

// @public
Expand All @@ -924,7 +969,7 @@ export function useSuspenseFragment<TData, TVariables extends OperationVariables

// @public
export function useSuspenseFragment<TData, TVariables extends OperationVariables = OperationVariables>(options: useSuspenseFragment.Options<TData, TVariables> & {
from: From<TData>;
from: From_2<TData>;
}): useSuspenseFragment.Result<TData | null>;

// @public
Expand All @@ -939,7 +984,7 @@ export namespace useSuspenseFragment {
export type Options<TData, TVariables extends OperationVariables> = {
fragment: DocumentNode_2 | TypedDocumentNode_2<TData, TVariables>;
fragmentName?: string;
from: From<TData>;
from: From_2<TData>;
optimistic?: boolean;
client?: ApolloClient;
};
Expand Down Expand Up @@ -1090,7 +1135,8 @@ export type UseSuspenseQueryResult<TData = unknown, TVariables extends Operation

// Warnings were encountered during analysis:
//
// src/react/hooks/useSuspenseFragment.ts:111:5 - (ae-forgotten-export) The symbol "From" needs to be exported by the entry point index.d.ts
// src/react/hooks/useFragment.ts:148:5 - (ae-forgotten-export) The symbol "From" needs to be exported by the entry point index.d.ts
// src/react/hooks/useSuspenseFragment.ts:144:5 - (ae-forgotten-export) The symbol "From_2" needs to be exported by the entry point index.d.ts

// (No @packageDocumentation comment for this package)

Expand Down
12 changes: 7 additions & 5 deletions .api-reports/api-report-react_internal.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@

```ts

import type { ApolloCache } from '@apollo/client';
import type { ApolloClient } from '@apollo/client';
import type { DataState } from '@apollo/client';
import type { DecoratedPromise } from '@apollo/client/utilities/internal';
import type { DocumentNode } from 'graphql';
import type { InternalTypes } from '@apollo/client/react';
import type { MaybeMasked } from '@apollo/client/masking';
import type { MaybeMasked as MaybeMasked_2 } from '@apollo/client';
import type { Observable } from 'rxjs';
import type { ObservableQuery } from '@apollo/client';
import type { OperationVariables } from '@apollo/client';

Expand All @@ -35,7 +35,7 @@ export type FetchMoreFunction<TData, TVariables extends OperationVariables> = <T

// @public (undocumented)
type FragmentCacheKey = [
cacheId: string,
cacheId: string | Array<string | null>,
fragment: DocumentNode,
stringifiedVariables: string
];
Expand All @@ -50,7 +50,7 @@ export interface FragmentKey {
class FragmentReference<TData = unknown, TVariables extends OperationVariables = OperationVariables> {
// Warning: (ae-forgotten-export) The symbol "FragmentReferenceOptions" needs to be exported by the entry point index.d.ts
constructor(client: ApolloClient, watchFragmentOptions: ApolloClient.WatchFragmentOptions<TData, TVariables> & {
from: string;
from: string | Array<string | null>;
}, options: FragmentReferenceOptions);
// (undocumented)
readonly key: FragmentKey;
Expand All @@ -59,12 +59,14 @@ class FragmentReference<TData = unknown, TVariables extends OperationVariables =
// (undocumented)
listen(listener: Listener_2<MaybeMasked<TData>>): () => void;
// (undocumented)
readonly observable: Observable<ApolloClient.WatchFragmentResult<TData>>;
readonly observable: ApolloClient.ObservableFragment<TData>;
// Warning: (ae-forgotten-export) The symbol "FragmentRefPromise" needs to be exported by the entry point index.d.ts
//
// (undocumented)
promise: FragmentRefPromise<MaybeMasked<TData>>;
// (undocumented)
reobserve(options: ApolloCache.WatchFragmentReobserveOptions<any>): void;
// (undocumented)
retain(): () => void;
}

Expand Down Expand Up @@ -203,7 +205,7 @@ class SuspenseCache {
//
// (undocumented)
getFragmentRef<TData, TVariables extends OperationVariables>(cacheKey: FragmentCacheKey, client: ApolloClient, options: ApolloClient.WatchFragmentOptions<TData, TVariables> & {
from: string;
from: string | Array<string | null>;
}): FragmentReference<TData, TVariables>;
// (undocumented)
getQueryRef<TData = unknown, TStates extends DataState<TData>["dataState"] = DataState<TData>["dataState"]>(cacheKey: CacheKey, createObservable: () => ObservableQuery<TData>): InternalQueryReference<TData, TStates>;
Expand Down
2 changes: 1 addition & 1 deletion .api-reports/api-report-utilities.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ export function concatPagination<T = Reference_2>(keyArgs?: KeyArgs): FieldPolic
// Warning: (ae-forgotten-export) The symbol "DeepPartialObject" needs to be exported by the entry point index.d.ts
//
// @public
export type DeepPartial<T> = T extends DeepPartialPrimitive ? T : T extends Map<infer TKey, infer TValue> ? DeepPartialMap<TKey, TValue> : T extends ReadonlyMap<infer TKey, infer TValue> ? DeepPartialReadonlyMap<TKey, TValue> : T extends Set<infer TItem> ? DeepPartialSet<TItem> : T extends ReadonlySet<infer TItem> ? DeepPartialReadonlySet<TItem> : T extends (...args: any[]) => unknown ? T | undefined : T extends object ? T extends (ReadonlyArray<infer TItem>) ? TItem[] extends (T) ? readonly TItem[] extends T ? ReadonlyArray<DeepPartial<TItem | undefined>> : Array<DeepPartial<TItem | undefined>> : DeepPartialObject<T> : DeepPartialObject<T> : unknown;
export type DeepPartial<T> = T extends DeepPartialPrimitive ? T : T extends Map<infer TKey, infer TValue> ? DeepPartialMap<TKey, TValue> : T extends ReadonlyMap<infer TKey, infer TValue> ? DeepPartialReadonlyMap<TKey, TValue> : T extends Set<infer TItem> ? DeepPartialSet<TItem> : T extends ReadonlySet<infer TItem> ? DeepPartialReadonlySet<TItem> : T extends (...args: any[]) => unknown ? T | undefined : T extends object ? T extends (ReadonlyArray<infer TItem>) ? TItem[] extends (T) ? readonly TItem[] extends T ? ReadonlyArray<DeepPartial<TItem>> : Array<DeepPartial<TItem>> : DeepPartialObject<T> : DeepPartialObject<T> : unknown;

// @public (undocumented)
type DeepPartialMap<TKey, TValue> = {} & Map<DeepPartial<TKey>, DeepPartial<TValue>>;
Expand Down
5 changes: 4 additions & 1 deletion .api-reports/api-report-utilities_internal.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import type { HKT } from '@apollo/client/utilities';
import type { InlineFragmentNode } from 'graphql';
import type { MaybeMasked } from '@apollo/client';
import type { NetworkStatus } from '@apollo/client';
import type { Observable } from 'rxjs';
import { Observable } from 'rxjs';
import type { ObservableQuery } from '@apollo/client';
import type { Observer } from 'rxjs';
import type { OperationDefinitionNode } from 'graphql';
Expand Down Expand Up @@ -74,6 +74,9 @@ export const checkDocument: (doc: DocumentNode, expectedType?: OperationTypeNode
// @internal @deprecated
export function cloneDeep<T>(value: T): T;

// @public
export function combineLatestBatched<T>(observables: Array<Observable<T>>): Observable<T[]>;

// Warning: (ae-forgotten-export) The symbol "TupleToIntersection" needs to be exported by the entry point index.d.ts
//
// @internal @deprecated
Expand Down
Loading