@apollo/client 4.3.0-alpha.9 → 4.3.0-rc.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +170 -0
- package/__cjs/cache/core/Scalar.cjs.map +1 -1
- package/__cjs/cache/core/Scalar.d.cts +0 -1
- package/__cjs/cache/core/cache.cjs +3 -3
- package/__cjs/cache/core/cache.cjs.map +1 -1
- package/__cjs/cache/core/cache.d.cts +53 -8
- package/__cjs/cache/index.cjs.map +1 -1
- package/__cjs/cache/index.d.cts +1 -1
- package/__cjs/cache/inmemory/entityStore.cjs +25 -10
- package/__cjs/cache/inmemory/entityStore.cjs.map +1 -1
- package/__cjs/cache/inmemory/helpers.cjs +12 -0
- package/__cjs/cache/inmemory/helpers.cjs.map +1 -1
- package/__cjs/cache/inmemory/helpers.d.cts +2 -1
- package/__cjs/cache/inmemory/inMemoryCache.cjs +34 -22
- package/__cjs/cache/inmemory/inMemoryCache.cjs.map +1 -1
- package/__cjs/cache/inmemory/inMemoryCache.d.cts +4 -4
- package/__cjs/cache/inmemory/key-extractor.cjs +1 -1
- package/__cjs/cache/inmemory/policies.cjs +7 -8
- package/__cjs/cache/inmemory/policies.cjs.map +1 -1
- package/__cjs/cache/inmemory/policies.d.cts +3 -4
- package/__cjs/cache/inmemory/readFromStore.cjs +3 -3
- package/__cjs/cache/inmemory/types.d.cts +3 -1
- package/__cjs/cache/inmemory/writeToStore.cjs +4 -4
- package/__cjs/core/ApolloClient.cjs +14 -14
- package/__cjs/core/ObservableQuery.cjs +8 -8
- package/__cjs/core/QueryInfo.cjs +1 -1
- package/__cjs/core/QueryManager.cjs +12 -12
- package/__cjs/core/RefetchEventManager.cjs +3 -3
- package/__cjs/core/index.cjs.map +1 -1
- package/__cjs/core/index.d.cts +3 -2
- package/__cjs/core/types.d.cts +9 -4
- package/__cjs/incremental/handlers/graphql17Alpha9.cjs +1 -1
- package/__cjs/incremental/handlers/notImplemented.cjs +1 -1
- package/__cjs/invariantErrorCodes.cjs +131 -116
- package/__cjs/link/core/ApolloLink.cjs +3 -3
- package/__cjs/link/http/checkFetcher.cjs +1 -1
- package/__cjs/link/http/parseAndCheckHttpResponse.cjs +1 -1
- package/__cjs/link/persisted-queries/index.cjs +2 -2
- package/__cjs/link/ws/index.cjs +1 -1
- package/__cjs/local-state/LocalState.cjs +11 -11
- package/__cjs/local-state/LocalState.cjs.map +1 -1
- package/__cjs/local-state/LocalState.d.cts +1 -1
- package/__cjs/masking/maskDefinition.cjs +2 -2
- package/__cjs/masking/maskFragment.cjs +2 -2
- package/__cjs/masking/maskOperation.cjs +1 -1
- package/__cjs/masking/utils.cjs +3 -3
- package/__cjs/react/context/ApolloContext.cjs +1 -1
- package/__cjs/react/context/ApolloProvider.cjs +1 -1
- package/__cjs/react/hooks/internal/validateSuspenseHookOptions.cjs +2 -2
- package/__cjs/react/hooks/useApolloClient.cjs +1 -1
- package/__cjs/react/hooks/useBackgroundQuery.cjs.map +1 -1
- package/__cjs/react/hooks/useBackgroundQuery.d.cts +1 -1
- package/__cjs/react/hooks/useFragment.cjs.map +1 -1
- package/__cjs/react/hooks/useFragment.d.cts +0 -1
- package/__cjs/react/hooks/useLazyQuery.cjs +2 -2
- package/__cjs/react/hooks/useLazyQuery.cjs.map +1 -1
- package/__cjs/react/hooks/useLazyQuery.d.cts +1 -1
- package/__cjs/react/hooks/useLoadableQuery.cjs +2 -2
- package/__cjs/react/hooks/useMutation.cjs.map +1 -1
- package/__cjs/react/hooks/useMutation.d.cts +1 -1
- package/__cjs/react/hooks/useQuery.cjs.map +1 -1
- package/__cjs/react/hooks/useQuery.d.cts +1 -1
- package/__cjs/react/hooks/useSubscription.cjs +7 -3
- package/__cjs/react/hooks/useSubscription.cjs.map +1 -1
- package/__cjs/react/hooks/useSubscription.d.cts +7 -4
- package/__cjs/react/hooks/useSuspenseFragment.cjs.map +1 -1
- package/__cjs/react/hooks/useSuspenseFragment.d.cts +1 -1
- package/__cjs/react/hooks/useSuspenseQuery.cjs.map +1 -1
- package/__cjs/react/hooks/useSuspenseQuery.d.cts +1 -1
- package/__cjs/react/hooks/useSyncExternalStore.cjs +1 -1
- package/__cjs/react/internal/cache/QueryReference.cjs +1 -1
- package/__cjs/react/query-preloader/createQueryPreloader.cjs.map +1 -1
- package/__cjs/react/query-preloader/createQueryPreloader.d.cts +1 -1
- package/__cjs/react/ssr/prerenderStatic.cjs +2 -2
- package/__cjs/testing/core/mocking/mockLink.cjs +4 -4
- package/__cjs/utilities/graphql/DocumentTransform.cjs +1 -1
- package/__cjs/utilities/internal/coerceScalarFieldsToParsed.cjs +45 -12
- package/__cjs/utilities/internal/coerceScalarFieldsToParsed.cjs.map +1 -1
- package/__cjs/utilities/internal/getFragmentDefinition.cjs +3 -3
- package/__cjs/utilities/internal/getFragmentDefinition.cjs.map +1 -1
- package/__cjs/utilities/internal/getFragmentFromSelection.cjs +1 -1
- package/__cjs/utilities/internal/getFragmentQueryDocument.cjs +2 -2
- package/__cjs/utilities/internal/getMainDefinition.cjs +1 -1
- package/__cjs/utilities/internal/getQueryDefinition.cjs +1 -1
- package/__cjs/utilities/internal/index.cjs +6 -4
- package/__cjs/utilities/internal/index.cjs.map +1 -1
- package/__cjs/utilities/internal/index.d.cts +2 -2
- package/__cjs/utilities/internal/matchScalarList.cjs +12 -0
- package/__cjs/utilities/internal/matchScalarList.cjs.map +1 -0
- package/__cjs/utilities/internal/matchScalarList.d.cts +8 -0
- package/__cjs/utilities/internal/removeDirectivesFromDocument.cjs +1 -1
- package/__cjs/utilities/internal/shouldInclude.cjs +4 -4
- package/__cjs/utilities/internal/unwrapScalarType.cjs +12 -0
- package/__cjs/utilities/internal/unwrapScalarType.cjs.map +1 -0
- package/__cjs/utilities/internal/unwrapScalarType.d.cts +10 -0
- package/__cjs/utilities/internal/valueToObjectRepresentation.cjs +1 -1
- package/__cjs/version.cjs +1 -1
- package/__cjs/version.cjs.map +1 -1
- package/cache/core/Scalar.d.ts +0 -1
- package/cache/core/Scalar.js.map +1 -1
- package/cache/core/cache.d.ts +53 -8
- package/cache/core/cache.js +3 -3
- package/cache/core/cache.js.map +1 -1
- package/cache/index.d.ts +1 -1
- package/cache/index.js.map +1 -1
- package/cache/inmemory/entityStore.js +26 -11
- package/cache/inmemory/entityStore.js.map +1 -1
- package/cache/inmemory/helpers.d.ts +2 -1
- package/cache/inmemory/helpers.js +11 -0
- package/cache/inmemory/helpers.js.map +1 -1
- package/cache/inmemory/inMemoryCache.d.ts +4 -4
- package/cache/inmemory/inMemoryCache.js +36 -24
- package/cache/inmemory/inMemoryCache.js.map +1 -1
- package/cache/inmemory/key-extractor.js +1 -1
- package/cache/inmemory/policies.d.ts +3 -4
- package/cache/inmemory/policies.js +7 -8
- package/cache/inmemory/policies.js.map +1 -1
- package/cache/inmemory/readFromStore.js +3 -3
- package/cache/inmemory/types.d.ts +3 -1
- package/cache/inmemory/types.js.map +1 -1
- package/cache/inmemory/writeToStore.js +4 -4
- package/core/ApolloClient.js +14 -14
- package/core/ObservableQuery.js +8 -8
- package/core/QueryInfo.js +1 -1
- package/core/QueryManager.js +12 -12
- package/core/RefetchEventManager.js +3 -3
- package/core/index.d.ts +3 -2
- package/core/index.js.map +1 -1
- package/core/types.d.ts +9 -4
- package/core/types.js.map +1 -1
- package/incremental/handlers/graphql17Alpha9.js +1 -1
- package/incremental/handlers/notImplemented.js +1 -1
- package/invariantErrorCodes.js +131 -116
- package/link/core/ApolloLink.js +3 -3
- package/link/http/checkFetcher.js +1 -1
- package/link/http/parseAndCheckHttpResponse.js +1 -1
- package/link/persisted-queries/index.js +2 -2
- package/link/ws/index.js +1 -1
- package/local-state/LocalState.d.ts +1 -1
- package/local-state/LocalState.js +11 -11
- package/local-state/LocalState.js.map +1 -1
- package/masking/maskDefinition.js +2 -2
- package/masking/maskFragment.js +2 -2
- package/masking/maskOperation.js +1 -1
- package/masking/utils.js +3 -3
- package/package.json +1 -1
- package/react/context/ApolloContext.js +1 -1
- package/react/context/ApolloProvider.js +1 -1
- package/react/hooks/internal/validateSuspenseHookOptions.js +2 -2
- package/react/hooks/useApolloClient.js +1 -1
- package/react/hooks/useBackgroundQuery.d.ts +1 -1
- package/react/hooks/useBackgroundQuery.js.map +1 -1
- package/react/hooks/useFragment.d.ts +0 -1
- package/react/hooks/useFragment.js.map +1 -1
- package/react/hooks/useLazyQuery.d.ts +1 -1
- package/react/hooks/useLazyQuery.js +2 -2
- package/react/hooks/useLazyQuery.js.map +1 -1
- package/react/hooks/useLoadableQuery.js +2 -2
- package/react/hooks/useMutation.d.ts +1 -1
- package/react/hooks/useMutation.js.map +1 -1
- package/react/hooks/useQuery.d.ts +1 -1
- package/react/hooks/useQuery.js.map +1 -1
- package/react/hooks/useSubscription.d.ts +7 -4
- package/react/hooks/useSubscription.js +7 -3
- package/react/hooks/useSubscription.js.map +1 -1
- package/react/hooks/useSuspenseFragment.d.ts +1 -1
- package/react/hooks/useSuspenseFragment.js.map +1 -1
- package/react/hooks/useSuspenseQuery.d.ts +1 -1
- package/react/hooks/useSuspenseQuery.js.map +1 -1
- package/react/hooks/useSyncExternalStore.js +1 -1
- package/react/hooks-compiled/internal/validateSuspenseHookOptions.js +2 -2
- package/react/hooks-compiled/useApolloClient.js +1 -1
- package/react/hooks-compiled/useBackgroundQuery.d.ts +1 -1
- package/react/hooks-compiled/useBackgroundQuery.js.map +1 -1
- package/react/hooks-compiled/useFragment.d.ts +0 -1
- package/react/hooks-compiled/useFragment.js.map +1 -1
- package/react/hooks-compiled/useLazyQuery.d.ts +1 -1
- package/react/hooks-compiled/useLazyQuery.js +2 -2
- package/react/hooks-compiled/useLazyQuery.js.map +1 -1
- package/react/hooks-compiled/useLoadableQuery.js +2 -2
- package/react/hooks-compiled/useMutation.d.ts +1 -1
- package/react/hooks-compiled/useMutation.js.map +1 -1
- package/react/hooks-compiled/useQuery.d.ts +1 -1
- package/react/hooks-compiled/useQuery.js.map +1 -1
- package/react/hooks-compiled/useSubscription.d.ts +7 -4
- package/react/hooks-compiled/useSubscription.js +107 -93
- package/react/hooks-compiled/useSubscription.js.map +1 -1
- package/react/hooks-compiled/useSuspenseFragment.d.ts +1 -1
- package/react/hooks-compiled/useSuspenseFragment.js.map +1 -1
- package/react/hooks-compiled/useSuspenseQuery.d.ts +1 -1
- package/react/hooks-compiled/useSuspenseQuery.js.map +1 -1
- package/react/hooks-compiled/useSyncExternalStore.js +1 -1
- package/react/internal/cache/QueryReference.js +1 -1
- package/react/query-preloader/createQueryPreloader.d.ts +1 -1
- package/react/query-preloader/createQueryPreloader.js.map +1 -1
- package/react/ssr/prerenderStatic.js +2 -2
- package/testing/core/mocking/mockLink.js +4 -4
- package/utilities/graphql/DocumentTransform.js +1 -1
- package/utilities/internal/coerceScalarFieldsToParsed.js +40 -11
- package/utilities/internal/coerceScalarFieldsToParsed.js.map +1 -1
- package/utilities/internal/getFragmentDefinition.js +3 -3
- package/utilities/internal/getFragmentDefinition.js.map +1 -1
- package/utilities/internal/getFragmentFromSelection.js +1 -1
- package/utilities/internal/getFragmentQueryDocument.js +2 -2
- package/utilities/internal/getMainDefinition.js +1 -1
- package/utilities/internal/getQueryDefinition.js +1 -1
- package/utilities/internal/index.d.ts +2 -2
- package/utilities/internal/index.js +2 -1
- package/utilities/internal/index.js.map +1 -1
- package/utilities/internal/matchScalarList.d.ts +8 -0
- package/utilities/internal/matchScalarList.js +9 -0
- package/utilities/internal/matchScalarList.js.map +1 -0
- package/utilities/internal/removeDirectivesFromDocument.js +1 -1
- package/utilities/internal/shouldInclude.js +4 -4
- package/utilities/internal/unwrapScalarType.d.ts +10 -0
- package/utilities/internal/unwrapScalarType.js +9 -0
- package/utilities/internal/unwrapScalarType.js.map +1 -0
- package/utilities/internal/valueToObjectRepresentation.js +1 -1
- package/version.js +1 -1
- package/version.js.map +1 -1
- package/__cjs/utilities/internal/getUnwrappedType.cjs +0 -20
- package/__cjs/utilities/internal/getUnwrappedType.cjs.map +0 -1
- package/__cjs/utilities/internal/getUnwrappedType.d.cts +0 -8
- package/__cjs/utilities/internal/types/NoInfer.cjs +0 -3
- package/__cjs/utilities/internal/types/NoInfer.cjs.map +0 -1
- package/__cjs/utilities/internal/types/NoInfer.d.cts +0 -35
- package/utilities/internal/getUnwrappedType.d.ts +0 -8
- package/utilities/internal/getUnwrappedType.js +0 -17
- package/utilities/internal/getUnwrappedType.js.map +0 -1
- package/utilities/internal/types/NoInfer.d.ts +0 -35
- package/utilities/internal/types/NoInfer.js +0 -2
- package/utilities/internal/types/NoInfer.js.map +0 -1
package/__cjs/core/types.d.cts
CHANGED
|
@@ -2,19 +2,20 @@ import type { DocumentNode, FormattedExecutionResult } from "graphql";
|
|
|
2
2
|
import type { NextNotification, Observable, ObservableNotification } from "rxjs";
|
|
3
3
|
import type { Cache } from "@apollo/client/cache";
|
|
4
4
|
import type { ClientAwarenessLink } from "@apollo/client/link/client-awareness";
|
|
5
|
-
import type { Unmasked } from "@apollo/client/masking";
|
|
6
|
-
import type { DeepPartial, HKT } from "@apollo/client/utilities";
|
|
5
|
+
import type { FragmentType, Unmasked } from "@apollo/client/masking";
|
|
6
|
+
import type { DeepPartial, HKT, Reference, StoreObject } from "@apollo/client/utilities";
|
|
7
7
|
import type { ApplyHKTImplementationWithDefault, IsAny } from "@apollo/client/utilities/internal";
|
|
8
8
|
import type { ApolloClient } from "./ApolloClient.cjs";
|
|
9
9
|
import type { ObservableQuery } from "./ObservableQuery.cjs";
|
|
10
10
|
export type { TypedDocumentNode } from "@graphql-typed-document-node/core";
|
|
11
11
|
export interface TypeOverrides {
|
|
12
12
|
}
|
|
13
|
-
declare namespace OverridableTypes {
|
|
13
|
+
export declare namespace OverridableTypes {
|
|
14
14
|
interface Defaults {
|
|
15
15
|
Complete: Complete;
|
|
16
16
|
Streaming: Streaming;
|
|
17
17
|
Partial: Partial;
|
|
18
|
+
FromOptionValue: FromOptionValue;
|
|
18
19
|
}
|
|
19
20
|
interface Complete extends HKT {
|
|
20
21
|
arg1: unknown;
|
|
@@ -28,6 +29,10 @@ declare namespace OverridableTypes {
|
|
|
28
29
|
arg1: unknown;
|
|
29
30
|
return: DeepPartial<this["arg1"]>;
|
|
30
31
|
}
|
|
32
|
+
interface FromOptionValue extends HKT {
|
|
33
|
+
arg1: unknown;
|
|
34
|
+
return: StoreObject | Reference | FragmentType<NoInfer<this["arg1"]>> | string;
|
|
35
|
+
}
|
|
31
36
|
}
|
|
32
37
|
export declare namespace DataValue {
|
|
33
38
|
/**
|
|
@@ -304,7 +309,7 @@ export type MutationQueryReducersMap<T = {
|
|
|
304
309
|
};
|
|
305
310
|
export type MutationUpdaterFunction<TData, TVariables extends OperationVariables, TCache extends Cache.Implementation> = (cache: TCache, result: FormattedExecutionResult<Unmasked<TData>>, options: {
|
|
306
311
|
context?: DefaultContext;
|
|
307
|
-
variables
|
|
312
|
+
variables: TVariables;
|
|
308
313
|
}) => void;
|
|
309
314
|
export declare namespace QueryNotification {
|
|
310
315
|
type NewNetworkStatus = NextNotification<{
|
|
@@ -70,7 +70,7 @@ class IncrementalRequest {
|
|
|
70
70
|
if (hasIncrementalChunks(chunk)) {
|
|
71
71
|
for (const incremental of chunk.incremental) {
|
|
72
72
|
const pending = this.pendingMap.get(incremental.id);
|
|
73
|
-
(0, invariant_1.invariant)(pending,
|
|
73
|
+
(0, invariant_1.invariant)(pending, 68);
|
|
74
74
|
const path = pending.path.concat(incremental.subPath ?? []);
|
|
75
75
|
let data;
|
|
76
76
|
if ("items" in incremental) {
|
|
@@ -8,7 +8,7 @@ class NotImplementedHandler {
|
|
|
8
8
|
return false;
|
|
9
9
|
}
|
|
10
10
|
prepareRequest(request) {
|
|
11
|
-
(0, invariant_1.invariant)(!(0, internal_1.hasDirectives)(["defer", "stream"], request.query),
|
|
11
|
+
(0, invariant_1.invariant)(!(0, internal_1.hasDirectives)(["defer", "stream"], request.query), 69);
|
|
12
12
|
return request;
|
|
13
13
|
}
|
|
14
14
|
extractErrors() { }
|