@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.
Files changed (292) hide show
  1. package/apollo-client.cjs +231 -202
  2. package/apollo-client.cjs.map +1 -1
  3. package/apollo-client.min.cjs +1 -1
  4. package/cache/index.d.ts +13 -7
  5. package/cache/index.d.ts.map +1 -1
  6. package/cache/index.js +4 -4
  7. package/cache/index.js.map +1 -1
  8. package/cache/inmemory/types.d.ts +2 -2
  9. package/cache/inmemory/types.d.ts.map +1 -1
  10. package/cache/inmemory/types.js.map +1 -1
  11. package/core/core.cjs +2 -2
  12. package/core/core.cjs.map +1 -1
  13. package/core/core.cjs.native.js +2 -2
  14. package/core/equalByQuery.d.ts +2 -2
  15. package/core/equalByQuery.js +3 -3
  16. package/core/equalByQuery.js.map +1 -1
  17. package/core/index.d.ts +19 -14
  18. package/core/index.d.ts.map +1 -1
  19. package/core/index.js +12 -12
  20. package/core/index.js.map +1 -1
  21. package/core/types.d.ts +1 -1
  22. package/core/types.d.ts.map +1 -1
  23. package/core/types.js.map +1 -1
  24. package/dev/dev.cjs +22 -24
  25. package/dev/dev.cjs.map +1 -1
  26. package/dev/dev.cjs.native.js +22 -24
  27. package/dev/index.d.ts +3 -3
  28. package/dev/index.js +3 -3
  29. package/dev/index.js.map +1 -1
  30. package/dev/loadDevMessages.js +2 -2
  31. package/dev/loadDevMessages.js.map +1 -1
  32. package/dev/loadErrorMessageHandler.d.ts +1 -1
  33. package/dev/loadErrorMessageHandler.js +4 -4
  34. package/dev/loadErrorMessageHandler.js.map +1 -1
  35. package/dev/loadErrorMessages.js +2 -2
  36. package/dev/loadErrorMessages.js.map +1 -1
  37. package/invariantErrorCodes.js +16 -18
  38. package/link/batch/batchLink.d.ts +2 -1
  39. package/link/batch/batchLink.d.ts.map +1 -1
  40. package/link/batch/batchLink.js.map +1 -1
  41. package/link/core/types.d.ts +2 -2
  42. package/link/core/types.d.ts.map +1 -1
  43. package/link/core/types.js.map +1 -1
  44. package/link/http/index.d.ts +6 -3
  45. package/link/http/index.d.ts.map +1 -1
  46. package/link/http/index.js +1 -1
  47. package/link/http/index.js.map +1 -1
  48. package/link/remove-typename/index.d.ts +2 -1
  49. package/link/remove-typename/index.d.ts.map +1 -1
  50. package/link/remove-typename/index.js +1 -1
  51. package/link/remove-typename/index.js.map +1 -1
  52. package/link/remove-typename/remove-typename.cjs +2 -2
  53. package/link/remove-typename/remove-typename.cjs.map +1 -1
  54. package/link/remove-typename/remove-typename.cjs.native.js +2 -2
  55. package/link/remove-typename/removeTypenameFromVariables.d.ts +1 -1
  56. package/link/remove-typename/removeTypenameFromVariables.js +6 -6
  57. package/link/remove-typename/removeTypenameFromVariables.js.map +1 -1
  58. package/link/utils/index.d.ts +2 -1
  59. package/link/utils/index.d.ts.map +1 -1
  60. package/link/utils/index.js.map +1 -1
  61. package/package.json +2 -10
  62. package/react/cache/QueryReference.d.ts +10 -6
  63. package/react/cache/QueryReference.d.ts.map +1 -1
  64. package/react/cache/QueryReference.js +42 -31
  65. package/react/cache/QueryReference.js.map +1 -1
  66. package/react/cache/SuspenseCache.d.ts +3 -3
  67. package/react/cache/SuspenseCache.d.ts.map +1 -1
  68. package/react/cache/SuspenseCache.js +3 -3
  69. package/react/cache/SuspenseCache.js.map +1 -1
  70. package/react/cache/getSuspenseCache.d.ts +4 -4
  71. package/react/cache/getSuspenseCache.js +2 -2
  72. package/react/cache/getSuspenseCache.js.map +1 -1
  73. package/react/cache/index.d.ts +3 -3
  74. package/react/cache/index.js +5 -5
  75. package/react/cache/index.js.map +1 -1
  76. package/react/cache/types.d.ts +5 -1
  77. package/react/cache/types.d.ts.map +1 -1
  78. package/react/cache/types.js.map +1 -1
  79. package/react/components/Mutation.d.ts +3 -3
  80. package/react/components/Mutation.js +3 -3
  81. package/react/components/Mutation.js.map +1 -1
  82. package/react/components/Query.d.ts +3 -3
  83. package/react/components/Query.d.ts.map +1 -1
  84. package/react/components/Query.js +3 -3
  85. package/react/components/Query.js.map +1 -1
  86. package/react/components/Subscription.d.ts +3 -3
  87. package/react/components/Subscription.d.ts.map +1 -1
  88. package/react/components/Subscription.js +3 -3
  89. package/react/components/Subscription.js.map +1 -1
  90. package/react/components/components.cjs +3 -3
  91. package/react/components/components.cjs.map +1 -1
  92. package/react/components/components.cjs.native.js +3 -3
  93. package/react/components/index.d.ts +4 -4
  94. package/react/components/index.js +4 -4
  95. package/react/components/index.js.map +1 -1
  96. package/react/components/types.d.ts +4 -4
  97. package/react/components/types.d.ts.map +1 -1
  98. package/react/components/types.js.map +1 -1
  99. package/react/context/ApolloConsumer.d.ts +2 -2
  100. package/react/context/ApolloConsumer.js +3 -3
  101. package/react/context/ApolloConsumer.js.map +1 -1
  102. package/react/context/ApolloContext.d.ts +3 -10
  103. package/react/context/ApolloContext.d.ts.map +1 -1
  104. package/react/context/ApolloContext.js +15 -13
  105. package/react/context/ApolloContext.js.map +1 -1
  106. package/react/context/ApolloProvider.d.ts +2 -2
  107. package/react/context/ApolloProvider.js +3 -3
  108. package/react/context/ApolloProvider.js.map +1 -1
  109. package/react/context/context.cjs +12 -10
  110. package/react/context/context.cjs.map +1 -1
  111. package/react/context/context.cjs.native.js +12 -10
  112. package/react/context/index.d.ts +7 -4
  113. package/react/context/index.d.ts.map +1 -1
  114. package/react/context/index.js +4 -4
  115. package/react/context/index.js.map +1 -1
  116. package/react/hoc/graphql.d.ts +3 -3
  117. package/react/hoc/graphql.js +4 -4
  118. package/react/hoc/graphql.js.map +1 -1
  119. package/react/hoc/hoc-utils.d.ts +3 -3
  120. package/react/hoc/hoc-utils.d.ts.map +1 -1
  121. package/react/hoc/hoc-utils.js +5 -5
  122. package/react/hoc/hoc-utils.js.map +1 -1
  123. package/react/hoc/hoc.cjs +24 -23
  124. package/react/hoc/hoc.cjs.map +1 -1
  125. package/react/hoc/hoc.cjs.native.js +24 -23
  126. package/react/hoc/index.d.ts +7 -7
  127. package/react/hoc/index.js +7 -7
  128. package/react/hoc/index.js.map +1 -1
  129. package/react/hoc/mutation-hoc.d.ts +5 -5
  130. package/react/hoc/mutation-hoc.d.ts.map +1 -1
  131. package/react/hoc/mutation-hoc.js +13 -11
  132. package/react/hoc/mutation-hoc.js.map +1 -1
  133. package/react/hoc/query-hoc.d.ts +3 -3
  134. package/react/hoc/query-hoc.d.ts.map +1 -1
  135. package/react/hoc/query-hoc.js +10 -10
  136. package/react/hoc/query-hoc.js.map +1 -1
  137. package/react/hoc/subscription-hoc.d.ts +3 -3
  138. package/react/hoc/subscription-hoc.d.ts.map +1 -1
  139. package/react/hoc/subscription-hoc.js +11 -12
  140. package/react/hoc/subscription-hoc.js.map +1 -1
  141. package/react/hoc/types.d.ts +4 -4
  142. package/react/hoc/types.d.ts.map +1 -1
  143. package/react/hoc/types.js.map +1 -1
  144. package/react/hoc/withApollo.d.ts +3 -3
  145. package/react/hoc/withApollo.js +6 -6
  146. package/react/hoc/withApollo.js.map +1 -1
  147. package/react/hooks/constants.d.ts +3 -0
  148. package/react/hooks/constants.d.ts.map +1 -0
  149. package/react/hooks/constants.js +2 -0
  150. package/react/hooks/constants.js.map +1 -0
  151. package/react/hooks/hooks.cjs +182 -160
  152. package/react/hooks/hooks.cjs.map +1 -1
  153. package/react/hooks/hooks.cjs.native.js +182 -160
  154. package/react/hooks/index.d.ts +15 -11
  155. package/react/hooks/index.d.ts.map +1 -1
  156. package/react/hooks/index.js +12 -11
  157. package/react/hooks/index.js.map +1 -1
  158. package/react/hooks/internal/__use.js +6 -6
  159. package/react/hooks/internal/__use.js.map +1 -1
  160. package/react/hooks/internal/index.d.ts +3 -3
  161. package/react/hooks/internal/index.js +3 -3
  162. package/react/hooks/internal/index.js.map +1 -1
  163. package/react/hooks/internal/useDeepMemo.d.ts +1 -1
  164. package/react/hooks/internal/useDeepMemo.js +2 -2
  165. package/react/hooks/internal/useDeepMemo.js.map +1 -1
  166. package/react/hooks/internal/useIsomorphicLayoutEffect.d.ts +1 -1
  167. package/react/hooks/internal/useIsomorphicLayoutEffect.js +2 -2
  168. package/react/hooks/internal/useIsomorphicLayoutEffect.js.map +1 -1
  169. package/react/hooks/useApolloClient.d.ts +1 -1
  170. package/react/hooks/useApolloClient.js +3 -3
  171. package/react/hooks/useApolloClient.js.map +1 -1
  172. package/react/hooks/useBackgroundQuery.d.ts +48 -21
  173. package/react/hooks/useBackgroundQuery.d.ts.map +1 -1
  174. package/react/hooks/useBackgroundQuery.js +14 -17
  175. package/react/hooks/useBackgroundQuery.js.map +1 -1
  176. package/react/hooks/useFragment.d.ts.map +1 -1
  177. package/react/hooks/useFragment.js +7 -2
  178. package/react/hooks/useFragment.js.map +1 -1
  179. package/react/hooks/useLazyQuery.d.ts +4 -4
  180. package/react/hooks/useLazyQuery.d.ts.map +1 -1
  181. package/react/hooks/useLazyQuery.js +13 -12
  182. package/react/hooks/useLazyQuery.js.map +1 -1
  183. package/react/hooks/useMutation.d.ts +4 -4
  184. package/react/hooks/useMutation.d.ts.map +1 -1
  185. package/react/hooks/useMutation.js +28 -18
  186. package/react/hooks/useMutation.js.map +1 -1
  187. package/react/hooks/useQuery.d.ts +6 -5
  188. package/react/hooks/useQuery.d.ts.map +1 -1
  189. package/react/hooks/useQuery.js +45 -40
  190. package/react/hooks/useQuery.js.map +1 -1
  191. package/react/hooks/useReactiveVar.d.ts +1 -1
  192. package/react/hooks/useReactiveVar.js +1 -1
  193. package/react/hooks/useReactiveVar.js.map +1 -1
  194. package/react/hooks/useReadQuery.d.ts +2 -3
  195. package/react/hooks/useReadQuery.d.ts.map +1 -1
  196. package/react/hooks/useReadQuery.js +11 -24
  197. package/react/hooks/useReadQuery.js.map +1 -1
  198. package/react/hooks/useSubscription.d.ts +4 -4
  199. package/react/hooks/useSubscription.d.ts.map +1 -1
  200. package/react/hooks/useSubscription.js +10 -10
  201. package/react/hooks/useSubscription.js.map +1 -1
  202. package/react/hooks/useSuspenseQuery.d.ts +15 -10
  203. package/react/hooks/useSuspenseQuery.d.ts.map +1 -1
  204. package/react/hooks/useSuspenseQuery.js +22 -18
  205. package/react/hooks/useSuspenseQuery.js.map +1 -1
  206. package/react/hooks/useSyncExternalStore.d.ts.map +1 -1
  207. package/react/hooks/useSyncExternalStore.js +33 -30
  208. package/react/hooks/useSyncExternalStore.js.map +1 -1
  209. package/react/index.d.ts +8 -6
  210. package/react/index.d.ts.map +1 -1
  211. package/react/index.js +6 -6
  212. package/react/index.js.map +1 -1
  213. package/react/parser/index.d.ts +1 -1
  214. package/react/parser/index.d.ts.map +1 -1
  215. package/react/parser/index.js +14 -12
  216. package/react/parser/index.js.map +1 -1
  217. package/react/parser/parser.cjs +13 -11
  218. package/react/parser/parser.cjs.map +1 -1
  219. package/react/parser/parser.cjs.native.js +13 -11
  220. package/react/react.cjs +34 -30
  221. package/react/react.cjs.map +1 -1
  222. package/react/react.cjs.native.js +34 -30
  223. package/react/ssr/RenderPromises.d.ts +2 -2
  224. package/react/ssr/RenderPromises.d.ts.map +1 -1
  225. package/react/ssr/RenderPromises.js +17 -15
  226. package/react/ssr/RenderPromises.js.map +1 -1
  227. package/react/ssr/getDataFromTree.d.ts +2 -2
  228. package/react/ssr/getDataFromTree.d.ts.map +1 -1
  229. package/react/ssr/getDataFromTree.js +9 -7
  230. package/react/ssr/getDataFromTree.js.map +1 -1
  231. package/react/ssr/index.d.ts +3 -3
  232. package/react/ssr/index.js +3 -3
  233. package/react/ssr/index.js.map +1 -1
  234. package/react/ssr/renderToStringWithData.d.ts +1 -1
  235. package/react/ssr/renderToStringWithData.js +3 -3
  236. package/react/ssr/renderToStringWithData.js.map +1 -1
  237. package/react/ssr/ssr.cjs +23 -19
  238. package/react/ssr/ssr.cjs.map +1 -1
  239. package/react/ssr/ssr.cjs.native.js +23 -19
  240. package/react/types/types.d.ts +18 -19
  241. package/react/types/types.d.ts.map +1 -1
  242. package/react/types/types.js.map +1 -1
  243. package/testing/core/index.d.ts +8 -7
  244. package/testing/core/index.d.ts.map +1 -1
  245. package/testing/core/index.js +7 -7
  246. package/testing/core/index.js.map +1 -1
  247. package/testing/index.d.ts +2 -1
  248. package/testing/index.d.ts.map +1 -1
  249. package/testing/index.js.map +1 -1
  250. package/testing/matchers/index.js +3 -3
  251. package/testing/matchers/index.js.map +1 -1
  252. package/testing/matchers/toHaveSuspenseCacheEntryUsing.d.ts +3 -3
  253. package/testing/matchers/toHaveSuspenseCacheEntryUsing.js +6 -6
  254. package/testing/matchers/toHaveSuspenseCacheEntryUsing.js.map +1 -1
  255. package/testing/matchers/toMatchDocument.d.ts +2 -2
  256. package/testing/matchers/toMatchDocument.js +8 -8
  257. package/testing/matchers/toMatchDocument.js.map +1 -1
  258. package/utilities/common/omitDeep.d.ts +1 -1
  259. package/utilities/common/omitDeep.js +1 -1
  260. package/utilities/common/omitDeep.js.map +1 -1
  261. package/utilities/common/stripTypename.js +2 -2
  262. package/utilities/common/stripTypename.js.map +1 -1
  263. package/utilities/globals/globals.cjs +4 -4
  264. package/utilities/globals/globals.cjs.map +1 -1
  265. package/utilities/globals/globals.cjs.native.js +4 -4
  266. package/utilities/globals/invariantWrappers.d.ts +2 -2
  267. package/utilities/globals/invariantWrappers.js +7 -7
  268. package/utilities/globals/invariantWrappers.js.map +1 -1
  269. package/utilities/graphql/DocumentTransform.d.ts +1 -1
  270. package/utilities/graphql/DocumentTransform.js +4 -4
  271. package/utilities/graphql/DocumentTransform.js.map +1 -1
  272. package/utilities/graphql/operations.d.ts +1 -1
  273. package/utilities/graphql/operations.js +4 -4
  274. package/utilities/graphql/operations.js.map +1 -1
  275. package/utilities/graphql/print.d.ts +1 -1
  276. package/utilities/graphql/print.js +2 -2
  277. package/utilities/graphql/print.js.map +1 -1
  278. package/utilities/index.d.ts +40 -34
  279. package/utilities/index.d.ts.map +1 -1
  280. package/utilities/index.js +32 -32
  281. package/utilities/index.js.map +1 -1
  282. package/utilities/promises/decoration.d.ts +3 -3
  283. package/utilities/promises/decoration.js +8 -8
  284. package/utilities/promises/decoration.js.map +1 -1
  285. package/utilities/types/DeepOmit.d.ts +1 -1
  286. package/utilities/types/DeepOmit.js.map +1 -1
  287. package/utilities/types/DeepPartial.d.ts +1 -1
  288. package/utilities/types/DeepPartial.js.map +1 -1
  289. package/utilities/utilities.cjs +12 -12
  290. package/utilities/utilities.cjs.map +1 -1
  291. package/utilities/utilities.cjs.native.js +12 -12
  292. 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, ApolloCache } from './core/cache.js';
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, MissingFieldError, ReadFieldOptions } from './core/types/common.js';
6
- export { Reference, isReference, makeReference, } from '../utilities/index.js';
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, makeVar, cacheSlot, } from './inmemory/reactiveVars.js';
11
- export { TypePolicies, TypePolicy, FieldPolicy, FieldReadFunction, FieldMergeFunction, FieldFunctionOptions, PossibleTypesMap, Policies, } from './inmemory/policies.js';
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, createFragmentRegistry, } from './inmemory/fragmentRegistry.js';
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
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/cache/index.ts"],"names":[],"mappings":"AAAA,OAAO,+BAA+B,CAAC;AAEvC,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC3D,OAAO,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AACtD,OAAO,EACL,WAAW,EACX,QAAQ,EACR,SAAS,EACT,eAAe,EACf,iBAAiB,EACjB,gBAAgB,EACjB,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EACL,SAAS,EACT,WAAW,EACX,aAAa,GACd,MAAM,uBAAuB,CAAC;AAE/B,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,OAAO,EACL,WAAW,EACX,OAAO,EACP,SAAS,GACV,MAAM,4BAA4B,CAAC;AAEpC,OAAO,EACL,YAAY,EACZ,UAAU,EACV,WAAW,EACX,iBAAiB,EACjB,kBAAkB,EAClB,oBAAoB,EACpB,gBAAgB,EAChB,QAAQ,GACT,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EACL,kBAAkB,GACnB,MAAM,4BAA4B,CAAC;AAEpC,OAAO,EACL,mBAAmB,EACnB,sBAAsB,GACvB,MAAM,gCAAgC,CAAC;AAExC,cAAc,qBAAqB,CAAC"}
1
+ {"version":3,"file":"index.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@@ 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, } from '../utilities/index.js';
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, } from './inmemory/reactiveVars.js';
10
- export { Policies, } from './inmemory/policies.js';
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, } from './inmemory/fragmentRegistry.js';
12
+ export { createFragmentRegistry } from './inmemory/fragmentRegistry.js';
13
13
  export * from './inmemory/types.js';
14
14
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/cache/index.ts"],"names":[],"mappings":"AAAA,OAAO,+BAA+B,CAAC;AAEvC,OAAO,EAAe,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC3D,OAAO,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAE9C,OAAO,EAKL,iBAAiB,EAElB,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EAEL,WAAW,EACX,aAAa,GACd,MAAM,uBAAuB,CAAC;AAE/B,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,OAAO,EAEL,OAAO,EACP,SAAS,GACV,MAAM,4BAA4B,CAAC;AAEpC,OAAO,EAQL,QAAQ,GACT,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EACL,kBAAkB,GACnB,MAAM,4BAA4B,CAAC;AAEpC,OAAO,EAEL,sBAAsB,GACvB,MAAM,gCAAgC,CAAC;AAExC,cAAc,qBAAqB,CAAC","sourcesContent":["import '../utilities/globals/index.js';\n\nexport { Transaction, ApolloCache } from './core/cache.js';\nexport { Cache } from './core/types/Cache.js';\nexport { DataProxy } from './core/types/DataProxy.js';\nexport {\n MissingTree,\n Modifier,\n Modifiers,\n ModifierDetails,\n MissingFieldError,\n ReadFieldOptions\n} from './core/types/common.js';\n\nexport {\n Reference,\n isReference,\n makeReference,\n} 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 {\n ReactiveVar,\n makeVar,\n cacheSlot,\n} from './inmemory/reactiveVars.js';\n\nexport {\n TypePolicies,\n TypePolicy,\n FieldPolicy,\n FieldReadFunction,\n FieldMergeFunction,\n FieldFunctionOptions,\n PossibleTypesMap,\n Policies,\n} from './inmemory/policies.js';\n\nexport {\n canonicalStringify,\n} from './inmemory/object-canon.js';\n\nexport {\n FragmentRegistryAPI,\n createFragmentRegistry,\n} from './inmemory/fragmentRegistry.js';\n\nexport * from './inmemory/types.js';\n"]}
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,EACL,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,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,SAAS,EAAE,CAAA;AAE7C,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,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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-rc.1';
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 === 'nonreactive';
189
+ return dir.name.value === "nonreactive";
190
190
  }
191
191
 
192
192
  var assign = Object.assign, hasOwnProperty$1 = Object.hasOwnProperty;