Skip to content

Commit 5fd2e7c

Browse files
add dataState to useFragment, DataValue type to useSuspenseFragment (#12757)
* add `dataState` to `useFragment`, `DataValue` type to `useSuspenseFragment` * Update .changeset/slimy-meals-work.md Co-authored-by: Jerel Miller <[email protected]> * Update .changeset/slimy-pots-bow.md Co-authored-by: Jerel Miller <[email protected]> --------- Co-authored-by: Jerel Miller <[email protected]>
1 parent 5ce6a1d commit 5fd2e7c

File tree

7 files changed

+153
-104
lines changed

7 files changed

+153
-104
lines changed

.api-reports/api-report-react.api.md

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import type { Cache as Cache_2 } from '@apollo/client/cache';
1414
import type { ClientAwarenessLink } from '@apollo/client/link/client-awareness';
1515
import type { DataProxy } from '@apollo/client/cache';
1616
import type { DataState as DataState_2 } from '@apollo/client';
17+
import type { DataValue as DataValue_2 } from '@apollo/client';
1718
import type { DeepPartial } from '@apollo/client/utilities';
1819
import type { DefaultContext as DefaultContext_2 } from '@apollo/client';
1920
import type { DocumentNode } from 'graphql';
@@ -1179,15 +1180,13 @@ export namespace useFragment {
11791180
variables?: NoInfer_2<TVariables>;
11801181
}
11811182
// (undocumented)
1182-
export type Result<TData> = {
1183-
data: MaybeMasked<TData>;
1183+
export type Result<TData> = ({
11841184
complete: true;
11851185
missing?: never;
1186-
} | {
1187-
data: DeepPartial<MaybeMasked<TData>>;
1186+
} & GetDataState_2<MaybeMasked<TData>, "complete">) | ({
11881187
complete: false;
11891188
missing?: MissingTree;
1190-
};
1189+
} & GetDataState_2<MaybeMasked<TData>, "partial">);
11911190
}
11921191

11931192
// @public @deprecated (undocumented)
@@ -1539,7 +1538,7 @@ export namespace useSuspenseFragment {
15391538
} & VariablesOption<NoInfer_2<TVariables>>;
15401539
// (undocumented)
15411540
export type Result<TData> = {
1542-
data: MaybeMasked<TData>;
1541+
data: DataValue_2.Complete<MaybeMasked<TData>>;
15431542
};
15441543
}
15451544

@@ -1659,7 +1658,7 @@ type WatchQueryOptions_2<TVariables extends OperationVariables_2 = OperationVari
16591658
// src/core/watchQueryOptions.ts:277:3 - (ae-forgotten-export) The symbol "OnQueryUpdated" needs to be exported by the entry point index.d.ts
16601659
// src/core/watchQueryOptions.ts:286:3 - (ae-forgotten-export) The symbol "MutationFetchPolicy" needs to be exported by the entry point index.d.ts
16611660
// src/react/hooks/useLoadableQuery.ts:70:7 - (ae-forgotten-export) The symbol "ResetFunction" needs to be exported by the entry point index.d.ts
1662-
// src/react/hooks/useSuspenseFragment.ts:75:5 - (ae-forgotten-export) The symbol "From" needs to be exported by the entry point index.d.ts
1661+
// src/react/hooks/useSuspenseFragment.ts:76:5 - (ae-forgotten-export) The symbol "From" needs to be exported by the entry point index.d.ts
16631662

16641663
// (No @packageDocumentation comment for this package)
16651664

.changeset/slimy-meals-work.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@apollo/client": minor
3+
---
4+
5+
Add `dataState` and overridable `DataValue` types to `useFragment`

.changeset/slimy-pots-bow.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@apollo/client": minor
3+
---
4+
5+
Add overridable `DataValue` types to `useSuspenseFragment`

.size-limits.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
2-
"import { ApolloClient, InMemoryCache, HttpLink } from \"@apollo/client\" (CJS)": 43700,
3-
"import { ApolloClient, InMemoryCache, HttpLink } from \"@apollo/client\" (production) (CJS)": 38633,
4-
"import { ApolloClient, InMemoryCache, HttpLink } from \"@apollo/client\"": 33321,
5-
"import { ApolloClient, InMemoryCache, HttpLink } from \"@apollo/client\" (production)": 27628
2+
"import { ApolloClient, InMemoryCache, HttpLink } from \"@apollo/client\" (CJS)": 43696,
3+
"import { ApolloClient, InMemoryCache, HttpLink } from \"@apollo/client\" (production) (CJS)": 38670,
4+
"import { ApolloClient, InMemoryCache, HttpLink } from \"@apollo/client\"": 33351,
5+
"import { ApolloClient, InMemoryCache, HttpLink } from \"@apollo/client\" (production)": 27632
66
}

0 commit comments

Comments
 (0)