Skip to content

Commit 6d230fb

Browse files
committed
Try importing internal types directly
1 parent aa5fc71 commit 6d230fb

8 files changed

+16
-34
lines changed

src/react/hooks/useBackgroundQuery.ts

+3-6
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,7 @@ import type {
1414
WatchQueryOptions,
1515
} from "@apollo/client/core";
1616
import type { SubscribeToMoreFunction } from "@apollo/client/core";
17-
import type {
18-
CacheKey,
19-
FetchMoreFunction,
20-
QueryRef,
21-
RefetchFunction,
22-
} from "@apollo/client/react/internal";
17+
import type { CacheKey, QueryRef } from "@apollo/client/react/internal";
2318
import {
2419
getSuspenseCache,
2520
unwrapQueryRef,
@@ -28,6 +23,8 @@ import {
2823
} from "@apollo/client/react/internal";
2924
import type { DeepPartial, NoInfer } from "@apollo/client/utilities";
3025

26+
import type { FetchMoreFunction, RefetchFunction } from "../internal/types.js";
27+
3128
import type { SkipToken } from "./constants.js";
3229
import { wrapHook } from "./internal/index.js";
3330
import { useApolloClient } from "./useApolloClient.js";

src/react/hooks/useLazyQuery.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,12 @@ import type {
2121
WatchQueryOptions,
2222
} from "@apollo/client/core";
2323
import { NetworkStatus } from "@apollo/client/core";
24-
import type { VariablesOption } from "@apollo/client/react/internal";
2524
import type { NoInfer, OnlyRequiredProperties } from "@apollo/client/utilities";
2625
import { maybeDeepFreeze } from "@apollo/client/utilities";
2726
import { invariant } from "@apollo/client/utilities/invariant";
2827

2928
import type { NextFetchPolicyContext } from "../../core/watchQueryOptions.js";
29+
import type { VariablesOption } from "../internal/types.js";
3030

3131
import { useRenderGuard } from "./internal/index.js";
3232
import { useDeepMemo } from "./internal/useDeepMemo.js";

src/react/hooks/useLoadableQuery.ts

+3-6
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,7 @@ import type {
1717
SubscribeToMoreFunction,
1818
SubscribeToMoreOptions,
1919
} from "@apollo/client/core";
20-
import type {
21-
CacheKey,
22-
FetchMoreFunction,
23-
QueryRef,
24-
RefetchFunction,
25-
} from "@apollo/client/react/internal";
20+
import type { CacheKey, QueryRef } from "@apollo/client/react/internal";
2621
import {
2722
assertWrappedQueryRef,
2823
getSuspenseCache,
@@ -36,6 +31,8 @@ import type {
3631
} from "@apollo/client/utilities";
3732
import { invariant } from "@apollo/client/utilities/invariant";
3833

34+
import type { FetchMoreFunction, RefetchFunction } from "../internal/types.js";
35+
3936
import { __use, useRenderGuard } from "./internal/index.js";
4037
import { useApolloClient } from "./useApolloClient.js";
4138
import { useWatchQueryOptions } from "./useSuspenseQuery.js";

src/react/hooks/useQueryRefHandlers.ts

+3-5
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,7 @@ import type { SubscribeToMoreFunction } from "@apollo/client/core";
55
import type { FetchMoreQueryOptions } from "@apollo/client/core";
66
import type { ApolloClient } from "@apollo/client/core";
77
import type { ObservableQuery } from "@apollo/client/core";
8-
import type {
9-
FetchMoreFunction,
10-
QueryRef,
11-
RefetchFunction,
12-
} from "@apollo/client/react/internal";
8+
import type { QueryRef } from "@apollo/client/react/internal";
139
import {
1410
assertWrappedQueryRef,
1511
getWrappedPromise,
@@ -18,6 +14,8 @@ import {
1814
wrapQueryRef,
1915
} from "@apollo/client/react/internal";
2016

17+
import type { FetchMoreFunction, RefetchFunction } from "../internal/types.js";
18+
2119
import { wrapHook } from "./internal/index.js";
2220
import { useApolloClient } from "./useApolloClient.js";
2321

src/react/hooks/useSuspenseFragment.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ import type {
1010
TypedDocumentNode,
1111
} from "@apollo/client/core";
1212
import type { FragmentType, MaybeMasked } from "@apollo/client/masking";
13-
import type { VariablesOption } from "@apollo/client/react/internal";
1413
import { getSuspenseCache } from "@apollo/client/react/internal";
1514
import type { NoInfer } from "@apollo/client/utilities";
1615

1716
import type { FragmentKey } from "../internal/cache/types.js";
17+
import type { VariablesOption } from "../internal/types.js";
1818

1919
import { __use } from "./internal/__use.js";
2020
import { wrapHook } from "./internal/index.js";

src/react/hooks/useSuspenseQuery.ts

+3-6
Original file line numberDiff line numberDiff line change
@@ -17,18 +17,15 @@ import type {
1717
import type { SubscribeToMoreFunction } from "@apollo/client/core";
1818
import { NetworkStatus } from "@apollo/client/core";
1919
import type { MaybeMasked } from "@apollo/client/masking";
20-
import type {
21-
CacheKey,
22-
FetchMoreFunction,
23-
QueryKey,
24-
RefetchFunction,
25-
} from "@apollo/client/react/internal";
20+
import type { CacheKey, QueryKey } from "@apollo/client/react/internal";
2621
import { getSuspenseCache } from "@apollo/client/react/internal";
2722
import { DocumentType, verifyDocumentType } from "@apollo/client/react/parser";
2823
import type { DeepPartial, NoInfer } from "@apollo/client/utilities";
2924
import { __DEV__ } from "@apollo/client/utilities/environment";
3025
import { invariant } from "@apollo/client/utilities/invariant";
3126

27+
import type { FetchMoreFunction, RefetchFunction } from "../internal/types.js";
28+
3229
import type { SkipToken } from "./constants.js";
3330
import { skipToken } from "./constants.js";
3431
import { __use, useDeepMemo, wrapHook } from "./internal/index.js";

src/react/internal/index.ts

-5
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,3 @@ export {
1515
} from "./cache/QueryReference.js";
1616
export type { SuspenseCacheOptions } from "./cache/SuspenseCache.js";
1717
export type { HookWrappers } from "../hooks/internal/wrapHook.js";
18-
export type {
19-
FetchMoreFunction,
20-
RefetchFunction,
21-
VariablesOption,
22-
} from "./types.js";

src/react/query-preloader/createQueryPreloader.ts

+2-4
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,7 @@ import type {
99
WatchQueryFetchPolicy,
1010
WatchQueryOptions,
1111
} from "@apollo/client/core";
12-
import type {
13-
PreloadedQueryRef,
14-
VariablesOption,
15-
} from "@apollo/client/react/internal";
12+
import type { PreloadedQueryRef } from "@apollo/client/react/internal";
1613
import {
1714
InternalQueryReference,
1815
wrapQueryRef,
@@ -24,6 +21,7 @@ import type {
2421
} from "@apollo/client/utilities";
2522

2623
import { wrapHook } from "../hooks/internal/index.js";
24+
import type { VariablesOption } from "../internal/types.js";
2725

2826
export type PreloadQueryFetchPolicy = Extract<
2927
WatchQueryFetchPolicy,

0 commit comments

Comments
 (0)