@apollo/client 3.8.0-rc.1 → 3.8.0
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/apollo-client.cjs +231 -202
- package/apollo-client.cjs.map +1 -1
- package/apollo-client.min.cjs +1 -1
- package/cache/index.d.ts +13 -7
- package/cache/index.d.ts.map +1 -1
- package/cache/index.js +4 -4
- package/cache/index.js.map +1 -1
- package/cache/inmemory/types.d.ts +2 -2
- package/cache/inmemory/types.d.ts.map +1 -1
- package/cache/inmemory/types.js.map +1 -1
- package/core/core.cjs +2 -2
- package/core/core.cjs.map +1 -1
- package/core/core.cjs.native.js +2 -2
- package/core/equalByQuery.d.ts +2 -2
- package/core/equalByQuery.js +3 -3
- package/core/equalByQuery.js.map +1 -1
- package/core/index.d.ts +19 -14
- package/core/index.d.ts.map +1 -1
- package/core/index.js +12 -12
- package/core/index.js.map +1 -1
- package/core/types.d.ts +1 -1
- package/core/types.d.ts.map +1 -1
- package/core/types.js.map +1 -1
- package/dev/dev.cjs +22 -24
- package/dev/dev.cjs.map +1 -1
- package/dev/dev.cjs.native.js +22 -24
- package/dev/index.d.ts +3 -3
- package/dev/index.js +3 -3
- package/dev/index.js.map +1 -1
- package/dev/loadDevMessages.js +2 -2
- package/dev/loadDevMessages.js.map +1 -1
- package/dev/loadErrorMessageHandler.d.ts +1 -1
- package/dev/loadErrorMessageHandler.js +4 -4
- package/dev/loadErrorMessageHandler.js.map +1 -1
- package/dev/loadErrorMessages.js +2 -2
- package/dev/loadErrorMessages.js.map +1 -1
- package/invariantErrorCodes.js +16 -18
- package/link/batch/batchLink.d.ts +2 -1
- package/link/batch/batchLink.d.ts.map +1 -1
- package/link/batch/batchLink.js.map +1 -1
- package/link/core/types.d.ts +2 -2
- package/link/core/types.d.ts.map +1 -1
- package/link/core/types.js.map +1 -1
- package/link/http/index.d.ts +6 -3
- package/link/http/index.d.ts.map +1 -1
- package/link/http/index.js +1 -1
- package/link/http/index.js.map +1 -1
- package/link/remove-typename/index.d.ts +2 -1
- package/link/remove-typename/index.d.ts.map +1 -1
- package/link/remove-typename/index.js +1 -1
- package/link/remove-typename/index.js.map +1 -1
- package/link/remove-typename/remove-typename.cjs +2 -2
- package/link/remove-typename/remove-typename.cjs.map +1 -1
- package/link/remove-typename/remove-typename.cjs.native.js +2 -2
- package/link/remove-typename/removeTypenameFromVariables.d.ts +1 -1
- package/link/remove-typename/removeTypenameFromVariables.js +6 -6
- package/link/remove-typename/removeTypenameFromVariables.js.map +1 -1
- package/link/utils/index.d.ts +2 -1
- package/link/utils/index.d.ts.map +1 -1
- package/link/utils/index.js.map +1 -1
- package/package.json +2 -10
- package/react/cache/QueryReference.d.ts +10 -6
- package/react/cache/QueryReference.d.ts.map +1 -1
- package/react/cache/QueryReference.js +42 -31
- package/react/cache/QueryReference.js.map +1 -1
- package/react/cache/SuspenseCache.d.ts +3 -3
- package/react/cache/SuspenseCache.d.ts.map +1 -1
- package/react/cache/SuspenseCache.js +3 -3
- package/react/cache/SuspenseCache.js.map +1 -1
- package/react/cache/getSuspenseCache.d.ts +4 -4
- package/react/cache/getSuspenseCache.js +2 -2
- package/react/cache/getSuspenseCache.js.map +1 -1
- package/react/cache/index.d.ts +3 -3
- package/react/cache/index.js +5 -5
- package/react/cache/index.js.map +1 -1
- package/react/cache/types.d.ts +5 -1
- package/react/cache/types.d.ts.map +1 -1
- package/react/cache/types.js.map +1 -1
- package/react/components/Mutation.d.ts +3 -3
- package/react/components/Mutation.js +3 -3
- package/react/components/Mutation.js.map +1 -1
- package/react/components/Query.d.ts +3 -3
- package/react/components/Query.d.ts.map +1 -1
- package/react/components/Query.js +3 -3
- package/react/components/Query.js.map +1 -1
- package/react/components/Subscription.d.ts +3 -3
- package/react/components/Subscription.d.ts.map +1 -1
- package/react/components/Subscription.js +3 -3
- package/react/components/Subscription.js.map +1 -1
- package/react/components/components.cjs +3 -3
- package/react/components/components.cjs.map +1 -1
- package/react/components/components.cjs.native.js +3 -3
- package/react/components/index.d.ts +4 -4
- package/react/components/index.js +4 -4
- package/react/components/index.js.map +1 -1
- package/react/components/types.d.ts +4 -4
- package/react/components/types.d.ts.map +1 -1
- package/react/components/types.js.map +1 -1
- package/react/context/ApolloConsumer.d.ts +2 -2
- package/react/context/ApolloConsumer.js +3 -3
- package/react/context/ApolloConsumer.js.map +1 -1
- package/react/context/ApolloContext.d.ts +3 -10
- package/react/context/ApolloContext.d.ts.map +1 -1
- package/react/context/ApolloContext.js +15 -13
- package/react/context/ApolloContext.js.map +1 -1
- package/react/context/ApolloProvider.d.ts +2 -2
- package/react/context/ApolloProvider.js +3 -3
- package/react/context/ApolloProvider.js.map +1 -1
- package/react/context/context.cjs +12 -10
- package/react/context/context.cjs.map +1 -1
- package/react/context/context.cjs.native.js +12 -10
- package/react/context/index.d.ts +7 -4
- package/react/context/index.d.ts.map +1 -1
- package/react/context/index.js +4 -4
- package/react/context/index.js.map +1 -1
- package/react/hoc/graphql.d.ts +3 -3
- package/react/hoc/graphql.js +4 -4
- package/react/hoc/graphql.js.map +1 -1
- package/react/hoc/hoc-utils.d.ts +3 -3
- package/react/hoc/hoc-utils.d.ts.map +1 -1
- package/react/hoc/hoc-utils.js +5 -5
- package/react/hoc/hoc-utils.js.map +1 -1
- package/react/hoc/hoc.cjs +24 -23
- package/react/hoc/hoc.cjs.map +1 -1
- package/react/hoc/hoc.cjs.native.js +24 -23
- package/react/hoc/index.d.ts +7 -7
- package/react/hoc/index.js +7 -7
- package/react/hoc/index.js.map +1 -1
- package/react/hoc/mutation-hoc.d.ts +5 -5
- package/react/hoc/mutation-hoc.d.ts.map +1 -1
- package/react/hoc/mutation-hoc.js +13 -11
- package/react/hoc/mutation-hoc.js.map +1 -1
- package/react/hoc/query-hoc.d.ts +3 -3
- package/react/hoc/query-hoc.d.ts.map +1 -1
- package/react/hoc/query-hoc.js +10 -10
- package/react/hoc/query-hoc.js.map +1 -1
- package/react/hoc/subscription-hoc.d.ts +3 -3
- package/react/hoc/subscription-hoc.d.ts.map +1 -1
- package/react/hoc/subscription-hoc.js +11 -12
- package/react/hoc/subscription-hoc.js.map +1 -1
- package/react/hoc/types.d.ts +4 -4
- package/react/hoc/types.d.ts.map +1 -1
- package/react/hoc/types.js.map +1 -1
- package/react/hoc/withApollo.d.ts +3 -3
- package/react/hoc/withApollo.js +6 -6
- package/react/hoc/withApollo.js.map +1 -1
- package/react/hooks/constants.d.ts +3 -0
- package/react/hooks/constants.d.ts.map +1 -0
- package/react/hooks/constants.js +2 -0
- package/react/hooks/constants.js.map +1 -0
- package/react/hooks/hooks.cjs +182 -160
- package/react/hooks/hooks.cjs.map +1 -1
- package/react/hooks/hooks.cjs.native.js +182 -160
- package/react/hooks/index.d.ts +15 -11
- package/react/hooks/index.d.ts.map +1 -1
- package/react/hooks/index.js +12 -11
- package/react/hooks/index.js.map +1 -1
- package/react/hooks/internal/__use.js +6 -6
- package/react/hooks/internal/__use.js.map +1 -1
- package/react/hooks/internal/index.d.ts +3 -3
- package/react/hooks/internal/index.js +3 -3
- package/react/hooks/internal/index.js.map +1 -1
- package/react/hooks/internal/useDeepMemo.d.ts +1 -1
- package/react/hooks/internal/useDeepMemo.js +2 -2
- package/react/hooks/internal/useDeepMemo.js.map +1 -1
- package/react/hooks/internal/useIsomorphicLayoutEffect.d.ts +1 -1
- package/react/hooks/internal/useIsomorphicLayoutEffect.js +2 -2
- package/react/hooks/internal/useIsomorphicLayoutEffect.js.map +1 -1
- package/react/hooks/useApolloClient.d.ts +1 -1
- package/react/hooks/useApolloClient.js +3 -3
- package/react/hooks/useApolloClient.js.map +1 -1
- package/react/hooks/useBackgroundQuery.d.ts +48 -21
- package/react/hooks/useBackgroundQuery.d.ts.map +1 -1
- package/react/hooks/useBackgroundQuery.js +14 -17
- package/react/hooks/useBackgroundQuery.js.map +1 -1
- package/react/hooks/useFragment.d.ts.map +1 -1
- package/react/hooks/useFragment.js +7 -2
- package/react/hooks/useFragment.js.map +1 -1
- package/react/hooks/useLazyQuery.d.ts +4 -4
- package/react/hooks/useLazyQuery.d.ts.map +1 -1
- package/react/hooks/useLazyQuery.js +13 -12
- package/react/hooks/useLazyQuery.js.map +1 -1
- package/react/hooks/useMutation.d.ts +4 -4
- package/react/hooks/useMutation.d.ts.map +1 -1
- package/react/hooks/useMutation.js +28 -18
- package/react/hooks/useMutation.js.map +1 -1
- package/react/hooks/useQuery.d.ts +6 -5
- package/react/hooks/useQuery.d.ts.map +1 -1
- package/react/hooks/useQuery.js +45 -40
- package/react/hooks/useQuery.js.map +1 -1
- package/react/hooks/useReactiveVar.d.ts +1 -1
- package/react/hooks/useReactiveVar.js +1 -1
- package/react/hooks/useReactiveVar.js.map +1 -1
- package/react/hooks/useReadQuery.d.ts +2 -3
- package/react/hooks/useReadQuery.d.ts.map +1 -1
- package/react/hooks/useReadQuery.js +11 -24
- package/react/hooks/useReadQuery.js.map +1 -1
- package/react/hooks/useSubscription.d.ts +4 -4
- package/react/hooks/useSubscription.d.ts.map +1 -1
- package/react/hooks/useSubscription.js +10 -10
- package/react/hooks/useSubscription.js.map +1 -1
- package/react/hooks/useSuspenseQuery.d.ts +15 -10
- package/react/hooks/useSuspenseQuery.d.ts.map +1 -1
- package/react/hooks/useSuspenseQuery.js +22 -18
- package/react/hooks/useSuspenseQuery.js.map +1 -1
- package/react/hooks/useSyncExternalStore.d.ts.map +1 -1
- package/react/hooks/useSyncExternalStore.js +33 -30
- package/react/hooks/useSyncExternalStore.js.map +1 -1
- package/react/index.d.ts +8 -6
- package/react/index.d.ts.map +1 -1
- package/react/index.js +6 -6
- package/react/index.js.map +1 -1
- package/react/parser/index.d.ts +1 -1
- package/react/parser/index.d.ts.map +1 -1
- package/react/parser/index.js +14 -12
- package/react/parser/index.js.map +1 -1
- package/react/parser/parser.cjs +13 -11
- package/react/parser/parser.cjs.map +1 -1
- package/react/parser/parser.cjs.native.js +13 -11
- package/react/react.cjs +34 -30
- package/react/react.cjs.map +1 -1
- package/react/react.cjs.native.js +34 -30
- package/react/ssr/RenderPromises.d.ts +2 -2
- package/react/ssr/RenderPromises.d.ts.map +1 -1
- package/react/ssr/RenderPromises.js +17 -15
- package/react/ssr/RenderPromises.js.map +1 -1
- package/react/ssr/getDataFromTree.d.ts +2 -2
- package/react/ssr/getDataFromTree.d.ts.map +1 -1
- package/react/ssr/getDataFromTree.js +9 -7
- package/react/ssr/getDataFromTree.js.map +1 -1
- package/react/ssr/index.d.ts +3 -3
- package/react/ssr/index.js +3 -3
- package/react/ssr/index.js.map +1 -1
- package/react/ssr/renderToStringWithData.d.ts +1 -1
- package/react/ssr/renderToStringWithData.js +3 -3
- package/react/ssr/renderToStringWithData.js.map +1 -1
- package/react/ssr/ssr.cjs +23 -19
- package/react/ssr/ssr.cjs.map +1 -1
- package/react/ssr/ssr.cjs.native.js +23 -19
- package/react/types/types.d.ts +18 -19
- package/react/types/types.d.ts.map +1 -1
- package/react/types/types.js.map +1 -1
- package/testing/core/index.d.ts +8 -7
- package/testing/core/index.d.ts.map +1 -1
- package/testing/core/index.js +7 -7
- package/testing/core/index.js.map +1 -1
- package/testing/index.d.ts +2 -1
- package/testing/index.d.ts.map +1 -1
- package/testing/index.js.map +1 -1
- package/testing/matchers/index.js +3 -3
- package/testing/matchers/index.js.map +1 -1
- package/testing/matchers/toHaveSuspenseCacheEntryUsing.d.ts +3 -3
- package/testing/matchers/toHaveSuspenseCacheEntryUsing.js +6 -6
- package/testing/matchers/toHaveSuspenseCacheEntryUsing.js.map +1 -1
- package/testing/matchers/toMatchDocument.d.ts +2 -2
- package/testing/matchers/toMatchDocument.js +8 -8
- package/testing/matchers/toMatchDocument.js.map +1 -1
- package/utilities/common/omitDeep.d.ts +1 -1
- package/utilities/common/omitDeep.js +1 -1
- package/utilities/common/omitDeep.js.map +1 -1
- package/utilities/common/stripTypename.js +2 -2
- package/utilities/common/stripTypename.js.map +1 -1
- package/utilities/globals/globals.cjs +4 -4
- package/utilities/globals/globals.cjs.map +1 -1
- package/utilities/globals/globals.cjs.native.js +4 -4
- package/utilities/globals/invariantWrappers.d.ts +2 -2
- package/utilities/globals/invariantWrappers.js +7 -7
- package/utilities/globals/invariantWrappers.js.map +1 -1
- package/utilities/graphql/DocumentTransform.d.ts +1 -1
- package/utilities/graphql/DocumentTransform.js +4 -4
- package/utilities/graphql/DocumentTransform.js.map +1 -1
- package/utilities/graphql/operations.d.ts +1 -1
- package/utilities/graphql/operations.js +4 -4
- package/utilities/graphql/operations.js.map +1 -1
- package/utilities/graphql/print.d.ts +1 -1
- package/utilities/graphql/print.js +2 -2
- package/utilities/graphql/print.js.map +1 -1
- package/utilities/index.d.ts +40 -34
- package/utilities/index.d.ts.map +1 -1
- package/utilities/index.js +32 -32
- package/utilities/index.js.map +1 -1
- package/utilities/promises/decoration.d.ts +3 -3
- package/utilities/promises/decoration.js +8 -8
- package/utilities/promises/decoration.js.map +1 -1
- package/utilities/types/DeepOmit.d.ts +1 -1
- package/utilities/types/DeepOmit.js.map +1 -1
- package/utilities/types/DeepPartial.d.ts +1 -1
- package/utilities/types/DeepPartial.js.map +1 -1
- package/utilities/utilities.cjs +12 -12
- package/utilities/utilities.cjs.map +1 -1
- package/utilities/utilities.cjs.native.js +12 -12
- package/version.js +1 -1
package/cache/index.d.ts
CHANGED
|
@@ -1,15 +1,21 @@
|
|
|
1
1
|
import '../utilities/globals/index.js';
|
|
2
|
-
export { Transaction
|
|
2
|
+
export type { Transaction } from './core/cache.js';
|
|
3
|
+
export { ApolloCache } from './core/cache.js';
|
|
3
4
|
export { Cache } from './core/types/Cache.js';
|
|
4
|
-
export { DataProxy } from './core/types/DataProxy.js';
|
|
5
|
-
export { MissingTree, Modifier, Modifiers, ModifierDetails,
|
|
6
|
-
export {
|
|
5
|
+
export type { DataProxy } from './core/types/DataProxy.js';
|
|
6
|
+
export type { MissingTree, Modifier, Modifiers, ModifierDetails, ReadFieldOptions } from './core/types/common.js';
|
|
7
|
+
export { MissingFieldError } from './core/types/common.js';
|
|
8
|
+
export type { Reference } from '../utilities/index.js';
|
|
9
|
+
export { isReference, makeReference } from '../utilities/index.js';
|
|
7
10
|
export { EntityStore } from './inmemory/entityStore.js';
|
|
8
11
|
export { fieldNameFromStoreName, defaultDataIdFromObject, } from './inmemory/helpers.js';
|
|
9
12
|
export { InMemoryCache, } from './inmemory/inMemoryCache.js';
|
|
10
|
-
export { ReactiveVar
|
|
11
|
-
export {
|
|
13
|
+
export type { ReactiveVar } from './inmemory/reactiveVars.js';
|
|
14
|
+
export { makeVar, cacheSlot } from './inmemory/reactiveVars.js';
|
|
15
|
+
export type { TypePolicies, TypePolicy, FieldPolicy, FieldReadFunction, FieldMergeFunction, FieldFunctionOptions, PossibleTypesMap, } from './inmemory/policies.js';
|
|
16
|
+
export { Policies } from './inmemory/policies.js';
|
|
12
17
|
export { canonicalStringify, } from './inmemory/object-canon.js';
|
|
13
|
-
export { FragmentRegistryAPI
|
|
18
|
+
export type { FragmentRegistryAPI } from './inmemory/fragmentRegistry.js';
|
|
19
|
+
export { createFragmentRegistry } from './inmemory/fragmentRegistry.js';
|
|
14
20
|
export * from './inmemory/types.js';
|
|
15
21
|
//# sourceMappingURL=index.d.ts.map
|
package/cache/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/cache/index.ts"],"names":[],"mappings":"AAAA,OAAO,+BAA+B,CAAC;AAEvC,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/cache/index.ts"],"names":[],"mappings":"AAAA,OAAO,+BAA+B,CAAC;AAEvC,YAAY,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAC9C,YAAY,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAC3D,YAAY,EACV,WAAW,EACX,QAAQ,EACR,SAAS,EACT,eAAe,EACf,gBAAgB,EACjB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAE3D,YAAY,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAEnE,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,OAAO,EACL,sBAAsB,EACtB,uBAAuB,GACxB,MAAM,uBAAuB,CAAA;AAE9B,OAAO,EACL,aAAa,GACd,MAAM,6BAA6B,CAAC;AAErC,YAAY,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AAEhE,YAAY,EACV,YAAY,EACZ,UAAU,EACV,WAAW,EACX,iBAAiB,EACjB,kBAAkB,EAClB,oBAAoB,EACpB,gBAAgB,GACjB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAElD,OAAO,EACL,kBAAkB,GACnB,MAAM,4BAA4B,CAAC;AAEpC,YAAY,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAC;AAC1E,OAAO,EAAE,sBAAsB,EAAE,MAAM,gCAAgC,CAAC;AAExE,cAAc,qBAAqB,CAAC"}
|
package/cache/index.js
CHANGED
|
@@ -2,13 +2,13 @@ import '../utilities/globals/index.js';
|
|
|
2
2
|
export { ApolloCache } from './core/cache.js';
|
|
3
3
|
export { Cache } from './core/types/Cache.js';
|
|
4
4
|
export { MissingFieldError } from './core/types/common.js';
|
|
5
|
-
export { isReference, makeReference
|
|
5
|
+
export { isReference, makeReference } from '../utilities/index.js';
|
|
6
6
|
export { EntityStore } from './inmemory/entityStore.js';
|
|
7
7
|
export { fieldNameFromStoreName, defaultDataIdFromObject, } from './inmemory/helpers.js';
|
|
8
8
|
export { InMemoryCache, } from './inmemory/inMemoryCache.js';
|
|
9
|
-
export { makeVar, cacheSlot
|
|
10
|
-
export { Policies
|
|
9
|
+
export { makeVar, cacheSlot } from './inmemory/reactiveVars.js';
|
|
10
|
+
export { Policies } from './inmemory/policies.js';
|
|
11
11
|
export { canonicalStringify, } from './inmemory/object-canon.js';
|
|
12
|
-
export { createFragmentRegistry
|
|
12
|
+
export { createFragmentRegistry } from './inmemory/fragmentRegistry.js';
|
|
13
13
|
export * from './inmemory/types.js';
|
|
14
14
|
//# sourceMappingURL=index.js.map
|
package/cache/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/cache/index.ts"],"names":[],"mappings":"AAAA,OAAO,+BAA+B,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/cache/index.ts"],"names":[],"mappings":"AAAA,OAAO,+BAA+B,CAAC;AAGvC,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAS9C,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAG3D,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAEnE,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,OAAO,EACL,sBAAsB,EACtB,uBAAuB,GACxB,MAAM,uBAAuB,CAAA;AAE9B,OAAO,EACL,aAAa,GACd,MAAM,6BAA6B,CAAC;AAGrC,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AAWhE,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAElD,OAAO,EACL,kBAAkB,GACnB,MAAM,4BAA4B,CAAC;AAGpC,OAAO,EAAE,sBAAsB,EAAE,MAAM,gCAAgC,CAAC;AAExE,cAAc,qBAAqB,CAAC","sourcesContent":["import '../utilities/globals/index.js';\n\nexport type { Transaction } from './core/cache.js';\nexport { ApolloCache } from './core/cache.js';\nexport { Cache } from './core/types/Cache.js';\nexport type { DataProxy } from './core/types/DataProxy.js';\nexport type {\n MissingTree,\n Modifier,\n Modifiers,\n ModifierDetails,\n ReadFieldOptions\n} from './core/types/common.js';\nexport { MissingFieldError } from './core/types/common.js';\n\nexport type { Reference } from '../utilities/index.js';\nexport { isReference, makeReference } from '../utilities/index.js';\n\nexport { EntityStore } from './inmemory/entityStore.js';\nexport {\n fieldNameFromStoreName,\n defaultDataIdFromObject,\n} from './inmemory/helpers.js'\n\nexport {\n InMemoryCache,\n} from './inmemory/inMemoryCache.js';\n\nexport type { ReactiveVar } from './inmemory/reactiveVars.js';\nexport { makeVar, cacheSlot } from './inmemory/reactiveVars.js';\n\nexport type {\n TypePolicies,\n TypePolicy,\n FieldPolicy,\n FieldReadFunction,\n FieldMergeFunction,\n FieldFunctionOptions,\n PossibleTypesMap,\n} from './inmemory/policies.js';\nexport { Policies } from './inmemory/policies.js';\n\nexport {\n canonicalStringify,\n} from './inmemory/object-canon.js';\n\nexport type { FragmentRegistryAPI } from './inmemory/fragmentRegistry.js';\nexport { createFragmentRegistry } from './inmemory/fragmentRegistry.js';\n\nexport * from './inmemory/types.js';\n"]}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import type { DocumentNode, FieldNode } from 'graphql';
|
|
2
2
|
import type { Transaction } from '../core/cache.js';
|
|
3
|
-
import { StoreObject, StoreValue, Reference } from '../../utilities/index.js';
|
|
3
|
+
import type { StoreObject, StoreValue, Reference } from '../../utilities/index.js';
|
|
4
4
|
import type { FieldValueGetter } from './entityStore.js';
|
|
5
5
|
import type { TypePolicies, PossibleTypesMap, KeyFieldsFunction, StorageType, FieldMergeFunction } from './policies.js';
|
|
6
6
|
import type { Modifiers, ToReferenceFunction, CanReadFunction, AllFieldsModifier } from '../core/types/common.js';
|
|
7
7
|
import type { FragmentRegistryAPI } from './fragmentRegistry.js';
|
|
8
|
-
export { StoreObject, StoreValue, Reference };
|
|
8
|
+
export type { StoreObject, StoreValue, Reference };
|
|
9
9
|
export interface IdGetterObj extends Object {
|
|
10
10
|
__typename?: string;
|
|
11
11
|
id?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/cache/inmemory/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAEvD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/cache/inmemory/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAEvD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,KAAK,EACV,WAAW,EACX,UAAU,EACV,SAAS,EACV,MAAM,0BAA0B,CAAC;AAClC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACzD,OAAO,KAAK,EACV,YAAY,EACZ,gBAAgB,EAChB,iBAAiB,EACjB,WAAW,EACX,kBAAkB,EACnB,MAAM,eAAe,CAAC;AACvB,OAAO,KAAK,EACV,SAAS,EACT,mBAAmB,EACnB,eAAe,EACf,iBAAiB,EAClB,MAAM,yBAAyB,CAAC;AAEjC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAEjE,YAAY,EAAE,WAAW,EAAE,UAAU,EAAE,SAAS,EAAE,CAAA;AAElD,MAAM,WAAW,WAAY,SAAQ,MAAM;IACzC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAED,MAAM,CAAC,OAAO,MAAM,QAAQ,GAAG,CAC7B,KAAK,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AAC;CACtC;AAED,MAAM,WAAW,sBAAsB;IACrC,KAAK,EAAE,eAAe,CAAC;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAEhC,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/cache/inmemory/types.ts"],"names":[],"mappings":"AA6IC,CAAC;AAKD,CAAC","sourcesContent":["import type { DocumentNode, FieldNode } from 'graphql';\n\nimport type { Transaction } from '../core/cache.js';\nimport {\n StoreObject,\n StoreValue,\n Reference,\n} from '../../utilities/index.js';\nimport type { FieldValueGetter } from './entityStore.js';\nimport type {\n TypePolicies,\n PossibleTypesMap,\n KeyFieldsFunction,\n StorageType,\n FieldMergeFunction,\n} from './policies.js';\nimport type {\n Modifiers,\n ToReferenceFunction,\n CanReadFunction,\n AllFieldsModifier,\n} from '../core/types/common.js';\n\nimport type { FragmentRegistryAPI } from './fragmentRegistry.js';\n\nexport { StoreObject, StoreValue, Reference }\n\nexport interface IdGetterObj extends Object {\n __typename?: string;\n id?: string;\n _id?: string;\n}\n\nexport declare type IdGetter = (\n value: IdGetterObj,\n) => string | undefined;\n\n/**\n * This is an interface used to access, set and remove\n * StoreObjects from the cache\n */\nexport interface NormalizedCache {\n has(dataId: string): boolean;\n get(dataId: string, fieldName: string): StoreValue;\n\n // The store.merge method allows either argument to be a string ID, but\n // the other argument has to be a StoreObject. Either way, newer fields\n // always take precedence over older fields.\n merge(olderId: string, newerObject: StoreObject): void;\n merge(olderObject: StoreObject, newerId: string): void;\n\n modify<Entity extends Record<string, any>>(dataId: string, fields: Modifiers<Entity> | AllFieldsModifier<Entity>): boolean;\n delete(dataId: string, fieldName?: string): boolean;\n clear(): void;\n\n // non-Map elements:\n /**\n * returns an Object with key-value pairs matching the contents of the store\n */\n toObject(): NormalizedCacheObject;\n /**\n * replace the state of the store\n */\n replace(newData: NormalizedCacheObject): void;\n\n /**\n * Retain (or release) a given root ID to protect (or expose) it and its\n * transitive child entities from (or to) garbage collection. The current\n * retainment count is returned by both methods. Note that releasing a root\n * ID does not cause that entity to be garbage collected, but merely removes\n * it from the set of root IDs that will be considered during the next\n * mark-and-sweep collection.\n */\n retain(rootId: string): number;\n release(rootId: string): number;\n\n getFieldValue: FieldValueGetter;\n toReference: ToReferenceFunction;\n canRead: CanReadFunction;\n\n getStorage(\n idOrObj: string | StoreObject,\n ...storeFieldNames: (string | number)[]\n ): StorageType;\n}\n\n/**\n * This is a normalized representation of the Apollo query result cache. It consists of\n * a flattened representation of query result trees.\n */\nexport interface NormalizedCacheObject {\n __META?: {\n // Well-known singleton IDs like ROOT_QUERY and ROOT_MUTATION are\n // always considered to be root IDs during cache.gc garbage\n // collection, but other IDs can become roots if they are written\n // directly with cache.writeFragment or retained explicitly with\n // cache.retain. When such IDs exist, we include them in the __META\n // section so that they can survive cache.{extract,restore}.\n extraRootIds: string[];\n };\n [dataId: string]: StoreObject | undefined;\n}\n\nexport type OptimisticStoreItem = {\n id: string;\n data: NormalizedCacheObject;\n transaction: Transaction<NormalizedCacheObject>;\n};\n\nexport type ReadQueryOptions = {\n store: NormalizedCache;\n query: DocumentNode;\n variables?: Object;\n previousResult?: any;\n canonizeResults?: boolean;\n rootId?: string;\n config?: ApolloReducerConfig;\n};\n\nexport type DiffQueryAgainstStoreOptions = ReadQueryOptions & {\n returnPartialData?: boolean;\n};\n\nexport type ApolloReducerConfig = {\n dataIdFromObject?: KeyFieldsFunction;\n addTypename?: boolean;\n};\n\nexport interface InMemoryCacheConfig extends ApolloReducerConfig {\n resultCaching?: boolean;\n possibleTypes?: PossibleTypesMap;\n typePolicies?: TypePolicies;\n resultCacheMaxSize?: number;\n canonizeResults?: boolean;\n fragments?: FragmentRegistryAPI;\n}\n\nexport interface MergeInfo {\n field: FieldNode;\n typename: string | undefined;\n merge: FieldMergeFunction;\n};\n\nexport interface MergeTree {\n info?: MergeInfo;\n map: Map<string | number, MergeTree>;\n};\n\nexport interface ReadMergeModifyContext {\n store: NormalizedCache;\n variables?: Record<string, any>;\n // A JSON.stringify-serialized version of context.variables.\n varString?: string;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/cache/inmemory/types.ts"],"names":[],"mappings":"AA6IC,CAAC;AAKD,CAAC","sourcesContent":["import type { DocumentNode, FieldNode } from 'graphql';\n\nimport type { Transaction } from '../core/cache.js';\nimport type {\n StoreObject,\n StoreValue,\n Reference,\n} from '../../utilities/index.js';\nimport type { FieldValueGetter } from './entityStore.js';\nimport type {\n TypePolicies,\n PossibleTypesMap,\n KeyFieldsFunction,\n StorageType,\n FieldMergeFunction,\n} from './policies.js';\nimport type {\n Modifiers,\n ToReferenceFunction,\n CanReadFunction,\n AllFieldsModifier,\n} from '../core/types/common.js';\n\nimport type { FragmentRegistryAPI } from './fragmentRegistry.js';\n\nexport type { StoreObject, StoreValue, Reference }\n\nexport interface IdGetterObj extends Object {\n __typename?: string;\n id?: string;\n _id?: string;\n}\n\nexport declare type IdGetter = (\n value: IdGetterObj,\n) => string | undefined;\n\n/**\n * This is an interface used to access, set and remove\n * StoreObjects from the cache\n */\nexport interface NormalizedCache {\n has(dataId: string): boolean;\n get(dataId: string, fieldName: string): StoreValue;\n\n // The store.merge method allows either argument to be a string ID, but\n // the other argument has to be a StoreObject. Either way, newer fields\n // always take precedence over older fields.\n merge(olderId: string, newerObject: StoreObject): void;\n merge(olderObject: StoreObject, newerId: string): void;\n\n modify<Entity extends Record<string, any>>(dataId: string, fields: Modifiers<Entity> | AllFieldsModifier<Entity>): boolean;\n delete(dataId: string, fieldName?: string): boolean;\n clear(): void;\n\n // non-Map elements:\n /**\n * returns an Object with key-value pairs matching the contents of the store\n */\n toObject(): NormalizedCacheObject;\n /**\n * replace the state of the store\n */\n replace(newData: NormalizedCacheObject): void;\n\n /**\n * Retain (or release) a given root ID to protect (or expose) it and its\n * transitive child entities from (or to) garbage collection. The current\n * retainment count is returned by both methods. Note that releasing a root\n * ID does not cause that entity to be garbage collected, but merely removes\n * it from the set of root IDs that will be considered during the next\n * mark-and-sweep collection.\n */\n retain(rootId: string): number;\n release(rootId: string): number;\n\n getFieldValue: FieldValueGetter;\n toReference: ToReferenceFunction;\n canRead: CanReadFunction;\n\n getStorage(\n idOrObj: string | StoreObject,\n ...storeFieldNames: (string | number)[]\n ): StorageType;\n}\n\n/**\n * This is a normalized representation of the Apollo query result cache. It consists of\n * a flattened representation of query result trees.\n */\nexport interface NormalizedCacheObject {\n __META?: {\n // Well-known singleton IDs like ROOT_QUERY and ROOT_MUTATION are\n // always considered to be root IDs during cache.gc garbage\n // collection, but other IDs can become roots if they are written\n // directly with cache.writeFragment or retained explicitly with\n // cache.retain. When such IDs exist, we include them in the __META\n // section so that they can survive cache.{extract,restore}.\n extraRootIds: string[];\n };\n [dataId: string]: StoreObject | undefined;\n}\n\nexport type OptimisticStoreItem = {\n id: string;\n data: NormalizedCacheObject;\n transaction: Transaction<NormalizedCacheObject>;\n};\n\nexport type ReadQueryOptions = {\n store: NormalizedCache;\n query: DocumentNode;\n variables?: Object;\n previousResult?: any;\n canonizeResults?: boolean;\n rootId?: string;\n config?: ApolloReducerConfig;\n};\n\nexport type DiffQueryAgainstStoreOptions = ReadQueryOptions & {\n returnPartialData?: boolean;\n};\n\nexport type ApolloReducerConfig = {\n dataIdFromObject?: KeyFieldsFunction;\n addTypename?: boolean;\n};\n\nexport interface InMemoryCacheConfig extends ApolloReducerConfig {\n resultCaching?: boolean;\n possibleTypes?: PossibleTypesMap;\n typePolicies?: TypePolicies;\n resultCacheMaxSize?: number;\n canonizeResults?: boolean;\n fragments?: FragmentRegistryAPI;\n}\n\nexport interface MergeInfo {\n field: FieldNode;\n typename: string | undefined;\n merge: FieldMergeFunction;\n};\n\nexport interface MergeTree {\n info?: MergeInfo;\n map: Map<string | number, MergeTree>;\n};\n\nexport interface ReadMergeModifyContext {\n store: NormalizedCache;\n variables?: Record<string, any>;\n // A JSON.stringify-serialized version of context.variables.\n varString?: string;\n}\n"]}
|
package/core/core.cjs
CHANGED
|
@@ -19,7 +19,7 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
|
|
|
19
19
|
|
|
20
20
|
var equal__default = /*#__PURE__*/_interopDefaultLegacy(equal);
|
|
21
21
|
|
|
22
|
-
var version = '3.8.0
|
|
22
|
+
var version = '3.8.0';
|
|
23
23
|
|
|
24
24
|
function isNonNullObject(obj) {
|
|
25
25
|
return obj !== null && typeof obj === 'object';
|
|
@@ -186,7 +186,7 @@ function selectionHasNonreactiveDirective(selection) {
|
|
|
186
186
|
return (!!selection.directives && selection.directives.some(directiveIsNonreactive));
|
|
187
187
|
}
|
|
188
188
|
function directiveIsNonreactive(dir) {
|
|
189
|
-
return dir.name.value ===
|
|
189
|
+
return dir.name.value === "nonreactive";
|
|
190
190
|
}
|
|
191
191
|
|
|
192
192
|
var assign = Object.assign, hasOwnProperty$1 = Object.hasOwnProperty;
|