@apollo/client 3.9.0-alpha.3 → 3.9.0-alpha.5

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 (716) hide show
  1. package/.changeset/README.md +8 -0
  2. package/.changeset/beige-geese-wink.md +5 -0
  3. package/.changeset/breezy-spiders-tap.md +38 -0
  4. package/.changeset/clean-items-smash.md +5 -0
  5. package/.changeset/cold-llamas-turn.md +8 -0
  6. package/.changeset/config.json +14 -0
  7. package/.changeset/dirty-kids-crash.md +5 -0
  8. package/.changeset/forty-cups-shop.md +5 -0
  9. package/.changeset/friendly-clouds-laugh.md +7 -0
  10. package/.changeset/hot-ducks-burn.md +5 -0
  11. package/.changeset/polite-avocados-warn.md +5 -0
  12. package/.changeset/pre.json +29 -0
  13. package/.changeset/quick-hats-marry.md +5 -0
  14. package/.changeset/shaggy-ears-scream.md +5 -0
  15. package/.changeset/shaggy-sheep-pull.md +5 -0
  16. package/.changeset/sixty-boxes-rest.md +8 -0
  17. package/.changeset/sour-sheep-walk.md +7 -0
  18. package/.changeset/strong-terms-perform.md +46 -0
  19. package/.changeset/thick-mice-collect.md +5 -0
  20. package/.changeset/thirty-ties-arrive.md +26 -0
  21. package/.changeset/violet-lions-draw.md +5 -0
  22. package/.changeset/wild-dolphins-jog.md +5 -0
  23. package/.changeset/yellow-flies-repeat.md +5 -0
  24. package/CHANGELOG.md +3535 -0
  25. package/apollo-client.cjs +484 -401
  26. package/apollo-client.cjs.map +1 -1
  27. package/apollo-client.min.cjs +1 -1
  28. package/cache/cache.cjs +136 -153
  29. package/cache/cache.cjs.map +1 -1
  30. package/cache/cache.cjs.native.js +136 -153
  31. package/cache/core/cache.d.ts +10 -0
  32. package/cache/core/cache.js +17 -5
  33. package/cache/core/cache.js.map +1 -1
  34. package/cache/core/types/Cache.d.ts +1 -1
  35. package/cache/core/types/Cache.js.map +1 -1
  36. package/cache/core/types/DataProxy.d.ts +92 -0
  37. package/cache/core/types/common.d.ts +1 -1
  38. package/cache/core/types/common.js +4 -1
  39. package/cache/core/types/common.js.map +1 -1
  40. package/cache/inmemory/entityStore.d.ts +10 -1
  41. package/cache/inmemory/entityStore.js +190 -29
  42. package/cache/inmemory/entityStore.js.map +1 -1
  43. package/cache/inmemory/fixPolyfills.js +9 -0
  44. package/cache/inmemory/fixPolyfills.js.map +1 -1
  45. package/cache/inmemory/fixPolyfills.native.js +12 -0
  46. package/cache/inmemory/fixPolyfills.native.js.map +1 -1
  47. package/cache/inmemory/fragmentRegistry.d.ts +1 -0
  48. package/cache/inmemory/fragmentRegistry.js +23 -14
  49. package/cache/inmemory/fragmentRegistry.js.map +1 -1
  50. package/cache/inmemory/helpers.js +20 -11
  51. package/cache/inmemory/helpers.js.map +1 -1
  52. package/cache/inmemory/inMemoryCache.js +166 -9
  53. package/cache/inmemory/inMemoryCache.js.map +1 -1
  54. package/cache/inmemory/key-extractor.js +72 -4
  55. package/cache/inmemory/key-extractor.js.map +1 -1
  56. package/cache/inmemory/object-canon.js +87 -3
  57. package/cache/inmemory/object-canon.js.map +1 -1
  58. package/cache/inmemory/policies.js +190 -43
  59. package/cache/inmemory/policies.js.map +1 -1
  60. package/cache/inmemory/reactiveVars.js +20 -2
  61. package/cache/inmemory/reactiveVars.js.map +1 -1
  62. package/cache/inmemory/readFromStore.d.ts +4 -0
  63. package/cache/inmemory/readFromStore.js +58 -9
  64. package/cache/inmemory/readFromStore.js.map +1 -1
  65. package/cache/inmemory/types.d.ts +28 -0
  66. package/cache/inmemory/types.js.map +1 -1
  67. package/cache/inmemory/writeToStore.js +152 -25
  68. package/cache/inmemory/writeToStore.js.map +1 -1
  69. package/config/jest/setup.js +2 -0
  70. package/config/jest/setup.js.map +1 -1
  71. package/core/ApolloClient.d.ts +264 -3
  72. package/core/ApolloClient.js +235 -7
  73. package/core/ApolloClient.js.map +1 -1
  74. package/core/LocalState.d.ts +4 -6
  75. package/core/LocalState.js +56 -18
  76. package/core/LocalState.js.map +1 -1
  77. package/core/ObservableQuery.d.ts +25 -0
  78. package/core/ObservableQuery.js +239 -30
  79. package/core/ObservableQuery.js.map +1 -1
  80. package/core/QueryInfo.d.ts +3 -3
  81. package/core/QueryInfo.js +118 -13
  82. package/core/QueryInfo.js.map +1 -1
  83. package/core/QueryManager.d.ts +8 -1
  84. package/core/QueryManager.js +247 -46
  85. package/core/QueryManager.js.map +1 -1
  86. package/core/core.cjs +127 -114
  87. package/core/core.cjs.map +1 -1
  88. package/core/core.cjs.native.js +127 -114
  89. package/core/equalByQuery.js +20 -1
  90. package/core/equalByQuery.js.map +1 -1
  91. package/core/index.d.ts +1 -1
  92. package/core/index.js +19 -0
  93. package/core/index.js.map +1 -1
  94. package/core/networkStatus.d.ts +39 -0
  95. package/core/networkStatus.js +39 -0
  96. package/core/networkStatus.js.map +1 -1
  97. package/core/types.d.ts +9 -0
  98. package/core/types.js.map +1 -1
  99. package/core/watchQueryOptions.d.ts +225 -1
  100. package/core/watchQueryOptions.js.map +1 -1
  101. package/dev/dev.cjs +10 -119
  102. package/dev/dev.cjs.map +1 -1
  103. package/dev/dev.cjs.native.js +10 -119
  104. package/dev/loadErrorMessageHandler.js.map +1 -1
  105. package/errors/errors.cjs +1 -1
  106. package/errors/errors.cjs.map +1 -1
  107. package/errors/errors.cjs.native.js +1 -1
  108. package/errors/index.js +14 -1
  109. package/errors/index.js.map +1 -1
  110. package/invariantErrorCodes.js +6 -8
  111. package/link/batch/batch.cjs +2 -2
  112. package/link/batch/batch.cjs.map +1 -1
  113. package/link/batch/batch.cjs.native.js +2 -2
  114. package/link/batch/batchLink.d.ts +21 -0
  115. package/link/batch/batchLink.js +2 -1
  116. package/link/batch/batchLink.js.map +1 -1
  117. package/link/batch/batching.js +24 -1
  118. package/link/batch/batching.js.map +1 -1
  119. package/link/batch-http/batch-http.cjs +3 -2
  120. package/link/batch-http/batch-http.cjs.map +1 -1
  121. package/link/batch-http/batch-http.cjs.native.js +3 -2
  122. package/link/batch-http/batchHttpLink.d.ts +4 -0
  123. package/link/batch-http/batchHttpLink.js +53 -2
  124. package/link/batch-http/batchHttpLink.js.map +1 -1
  125. package/link/context/context.cjs.map +1 -1
  126. package/link/context/index.js +1 -0
  127. package/link/context/index.js.map +1 -1
  128. package/link/core/ApolloLink.js +12 -5
  129. package/link/core/ApolloLink.js.map +1 -1
  130. package/link/core/core.cjs +5 -5
  131. package/link/core/core.cjs.map +1 -1
  132. package/link/core/core.cjs.native.js +5 -5
  133. package/link/error/error.cjs +1 -1
  134. package/link/error/error.cjs.map +1 -1
  135. package/link/error/error.cjs.native.js +1 -1
  136. package/link/error/index.d.ts +3 -0
  137. package/link/error/index.js +4 -1
  138. package/link/error/index.js.map +1 -1
  139. package/link/http/HttpLink.d.ts +0 -2
  140. package/link/http/HttpLink.js +1 -1
  141. package/link/http/HttpLink.js.map +1 -1
  142. package/link/http/checkFetcher.js.map +1 -1
  143. package/link/http/createHttpLink.js +23 -1
  144. package/link/http/createHttpLink.js.map +1 -1
  145. package/link/http/createSignalIfSupported.d.ts +5 -0
  146. package/link/http/createSignalIfSupported.js +5 -0
  147. package/link/http/createSignalIfSupported.js.map +1 -1
  148. package/link/http/http.cjs +14 -12
  149. package/link/http/http.cjs.map +1 -1
  150. package/link/http/http.cjs.native.js +14 -12
  151. package/link/http/index.js +2 -1
  152. package/link/http/index.js.map +1 -1
  153. package/link/http/iterators/async.d.ts +4 -0
  154. package/link/http/iterators/async.js +4 -0
  155. package/link/http/iterators/async.js.map +1 -1
  156. package/link/http/iterators/nodeStream.d.ts +4 -0
  157. package/link/http/iterators/nodeStream.js +4 -0
  158. package/link/http/iterators/nodeStream.js.map +1 -1
  159. package/link/http/iterators/promise.d.ts +4 -0
  160. package/link/http/iterators/promise.js +4 -0
  161. package/link/http/iterators/promise.js.map +1 -1
  162. package/link/http/iterators/reader.d.ts +4 -0
  163. package/link/http/iterators/reader.js +4 -0
  164. package/link/http/iterators/reader.js.map +1 -1
  165. package/link/http/parseAndCheckHttpResponse.js +51 -10
  166. package/link/http/parseAndCheckHttpResponse.js.map +1 -1
  167. package/link/http/responseIterator.d.ts +4 -0
  168. package/link/http/responseIterator.js +6 -0
  169. package/link/http/responseIterator.js.map +1 -1
  170. package/link/http/rewriteURIForGET.d.ts +1 -1
  171. package/link/http/rewriteURIForGET.js +10 -0
  172. package/link/http/rewriteURIForGET.js.map +1 -1
  173. package/link/http/selectHttpOptionsAndBody.d.ts +45 -0
  174. package/link/http/selectHttpOptionsAndBody.js +23 -0
  175. package/link/http/selectHttpOptionsAndBody.js.map +1 -1
  176. package/link/http/selectURI.js.map +1 -1
  177. package/link/http/serializeFetchParameter.js.map +1 -1
  178. package/link/persisted-queries/index.js +34 -4
  179. package/link/persisted-queries/index.js.map +1 -1
  180. package/link/persisted-queries/persisted-queries.cjs +4 -4
  181. package/link/persisted-queries/persisted-queries.cjs.map +1 -1
  182. package/link/persisted-queries/persisted-queries.cjs.native.js +4 -4
  183. package/link/remove-typename/remove-typename.cjs +12 -9
  184. package/link/remove-typename/remove-typename.cjs.map +1 -1
  185. package/link/remove-typename/remove-typename.cjs.native.js +12 -9
  186. package/link/remove-typename/removeTypenameFromVariables.js +12 -9
  187. package/link/remove-typename/removeTypenameFromVariables.js.map +1 -1
  188. package/link/retry/delayFunction.d.ts +29 -0
  189. package/link/retry/delayFunction.js +6 -0
  190. package/link/retry/delayFunction.js.map +1 -1
  191. package/link/retry/retry.cjs +5 -5
  192. package/link/retry/retry.cjs.map +1 -1
  193. package/link/retry/retry.cjs.native.js +5 -5
  194. package/link/retry/retryFunction.d.ts +20 -0
  195. package/link/retry/retryLink.d.ts +6 -0
  196. package/link/retry/retryLink.js +31 -6
  197. package/link/retry/retryLink.js.map +1 -1
  198. package/link/schema/index.d.ts +13 -0
  199. package/link/schema/index.js +3 -3
  200. package/link/schema/index.js.map +1 -1
  201. package/link/schema/schema.cjs +3 -3
  202. package/link/schema/schema.cjs.map +1 -1
  203. package/link/schema/schema.cjs.native.js +3 -3
  204. package/link/subscriptions/index.js +35 -2
  205. package/link/subscriptions/index.js.map +1 -1
  206. package/link/subscriptions/subscriptions.cjs +3 -2
  207. package/link/subscriptions/subscriptions.cjs.map +1 -1
  208. package/link/subscriptions/subscriptions.cjs.native.js +3 -2
  209. package/link/utils/createOperation.js.map +1 -1
  210. package/link/utils/filterOperationVariables.js +4 -0
  211. package/link/utils/filterOperationVariables.js.map +1 -1
  212. package/link/utils/toPromise.js.map +1 -1
  213. package/link/utils/transformOperation.js +3 -2
  214. package/link/utils/transformOperation.js.map +1 -1
  215. package/link/utils/utils.cjs +2 -2
  216. package/link/utils/utils.cjs.map +1 -1
  217. package/link/utils/utils.cjs.native.js +2 -2
  218. package/link/utils/validateOperation.js.map +1 -1
  219. package/link/ws/index.d.ts +12 -0
  220. package/link/ws/index.js +1 -1
  221. package/link/ws/index.js.map +1 -1
  222. package/link/ws/ws.cjs +1 -1
  223. package/link/ws/ws.cjs.map +1 -1
  224. package/link/ws/ws.cjs.native.js +1 -1
  225. package/package.json +51 -38
  226. package/react/cache/QueryReference.d.ts +18 -10
  227. package/react/cache/QueryReference.js +52 -8
  228. package/react/cache/QueryReference.js.map +1 -1
  229. package/react/cache/SuspenseCache.d.ts +10 -0
  230. package/react/cache/SuspenseCache.js +1 -2
  231. package/react/cache/SuspenseCache.js.map +1 -1
  232. package/react/cache/getSuspenseCache.js.map +1 -1
  233. package/react/cache/types.d.ts +3 -0
  234. package/react/cache/types.js.map +1 -1
  235. package/react/components/Mutation.d.ts +2 -2
  236. package/react/components/Mutation.js.map +1 -1
  237. package/react/components/Query.d.ts +2 -2
  238. package/react/components/Query.js.map +1 -1
  239. package/react/components/Subscription.d.ts +2 -2
  240. package/react/components/Subscription.js.map +1 -1
  241. package/react/components/types.d.ts +4 -4
  242. package/react/components/types.js.map +1 -1
  243. package/react/context/ApolloConsumer.d.ts +3 -3
  244. package/react/context/ApolloConsumer.js +1 -1
  245. package/react/context/ApolloConsumer.js.map +1 -1
  246. package/react/context/ApolloContext.d.ts +7 -2
  247. package/react/context/ApolloContext.js +11 -4
  248. package/react/context/ApolloContext.js.map +1 -1
  249. package/react/context/ApolloProvider.d.ts +3 -3
  250. package/react/context/ApolloProvider.js +1 -1
  251. package/react/context/ApolloProvider.js.map +1 -1
  252. package/react/context/context.cjs +2 -4
  253. package/react/context/context.cjs.map +1 -1
  254. package/react/context/context.cjs.native.js +2 -4
  255. package/react/hoc/graphql.d.ts +2 -2
  256. package/react/hoc/graphql.js.map +1 -1
  257. package/react/hoc/hoc-utils.d.ts +2 -1
  258. package/react/hoc/hoc-utils.js +4 -2
  259. package/react/hoc/hoc-utils.js.map +1 -1
  260. package/react/hoc/hoc.cjs +10 -18
  261. package/react/hoc/hoc.cjs.map +1 -1
  262. package/react/hoc/hoc.cjs.native.js +10 -18
  263. package/react/hoc/mutation-hoc.d.ts +2 -2
  264. package/react/hoc/mutation-hoc.js +10 -5
  265. package/react/hoc/mutation-hoc.js.map +1 -1
  266. package/react/hoc/query-hoc.d.ts +2 -2
  267. package/react/hoc/query-hoc.js +11 -5
  268. package/react/hoc/query-hoc.js.map +1 -1
  269. package/react/hoc/subscription-hoc.d.ts +2 -2
  270. package/react/hoc/subscription-hoc.js +11 -5
  271. package/react/hoc/subscription-hoc.js.map +1 -1
  272. package/react/hoc/withApollo.d.ts +2 -2
  273. package/react/hoc/withApollo.js +4 -5
  274. package/react/hoc/withApollo.js.map +1 -1
  275. package/react/hooks/hooks.cjs +139 -67
  276. package/react/hooks/hooks.cjs.map +1 -1
  277. package/react/hooks/hooks.cjs.native.js +139 -67
  278. package/react/hooks/index.d.ts +2 -0
  279. package/react/hooks/index.js +1 -0
  280. package/react/hooks/index.js.map +1 -1
  281. package/react/hooks/internal/__use.js +6 -1
  282. package/react/hooks/internal/__use.js.map +1 -1
  283. package/react/hooks/internal/index.d.ts +1 -0
  284. package/react/hooks/internal/index.js +2 -0
  285. package/react/hooks/internal/index.js.map +1 -1
  286. package/react/hooks/internal/useDeepMemo.js +1 -1
  287. package/react/hooks/internal/useDeepMemo.js.map +1 -1
  288. package/react/hooks/internal/useIsomorphicLayoutEffect.d.ts +2 -1
  289. package/react/hooks/internal/useIsomorphicLayoutEffect.js +7 -4
  290. package/react/hooks/internal/useIsomorphicLayoutEffect.js.map +1 -1
  291. package/react/hooks/internal/useRenderGuard.d.ts +2 -0
  292. package/react/hooks/internal/useRenderGuard.js +17 -0
  293. package/react/hooks/internal/useRenderGuard.js.map +1 -0
  294. package/react/hooks/useApolloClient.js +1 -1
  295. package/react/hooks/useApolloClient.js.map +1 -1
  296. package/react/hooks/useBackgroundQuery.js +15 -12
  297. package/react/hooks/useBackgroundQuery.js.map +1 -1
  298. package/react/hooks/useFragment.js +5 -4
  299. package/react/hooks/useFragment.js.map +1 -1
  300. package/react/hooks/useLazyQuery.js +14 -5
  301. package/react/hooks/useLazyQuery.js.map +1 -1
  302. package/react/hooks/useLoadableQuery.d.ts +30 -0
  303. package/react/hooks/useLoadableQuery.js +61 -0
  304. package/react/hooks/useLoadableQuery.js.map +1 -0
  305. package/react/hooks/useMutation.js +9 -4
  306. package/react/hooks/useMutation.js.map +1 -1
  307. package/react/hooks/useQuery.d.ts +11 -0
  308. package/react/hooks/useQuery.js +139 -7
  309. package/react/hooks/useQuery.js.map +1 -1
  310. package/react/hooks/useReactiveVar.js +6 -1
  311. package/react/hooks/useReactiveVar.js.map +1 -1
  312. package/react/hooks/useReadQuery.d.ts +19 -0
  313. package/react/hooks/useReadQuery.js +5 -11
  314. package/react/hooks/useReadQuery.js.map +1 -1
  315. package/react/hooks/useSubscription.js +6 -1
  316. package/react/hooks/useSubscription.js.map +1 -1
  317. package/react/hooks/useSuspenseQuery.js +23 -23
  318. package/react/hooks/useSuspenseQuery.js.map +1 -1
  319. package/react/hooks/useSyncExternalStore.js +54 -2
  320. package/react/hooks/useSyncExternalStore.js.map +1 -1
  321. package/react/parser/index.d.ts +3 -0
  322. package/react/parser/index.js +13 -6
  323. package/react/parser/index.js.map +1 -1
  324. package/react/parser/parser.cjs +11 -5
  325. package/react/parser/parser.cjs.map +1 -1
  326. package/react/parser/parser.cjs.native.js +11 -5
  327. package/react/ssr/RenderPromises.d.ts +3 -3
  328. package/react/ssr/RenderPromises.js +21 -1
  329. package/react/ssr/RenderPromises.js.map +1 -1
  330. package/react/ssr/getDataFromTree.d.ts +4 -4
  331. package/react/ssr/getDataFromTree.js +19 -4
  332. package/react/ssr/getDataFromTree.js.map +1 -1
  333. package/react/ssr/renderToStringWithData.d.ts +2 -2
  334. package/react/ssr/renderToStringWithData.js.map +1 -1
  335. package/react/ssr/ssr.cjs +7 -5
  336. package/react/ssr/ssr.cjs.map +1 -1
  337. package/react/ssr/ssr.cjs.native.js +7 -5
  338. package/react/types/types.d.ts +125 -3
  339. package/react/types/types.js.map +1 -1
  340. package/testing/core/core.cjs +14 -11
  341. package/testing/core/core.cjs.map +1 -1
  342. package/testing/core/core.cjs.native.js +14 -11
  343. package/testing/core/itAsync.d.ts +1 -1
  344. package/testing/core/itAsync.js.map +1 -1
  345. package/testing/core/mocking/mockFetch.d.ts +2 -2
  346. package/testing/core/mocking/mockFetch.js +8 -4
  347. package/testing/core/mocking/mockFetch.js.map +1 -1
  348. package/testing/core/mocking/mockLink.d.ts +1 -1
  349. package/testing/core/mocking/mockLink.js +17 -7
  350. package/testing/core/mocking/mockLink.js.map +1 -1
  351. package/testing/core/mocking/mockQueryManager.js +2 -0
  352. package/testing/core/mocking/mockQueryManager.js.map +1 -1
  353. package/testing/core/mocking/mockSubscriptionLink.d.ts +1 -1
  354. package/testing/core/mocking/mockSubscriptionLink.js +1 -1
  355. package/testing/core/mocking/mockSubscriptionLink.js.map +1 -1
  356. package/testing/core/mocking/mockWatchQuery.js +1 -1
  357. package/testing/core/mocking/mockWatchQuery.js.map +1 -1
  358. package/testing/core/observableToPromise.d.ts +17 -3
  359. package/testing/core/observableToPromise.js +5 -0
  360. package/testing/core/observableToPromise.js.map +1 -1
  361. package/testing/core/subscribeAndCount.js +3 -0
  362. package/testing/core/subscribeAndCount.js.map +1 -1
  363. package/testing/core/wait.js +2 -2
  364. package/testing/core/wait.js.map +1 -1
  365. package/testing/core/withConsoleSpy.d.ts +3 -0
  366. package/testing/core/withConsoleSpy.js +7 -1
  367. package/testing/core/withConsoleSpy.js.map +1 -1
  368. package/testing/core/wrap.js +2 -0
  369. package/testing/core/wrap.js.map +1 -1
  370. package/testing/internal/ObservableStream.js +14 -14
  371. package/testing/internal/ObservableStream.js.map +1 -1
  372. package/testing/internal/disposables/disableActWarnings.d.ts +10 -0
  373. package/testing/internal/disposables/disableActWarnings.js +15 -0
  374. package/testing/internal/disposables/disableActWarnings.js.map +1 -0
  375. package/testing/internal/disposables/index.d.ts +1 -0
  376. package/testing/internal/disposables/index.js +1 -0
  377. package/testing/internal/disposables/index.js.map +1 -1
  378. package/testing/internal/disposables/spyOnConsole.d.ts +1 -0
  379. package/testing/internal/disposables/spyOnConsole.js +2 -0
  380. package/testing/internal/disposables/spyOnConsole.js.map +1 -1
  381. package/testing/internal/disposables/withCleanup.d.ts +1 -0
  382. package/testing/internal/disposables/withCleanup.js +3 -0
  383. package/testing/internal/disposables/withCleanup.js.map +1 -1
  384. package/testing/internal/profile/Render.d.ts +32 -1
  385. package/testing/internal/profile/Render.js +14 -2
  386. package/testing/internal/profile/Render.js.map +1 -1
  387. package/testing/internal/profile/context.d.ts +10 -0
  388. package/testing/internal/profile/context.js +14 -0
  389. package/testing/internal/profile/context.js.map +1 -0
  390. package/testing/internal/profile/index.d.ts +2 -2
  391. package/testing/internal/profile/index.js +1 -1
  392. package/testing/internal/profile/index.js.map +1 -1
  393. package/testing/internal/profile/profile.d.ts +67 -13
  394. package/testing/internal/profile/profile.js +153 -79
  395. package/testing/internal/profile/profile.js.map +1 -1
  396. package/testing/internal/profile/traces.d.ts +4 -0
  397. package/testing/internal/profile/traces.js +9 -5
  398. package/testing/internal/profile/traces.js.map +1 -1
  399. package/testing/matchers/ProfiledComponent.js +29 -26
  400. package/testing/matchers/ProfiledComponent.js.map +1 -1
  401. package/testing/matchers/index.js +2 -0
  402. package/testing/matchers/index.js.map +1 -1
  403. package/testing/matchers/toBeGarbageCollected.d.ts +8 -0
  404. package/testing/matchers/toBeGarbageCollected.js +48 -0
  405. package/testing/matchers/toBeGarbageCollected.js.map +1 -0
  406. package/testing/matchers/toHaveSuspenseCacheEntryUsing.js.map +1 -1
  407. package/testing/matchers/toMatchDocument.js.map +1 -1
  408. package/testing/react/MockedProvider.d.ts +5 -1
  409. package/testing/react/MockedProvider.js +6 -2
  410. package/testing/react/MockedProvider.js.map +1 -1
  411. package/testing/testing.cjs +4 -2
  412. package/testing/testing.cjs.map +1 -1
  413. package/testing/testing.cjs.native.js +4 -2
  414. package/utilities/common/arrays.js +1 -0
  415. package/utilities/common/arrays.js.map +1 -1
  416. package/utilities/common/canUse.js +16 -1
  417. package/utilities/common/canUse.js.map +1 -1
  418. package/utilities/common/canonicalStringify.d.ts +17 -0
  419. package/utilities/common/canonicalStringify.js +41 -0
  420. package/utilities/common/canonicalStringify.js.map +1 -1
  421. package/utilities/common/cloneDeep.d.ts +3 -0
  422. package/utilities/common/cloneDeep.js +5 -0
  423. package/utilities/common/cloneDeep.js.map +1 -1
  424. package/utilities/common/compact.d.ts +4 -0
  425. package/utilities/common/compact.js +4 -0
  426. package/utilities/common/compact.js.map +1 -1
  427. package/utilities/common/errorHandling.js +1 -3
  428. package/utilities/common/errorHandling.js.map +1 -1
  429. package/utilities/common/incrementalResult.js +3 -0
  430. package/utilities/common/incrementalResult.js.map +1 -1
  431. package/utilities/common/makeUniqueId.js +2 -0
  432. package/utilities/common/makeUniqueId.js.map +1 -1
  433. package/utilities/common/maybeDeepFreeze.js +3 -0
  434. package/utilities/common/maybeDeepFreeze.js.map +1 -1
  435. package/utilities/common/mergeDeep.js +12 -1
  436. package/utilities/common/mergeDeep.js.map +1 -1
  437. package/utilities/common/mergeOptions.d.ts +1 -1
  438. package/utilities/common/mergeOptions.js.map +1 -1
  439. package/utilities/common/omitDeep.js.map +1 -1
  440. package/utilities/globals/global.js +7 -1
  441. package/utilities/globals/global.js.map +1 -1
  442. package/utilities/globals/globals.cjs +4 -5
  443. package/utilities/globals/globals.cjs.map +1 -1
  444. package/utilities/globals/globals.cjs.native.js +4 -5
  445. package/utilities/globals/index.d.ts +4 -0
  446. package/utilities/globals/index.js +7 -0
  447. package/utilities/globals/index.js.map +1 -1
  448. package/utilities/globals/invariantWrappers.d.ts +40 -0
  449. package/utilities/globals/invariantWrappers.js +11 -3
  450. package/utilities/globals/invariantWrappers.js.map +1 -1
  451. package/utilities/globals/maybe.js.map +1 -1
  452. package/utilities/graphql/DocumentTransform.d.ts +6 -5
  453. package/utilities/graphql/DocumentTransform.js +48 -27
  454. package/utilities/graphql/DocumentTransform.js.map +1 -1
  455. package/utilities/graphql/directives.js +3 -0
  456. package/utilities/graphql/directives.js.map +1 -1
  457. package/utilities/graphql/fragments.d.ts +25 -0
  458. package/utilities/graphql/fragments.js +36 -0
  459. package/utilities/graphql/fragments.js.map +1 -1
  460. package/utilities/graphql/getFromAST.d.ts +5 -0
  461. package/utilities/graphql/getFromAST.js +9 -0
  462. package/utilities/graphql/getFromAST.js.map +1 -1
  463. package/utilities/graphql/print.d.ts +4 -2
  464. package/utilities/graphql/print.js +11 -7
  465. package/utilities/graphql/print.js.map +1 -1
  466. package/utilities/graphql/storeUtils.d.ts +14 -0
  467. package/utilities/graphql/storeUtils.js +8 -2
  468. package/utilities/graphql/storeUtils.js.map +1 -1
  469. package/utilities/graphql/transform.js +106 -7
  470. package/utilities/graphql/transform.js.map +1 -1
  471. package/utilities/index.d.ts +2 -0
  472. package/utilities/index.js.map +1 -1
  473. package/utilities/observables/Concast.d.ts +1 -1
  474. package/utilities/observables/Concast.js +85 -2
  475. package/utilities/observables/Concast.js.map +1 -1
  476. package/utilities/observables/Observable.js +6 -0
  477. package/utilities/observables/Observable.js.map +1 -1
  478. package/utilities/observables/asyncMap.js +12 -3
  479. package/utilities/observables/asyncMap.js.map +1 -1
  480. package/utilities/observables/iteration.js +3 -0
  481. package/utilities/observables/iteration.js.map +1 -1
  482. package/utilities/observables/subclassing.js +14 -0
  483. package/utilities/observables/subclassing.js.map +1 -1
  484. package/utilities/policies/pagination.js +47 -3
  485. package/utilities/policies/pagination.js.map +1 -1
  486. package/utilities/promises/decoration.js +1 -0
  487. package/utilities/promises/decoration.js.map +1 -1
  488. package/utilities/subscriptions/relay/index.js.map +1 -1
  489. package/utilities/subscriptions/relay/relay.cjs +9 -8
  490. package/utilities/subscriptions/relay/relay.cjs.map +1 -1
  491. package/utilities/subscriptions/relay/relay.cjs.native.js +9 -8
  492. package/utilities/subscriptions/urql/index.js.map +1 -1
  493. package/utilities/subscriptions/urql/urql.cjs +9 -8
  494. package/utilities/subscriptions/urql/urql.cjs.map +1 -1
  495. package/utilities/subscriptions/urql/urql.cjs.native.js +9 -8
  496. package/utilities/types/DeepOmit.js.map +1 -1
  497. package/utilities/types/DeepPartial.d.ts +1 -1
  498. package/utilities/types/DeepPartial.js +4 -0
  499. package/utilities/types/DeepPartial.js.map +1 -1
  500. package/utilities/types/IsStrictlyAny.js.map +1 -1
  501. package/utilities/types/OnlyRequiredProperties.d.ts +7 -0
  502. package/utilities/types/OnlyRequiredProperties.js +2 -0
  503. package/utilities/types/OnlyRequiredProperties.js.map +1 -0
  504. package/utilities/types/TODO.d.ts +3 -0
  505. package/utilities/types/TODO.js +2 -0
  506. package/utilities/types/TODO.js.map +1 -0
  507. package/utilities/utilities.cjs +68 -55
  508. package/utilities/utilities.cjs.map +1 -1
  509. package/utilities/utilities.cjs.native.js +68 -55
  510. package/version.js +1 -1
  511. package/cache/core/cache.d.ts.map +0 -1
  512. package/cache/core/types/Cache.d.ts.map +0 -1
  513. package/cache/core/types/DataProxy.d.ts.map +0 -1
  514. package/cache/core/types/common.d.ts.map +0 -1
  515. package/cache/index.d.ts.map +0 -1
  516. package/cache/inmemory/entityStore.d.ts.map +0 -1
  517. package/cache/inmemory/fixPolyfills.d.ts.map +0 -1
  518. package/cache/inmemory/fixPolyfills.native.d.ts.map +0 -1
  519. package/cache/inmemory/fragmentRegistry.d.ts.map +0 -1
  520. package/cache/inmemory/helpers.d.ts.map +0 -1
  521. package/cache/inmemory/inMemoryCache.d.ts.map +0 -1
  522. package/cache/inmemory/key-extractor.d.ts.map +0 -1
  523. package/cache/inmemory/object-canon.d.ts.map +0 -1
  524. package/cache/inmemory/policies.d.ts.map +0 -1
  525. package/cache/inmemory/reactiveVars.d.ts.map +0 -1
  526. package/cache/inmemory/readFromStore.d.ts.map +0 -1
  527. package/cache/inmemory/types.d.ts.map +0 -1
  528. package/cache/inmemory/writeToStore.d.ts.map +0 -1
  529. package/config/jest/setup.d.ts.map +0 -1
  530. package/core/ApolloClient.d.ts.map +0 -1
  531. package/core/LocalState.d.ts.map +0 -1
  532. package/core/ObservableQuery.d.ts.map +0 -1
  533. package/core/QueryInfo.d.ts.map +0 -1
  534. package/core/QueryManager.d.ts.map +0 -1
  535. package/core/equalByQuery.d.ts.map +0 -1
  536. package/core/index.d.ts.map +0 -1
  537. package/core/networkStatus.d.ts.map +0 -1
  538. package/core/types.d.ts.map +0 -1
  539. package/core/watchQueryOptions.d.ts.map +0 -1
  540. package/dev/index.d.ts.map +0 -1
  541. package/dev/loadDevMessages.d.ts.map +0 -1
  542. package/dev/loadErrorMessageHandler.d.ts.map +0 -1
  543. package/dev/loadErrorMessages.d.ts.map +0 -1
  544. package/errors/index.d.ts.map +0 -1
  545. package/index.d.ts.map +0 -1
  546. package/invariantErrorCodes.d.ts.map +0 -1
  547. package/link/batch/batchLink.d.ts.map +0 -1
  548. package/link/batch/batching.d.ts.map +0 -1
  549. package/link/batch/index.d.ts.map +0 -1
  550. package/link/batch-http/batchHttpLink.d.ts.map +0 -1
  551. package/link/batch-http/index.d.ts.map +0 -1
  552. package/link/context/index.d.ts.map +0 -1
  553. package/link/core/ApolloLink.d.ts.map +0 -1
  554. package/link/core/concat.d.ts.map +0 -1
  555. package/link/core/empty.d.ts.map +0 -1
  556. package/link/core/execute.d.ts.map +0 -1
  557. package/link/core/from.d.ts.map +0 -1
  558. package/link/core/index.d.ts.map +0 -1
  559. package/link/core/split.d.ts.map +0 -1
  560. package/link/core/types.d.ts.map +0 -1
  561. package/link/error/index.d.ts.map +0 -1
  562. package/link/http/HttpLink.d.ts.map +0 -1
  563. package/link/http/checkFetcher.d.ts.map +0 -1
  564. package/link/http/createHttpLink.d.ts.map +0 -1
  565. package/link/http/createSignalIfSupported.d.ts.map +0 -1
  566. package/link/http/index.d.ts.map +0 -1
  567. package/link/http/iterators/async.d.ts.map +0 -1
  568. package/link/http/iterators/nodeStream.d.ts.map +0 -1
  569. package/link/http/iterators/promise.d.ts.map +0 -1
  570. package/link/http/iterators/reader.d.ts.map +0 -1
  571. package/link/http/parseAndCheckHttpResponse.d.ts.map +0 -1
  572. package/link/http/responseIterator.d.ts.map +0 -1
  573. package/link/http/rewriteURIForGET.d.ts.map +0 -1
  574. package/link/http/selectHttpOptionsAndBody.d.ts.map +0 -1
  575. package/link/http/selectURI.d.ts.map +0 -1
  576. package/link/http/serializeFetchParameter.d.ts.map +0 -1
  577. package/link/persisted-queries/index.d.ts.map +0 -1
  578. package/link/remove-typename/index.d.ts.map +0 -1
  579. package/link/remove-typename/removeTypenameFromVariables.d.ts.map +0 -1
  580. package/link/retry/delayFunction.d.ts.map +0 -1
  581. package/link/retry/index.d.ts.map +0 -1
  582. package/link/retry/retryFunction.d.ts.map +0 -1
  583. package/link/retry/retryLink.d.ts.map +0 -1
  584. package/link/schema/index.d.ts.map +0 -1
  585. package/link/subscriptions/index.d.ts.map +0 -1
  586. package/link/utils/createOperation.d.ts.map +0 -1
  587. package/link/utils/filterOperationVariables.d.ts.map +0 -1
  588. package/link/utils/fromError.d.ts.map +0 -1
  589. package/link/utils/fromPromise.d.ts.map +0 -1
  590. package/link/utils/index.d.ts.map +0 -1
  591. package/link/utils/throwServerError.d.ts.map +0 -1
  592. package/link/utils/toPromise.d.ts.map +0 -1
  593. package/link/utils/transformOperation.d.ts.map +0 -1
  594. package/link/utils/validateOperation.d.ts.map +0 -1
  595. package/link/ws/index.d.ts.map +0 -1
  596. package/react/cache/QueryReference.d.ts.map +0 -1
  597. package/react/cache/SuspenseCache.d.ts.map +0 -1
  598. package/react/cache/getSuspenseCache.d.ts.map +0 -1
  599. package/react/cache/index.d.ts.map +0 -1
  600. package/react/cache/types.d.ts.map +0 -1
  601. package/react/components/Mutation.d.ts.map +0 -1
  602. package/react/components/Query.d.ts.map +0 -1
  603. package/react/components/Subscription.d.ts.map +0 -1
  604. package/react/components/index.d.ts.map +0 -1
  605. package/react/components/types.d.ts.map +0 -1
  606. package/react/context/ApolloConsumer.d.ts.map +0 -1
  607. package/react/context/ApolloContext.d.ts.map +0 -1
  608. package/react/context/ApolloProvider.d.ts.map +0 -1
  609. package/react/context/index.d.ts.map +0 -1
  610. package/react/hoc/graphql.d.ts.map +0 -1
  611. package/react/hoc/hoc-utils.d.ts.map +0 -1
  612. package/react/hoc/index.d.ts.map +0 -1
  613. package/react/hoc/mutation-hoc.d.ts.map +0 -1
  614. package/react/hoc/query-hoc.d.ts.map +0 -1
  615. package/react/hoc/subscription-hoc.d.ts.map +0 -1
  616. package/react/hoc/types.d.ts.map +0 -1
  617. package/react/hoc/withApollo.d.ts.map +0 -1
  618. package/react/hooks/constants.d.ts.map +0 -1
  619. package/react/hooks/index.d.ts.map +0 -1
  620. package/react/hooks/internal/__use.d.ts.map +0 -1
  621. package/react/hooks/internal/index.d.ts.map +0 -1
  622. package/react/hooks/internal/useDeepMemo.d.ts.map +0 -1
  623. package/react/hooks/internal/useIsomorphicLayoutEffect.d.ts.map +0 -1
  624. package/react/hooks/useApolloClient.d.ts.map +0 -1
  625. package/react/hooks/useBackgroundQuery.d.ts.map +0 -1
  626. package/react/hooks/useFragment.d.ts.map +0 -1
  627. package/react/hooks/useLazyQuery.d.ts.map +0 -1
  628. package/react/hooks/useMutation.d.ts.map +0 -1
  629. package/react/hooks/useQuery.d.ts.map +0 -1
  630. package/react/hooks/useReactiveVar.d.ts.map +0 -1
  631. package/react/hooks/useReadQuery.d.ts.map +0 -1
  632. package/react/hooks/useSubscription.d.ts.map +0 -1
  633. package/react/hooks/useSuspenseQuery.d.ts.map +0 -1
  634. package/react/hooks/useSyncExternalStore.d.ts.map +0 -1
  635. package/react/index.d.ts.map +0 -1
  636. package/react/parser/index.d.ts.map +0 -1
  637. package/react/ssr/RenderPromises.d.ts.map +0 -1
  638. package/react/ssr/getDataFromTree.d.ts.map +0 -1
  639. package/react/ssr/index.d.ts.map +0 -1
  640. package/react/ssr/renderToStringWithData.d.ts.map +0 -1
  641. package/react/types/types.d.ts.map +0 -1
  642. package/testing/core/index.d.ts.map +0 -1
  643. package/testing/core/itAsync.d.ts.map +0 -1
  644. package/testing/core/mocking/mockClient.d.ts.map +0 -1
  645. package/testing/core/mocking/mockFetch.d.ts.map +0 -1
  646. package/testing/core/mocking/mockLink.d.ts.map +0 -1
  647. package/testing/core/mocking/mockQueryManager.d.ts.map +0 -1
  648. package/testing/core/mocking/mockSubscriptionLink.d.ts.map +0 -1
  649. package/testing/core/mocking/mockWatchQuery.d.ts.map +0 -1
  650. package/testing/core/observableToPromise.d.ts.map +0 -1
  651. package/testing/core/subscribeAndCount.d.ts.map +0 -1
  652. package/testing/core/wait.d.ts.map +0 -1
  653. package/testing/core/withConsoleSpy.d.ts.map +0 -1
  654. package/testing/core/wrap.d.ts.map +0 -1
  655. package/testing/index.d.ts.map +0 -1
  656. package/testing/internal/ObservableStream.d.ts.map +0 -1
  657. package/testing/internal/disposables/index.d.ts.map +0 -1
  658. package/testing/internal/disposables/spyOnConsole.d.ts.map +0 -1
  659. package/testing/internal/disposables/withCleanup.d.ts.map +0 -1
  660. package/testing/internal/index.d.ts.map +0 -1
  661. package/testing/internal/profile/Render.d.ts.map +0 -1
  662. package/testing/internal/profile/index.d.ts.map +0 -1
  663. package/testing/internal/profile/profile.d.ts.map +0 -1
  664. package/testing/internal/profile/traces.d.ts.map +0 -1
  665. package/testing/matchers/ProfiledComponent.d.ts.map +0 -1
  666. package/testing/matchers/index.d.ts.map +0 -1
  667. package/testing/matchers/toHaveSuspenseCacheEntryUsing.d.ts.map +0 -1
  668. package/testing/matchers/toMatchDocument.d.ts.map +0 -1
  669. package/testing/react/MockedProvider.d.ts.map +0 -1
  670. package/utilities/common/arrays.d.ts.map +0 -1
  671. package/utilities/common/canUse.d.ts.map +0 -1
  672. package/utilities/common/canonicalStringify.d.ts.map +0 -1
  673. package/utilities/common/cloneDeep.d.ts.map +0 -1
  674. package/utilities/common/compact.d.ts.map +0 -1
  675. package/utilities/common/errorHandling.d.ts.map +0 -1
  676. package/utilities/common/filterInPlace.d.ts +0 -2
  677. package/utilities/common/filterInPlace.d.ts.map +0 -1
  678. package/utilities/common/filterInPlace.js +0 -11
  679. package/utilities/common/filterInPlace.js.map +0 -1
  680. package/utilities/common/incrementalResult.d.ts.map +0 -1
  681. package/utilities/common/makeUniqueId.d.ts.map +0 -1
  682. package/utilities/common/maybeDeepFreeze.d.ts.map +0 -1
  683. package/utilities/common/mergeDeep.d.ts.map +0 -1
  684. package/utilities/common/mergeOptions.d.ts.map +0 -1
  685. package/utilities/common/objects.d.ts.map +0 -1
  686. package/utilities/common/omitDeep.d.ts.map +0 -1
  687. package/utilities/common/stringifyForDisplay.d.ts.map +0 -1
  688. package/utilities/common/stripTypename.d.ts.map +0 -1
  689. package/utilities/globals/global.d.ts.map +0 -1
  690. package/utilities/globals/index.d.ts.map +0 -1
  691. package/utilities/globals/invariantWrappers.d.ts.map +0 -1
  692. package/utilities/globals/maybe.d.ts.map +0 -1
  693. package/utilities/graphql/DocumentTransform.d.ts.map +0 -1
  694. package/utilities/graphql/directives.d.ts.map +0 -1
  695. package/utilities/graphql/fragments.d.ts.map +0 -1
  696. package/utilities/graphql/getFromAST.d.ts.map +0 -1
  697. package/utilities/graphql/operations.d.ts.map +0 -1
  698. package/utilities/graphql/print.d.ts.map +0 -1
  699. package/utilities/graphql/storeUtils.d.ts.map +0 -1
  700. package/utilities/graphql/transform.d.ts.map +0 -1
  701. package/utilities/index.d.ts.map +0 -1
  702. package/utilities/observables/Concast.d.ts.map +0 -1
  703. package/utilities/observables/Observable.d.ts.map +0 -1
  704. package/utilities/observables/asyncMap.d.ts.map +0 -1
  705. package/utilities/observables/iteration.d.ts.map +0 -1
  706. package/utilities/observables/subclassing.d.ts.map +0 -1
  707. package/utilities/policies/pagination.d.ts.map +0 -1
  708. package/utilities/promises/decoration.d.ts.map +0 -1
  709. package/utilities/subscriptions/relay/index.d.ts.map +0 -1
  710. package/utilities/subscriptions/shared.d.ts.map +0 -1
  711. package/utilities/subscriptions/urql/index.d.ts.map +0 -1
  712. package/utilities/types/DeepOmit.d.ts.map +0 -1
  713. package/utilities/types/DeepPartial.d.ts.map +0 -1
  714. package/utilities/types/IsStrictlyAny.d.ts.map +0 -1
  715. package/utilities/types/Primitive.d.ts.map +0 -1
  716. package/version.d.ts.map +0 -1
@@ -0,0 +1,8 @@
1
+ # Changesets
2
+
3
+ Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works
4
+ with multi-package repos, or single-package repos to help you version and publish your code. You can
5
+ find the full documentation for it [in our repository](https://github.com/changesets/changesets)
6
+
7
+ We have a quick list of common questions to get you started engaging with this project in
8
+ [our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md)
@@ -0,0 +1,5 @@
1
+ ---
2
+ "@apollo/client": patch
3
+ ---
4
+
5
+ Decouple `canonicalStringify` from `ObjectCanon` for better time and memory performance.
@@ -0,0 +1,38 @@
1
+ ---
2
+ "@apollo/client": patch
3
+ ---
4
+
5
+ Add a `defaultContext` option and property on `ApolloClient`, e.g. for keeping track of changing auth tokens or dependency injection.
6
+
7
+ This can be used e.g. in authentication scenarios, where a new token might be
8
+ generated outside of the link chain and should passed into the link chain.
9
+
10
+ ```js
11
+ import { ApolloClient, createHttpLink, InMemoryCache } from '@apollo/client';
12
+ import { setContext } from '@apollo/client/link/context';
13
+
14
+ const httpLink = createHttpLink({
15
+ uri: '/graphql',
16
+ });
17
+
18
+ const authLink = setContext((_, { headers, token }) => {
19
+ return {
20
+ headers: {
21
+ ...headers,
22
+ authorization: token ? `Bearer ${token}` : "",
23
+ }
24
+ }
25
+ });
26
+
27
+ const client = new ApolloClient({
28
+ link: authLink.concat(httpLink),
29
+ cache: new InMemoryCache()
30
+ });
31
+
32
+ // somewhere else in your application
33
+ function onNewToken(newToken) {
34
+ // token can now be changed for future requests without need for a global
35
+ // variable, scoped ref or recreating the client
36
+ client.defaultContext.token = newToken
37
+ }
38
+ ```
@@ -0,0 +1,5 @@
1
+ ---
2
+ "@apollo/client": patch
3
+ ---
4
+
5
+ Fix a potential memory leak in `FragmentRegistry.transform` and `FragmentRegistry.findFragmentSpreads` that would hold on to passed-in `DocumentNodes` for too long.
@@ -0,0 +1,8 @@
1
+ ---
2
+ "@apollo/client": patch
3
+ ---
4
+
5
+ `parse` function: improve memory management
6
+ * use LRU `WeakCache` instead of `Map` to keep a limited number of parsed results
7
+ * cache is initiated lazily, only when needed
8
+ * expose `parse.resetCache()` method
@@ -0,0 +1,14 @@
1
+ {
2
+ "$schema": "https://unpkg.com/@changesets/config@2.2.0/schema.json",
3
+ "changelog": [
4
+ "@changesets/changelog-github",
5
+ { "repo": "apollographql/apollo-client" }
6
+ ],
7
+ "commit": false,
8
+ "fixed": [],
9
+ "linked": [],
10
+ "access": "public",
11
+ "baseBranch": "main",
12
+ "updateInternalDependencies": "patch",
13
+ "ignore": []
14
+ }
@@ -0,0 +1,5 @@
1
+ ---
2
+ "@apollo/client": patch
3
+ ---
4
+
5
+ `documentTransform`: use `optimism` and `WeakCache` instead of directly storing data on the `Trie`
@@ -0,0 +1,5 @@
1
+ ---
2
+ "@apollo/client": patch
3
+ ---
4
+
5
+ Fixes a potential memory leak in `Concast` that might have been triggered when `Concast` was used outside of Apollo Client.
@@ -0,0 +1,7 @@
1
+ ---
2
+ "@apollo/client": minor
3
+ ---
4
+
5
+ To work around issues in React Server Components, especially with bundling for
6
+ the Next.js "edge" runtime we now use an external package to wrap `react` imports
7
+ instead of importing React directly.
@@ -0,0 +1,5 @@
1
+ ---
2
+ "@apollo/client": patch
3
+ ---
4
+
5
+ Add a `resetCache` method to `DocumentTransform` and hook `InMemoryCache.addTypenameTransform` up to `InMemoryCache.gc`
@@ -0,0 +1,5 @@
1
+ ---
2
+ "@apollo/client": patch
3
+ ---
4
+
5
+ `print`: use `WeakCache` instead of `WeakMap`
@@ -0,0 +1,29 @@
1
+ {
2
+ "mode": "pre",
3
+ "tag": "alpha",
4
+ "initialVersions": {
5
+ "@apollo/client": "3.8.3"
6
+ },
7
+ "changesets": [
8
+ "beige-geese-wink",
9
+ "breezy-spiders-tap",
10
+ "clean-items-smash",
11
+ "cold-llamas-turn",
12
+ "dirty-kids-crash",
13
+ "forty-cups-shop",
14
+ "friendly-clouds-laugh",
15
+ "hot-ducks-burn",
16
+ "polite-avocados-warn",
17
+ "quick-hats-marry",
18
+ "shaggy-ears-scream",
19
+ "shaggy-sheep-pull",
20
+ "sixty-boxes-rest",
21
+ "sour-sheep-walk",
22
+ "strong-terms-perform",
23
+ "thick-mice-collect",
24
+ "thirty-ties-arrive",
25
+ "violet-lions-draw",
26
+ "wild-dolphins-jog",
27
+ "yellow-flies-repeat"
28
+ ]
29
+ }
@@ -0,0 +1,5 @@
1
+ ---
2
+ "@apollo/client": patch
3
+ ---
4
+
5
+ ensure `defaultContext` is also used for mutations and subscriptions
@@ -0,0 +1,5 @@
1
+ ---
2
+ "@apollo/client": minor
3
+ ---
4
+
5
+ Prevent `QueryInfo#markResult` mutation of `result.data` and return cache data consistently whether complete or incomplete.
@@ -0,0 +1,5 @@
1
+ ---
2
+ "@apollo/client": patch
3
+ ---
4
+
5
+ `QueryManager.transformCache`: use `WeakCache` instead of `WeakMap`
@@ -0,0 +1,8 @@
1
+ ---
2
+ "@apollo/client": minor
3
+ ---
4
+
5
+ `QueryManager.inFlightLinkObservables` now uses a strong `Trie` as an internal data structure.
6
+
7
+ #### Warning: requires `@apollo/experimental-nextjs-app-support` update
8
+ If you are using `@apollo/experimental-nextjs-app-support`, you will need to update that to at least 0.5.2, as it accesses this internal data structure.
@@ -0,0 +1,7 @@
1
+ ---
2
+ "@apollo/client": minor
3
+ ---
4
+
5
+ Ability to dynamically match mocks
6
+
7
+ Adds support for a new property `MockedResponse.variableMatcher`: a predicate function that accepts a `variables` param. If `true`, the `variables` will be passed into the `ResultFunction` to help dynamically build a response.
@@ -0,0 +1,46 @@
1
+ ---
2
+ "@apollo/client": minor
3
+ ---
4
+
5
+ Add multipart subscription network adapters for Relay and urql
6
+
7
+ ### Relay
8
+
9
+ ```tsx
10
+ import { createFetchMultipartSubscription } from "@apollo/client/utilities/subscriptions/relay";
11
+ import { Environment, Network, RecordSource, Store } from "relay-runtime";
12
+
13
+ const fetchMultipartSubs = createFetchMultipartSubscription(
14
+ "http://localhost:4000"
15
+ );
16
+
17
+ const network = Network.create(fetchQuery, fetchMultipartSubs);
18
+
19
+ export const RelayEnvironment = new Environment({
20
+ network,
21
+ store: new Store(new RecordSource()),
22
+ });
23
+ ```
24
+
25
+ ### Urql
26
+
27
+ ```tsx
28
+ import { createFetchMultipartSubscription } from "@apollo/client/utilities/subscriptions/urql";
29
+ import { Client, fetchExchange, subscriptionExchange } from "@urql/core";
30
+
31
+ const url = "http://localhost:4000";
32
+
33
+ const multipartSubscriptionForwarder = createFetchMultipartSubscription(
34
+ url
35
+ );
36
+
37
+ const client = new Client({
38
+ url,
39
+ exchanges: [
40
+ fetchExchange,
41
+ subscriptionExchange({
42
+ forwardSubscription: multipartSubscriptionForwarder,
43
+ }),
44
+ ],
45
+ });
46
+ ```
@@ -0,0 +1,5 @@
1
+ ---
2
+ "@apollo/client": patch
3
+ ---
4
+
5
+ Clarify types of `EntityStore.makeCacheKey`.
@@ -0,0 +1,26 @@
1
+ ---
2
+ "@apollo/client": minor
3
+ ---
4
+
5
+ Introduces a new `useLoadableQuery` hook. This hook works similarly to `useBackgroundQuery` in that it returns a `queryRef` that can be used to suspend a component via the `useReadQuery` hook. It provides a more ergonomic way to load the query during a user interaction (for example when wanting to preload some data) that would otherwise be clunky with `useBackgroundQuery`.
6
+
7
+ ```tsx
8
+ function App() {
9
+ const [loadQuery, queryRef, { refetch, fetchMore, reset }] = useLoadableQuery(query, options)
10
+
11
+ return (
12
+ <>
13
+ <button onClick={() => loadQuery(variables)}>Load query</button>
14
+ <Suspense fallback={<SuspenseFallback />}>
15
+ {queryRef && <Child queryRef={queryRef} />}
16
+ </Suspense>
17
+ </>
18
+ );
19
+ }
20
+
21
+ function Child({ queryRef }) {
22
+ const { data } = useReadQuery(queryRef)
23
+
24
+ // ...
25
+ }
26
+ ```
@@ -0,0 +1,5 @@
1
+ ---
2
+ "@apollo/client": patch
3
+ ---
4
+
5
+ InMemoryCache.gc now also triggers FragmentRegistry.resetCaches (if there is a FragmentRegistry)
@@ -0,0 +1,5 @@
1
+ ---
2
+ "@apollo/client": patch
3
+ ---
4
+
5
+ Add `reset` method to `print`, hook up to `InMemoryCache.gc`
@@ -0,0 +1,5 @@
1
+ ---
2
+ "@apollo/client": minor
3
+ ---
4
+
5
+ Support re-using of mocks in the MockedProvider