@apollo/client 4.0.0-alpha.0 → 4.0.0-alpha.10

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 (935) hide show
  1. package/.changeset/afraid-moons-arrive.md +5 -0
  2. package/.changeset/beige-mirrors-talk.md +15 -0
  3. package/.changeset/clean-sheep-hide.md +6 -0
  4. package/.changeset/cool-bikes-shake.md +12 -0
  5. package/.changeset/cool-kiwis-hunt.md +15 -0
  6. package/.changeset/cuddly-spiders-tie.md +5 -0
  7. package/.changeset/dirty-eagles-poke.md +5 -0
  8. package/.changeset/early-eggs-develop.md +22 -0
  9. package/.changeset/eighty-squids-fix.md +15 -0
  10. package/.changeset/eleven-kangaroos-jump.md +5 -0
  11. package/.changeset/forty-shrimps-fry.md +5 -0
  12. package/.changeset/forty-tomatoes-punch.md +5 -0
  13. package/.changeset/four-countries-clean.md +24 -0
  14. package/.changeset/four-ghosts-watch.md +5 -0
  15. package/.changeset/funny-jeans-invent.md +16 -0
  16. package/.changeset/funny-terms-deny.md +5 -0
  17. package/.changeset/fuzzy-tips-sit.md +5 -0
  18. package/.changeset/gentle-badgers-train.md +5 -0
  19. package/.changeset/giant-apes-thank.md +5 -0
  20. package/.changeset/giant-bags-share.md +5 -0
  21. package/.changeset/gorgeous-chefs-tap.md +5 -0
  22. package/.changeset/great-roses-jog.md +15 -0
  23. package/.changeset/grumpy-vans-type.md +5 -0
  24. package/.changeset/hip-vans-act.md +5 -0
  25. package/.changeset/hungry-bikes-cough.md +5 -0
  26. package/.changeset/itchy-chefs-run.md +23 -0
  27. package/.changeset/khaki-keys-deliver.md +5 -0
  28. package/.changeset/khaki-spies-work.md +11 -0
  29. package/.changeset/large-plants-know.md +5 -0
  30. package/.changeset/light-apes-rescue.md +5 -0
  31. package/.changeset/little-spoons-kick.md +7 -0
  32. package/.changeset/loud-cows-raise.md +7 -0
  33. package/.changeset/many-buses-allow.md +5 -0
  34. package/.changeset/mean-lizards-think.md +5 -0
  35. package/.changeset/nervous-fireants-bow.md +5 -0
  36. package/.changeset/nervous-goats-allow.md +5 -0
  37. package/.changeset/nice-dots-matter.md +5 -0
  38. package/.changeset/ninety-bags-bake.md +17 -0
  39. package/.changeset/odd-chicken-hide.md +17 -0
  40. package/.changeset/odd-lemons-relax.md +5 -0
  41. package/.changeset/perfect-vans-give.md +7 -0
  42. package/.changeset/poor-eels-punch.md +5 -0
  43. package/.changeset/pre.json +67 -0
  44. package/.changeset/purple-bears-flash.md +5 -0
  45. package/.changeset/rare-houses-prove.md +5 -0
  46. package/.changeset/real-teachers-peel.md +5 -0
  47. package/.changeset/serious-moons-juggle.md +5 -0
  48. package/.changeset/seven-dragons-repair.md +14 -0
  49. package/.changeset/shaggy-pugs-add.md +52 -0
  50. package/.changeset/short-months-complain.md +5 -0
  51. package/.changeset/slimy-chicken-melt.md +5 -0
  52. package/.changeset/slimy-maps-press.md +5 -0
  53. package/.changeset/small-buttons-rhyme.md +5 -0
  54. package/.changeset/swift-rivers-share.md +13 -0
  55. package/.changeset/tall-bikes-develop.md +5 -0
  56. package/.changeset/tame-doors-shop.md +14 -0
  57. package/.changeset/tame-points-work.md +11 -0
  58. package/.changeset/tender-swans-flash.md +16 -0
  59. package/.changeset/thick-books-grin.md +5 -0
  60. package/.changeset/thin-peas-hear.md +16 -0
  61. package/.changeset/tidy-pandas-punch.md +5 -0
  62. package/.changeset/tough-rockets-allow.md +5 -0
  63. package/.changeset/tricky-tables-shave.md +5 -0
  64. package/.changeset/unlucky-kiwis-sell.md +5 -0
  65. package/.changeset/warm-ties-sit.md +7 -0
  66. package/.changeset/wicked-forks-double.md +33 -0
  67. package/.changeset/young-phones-fold.md +5 -0
  68. package/.changeset/young-snails-grin.md +5 -0
  69. package/CHANGELOG.md +507 -0
  70. package/__cjs/cache/core/cache.cjs +3 -3
  71. package/__cjs/cache/core/cache.cjs.map +1 -1
  72. package/__cjs/cache/core/cache.d.cts +19 -19
  73. package/__cjs/cache/core/types/Cache.cjs.map +1 -1
  74. package/__cjs/cache/core/types/Cache.d.cts +9 -16
  75. package/__cjs/cache/core/types/DataProxy.d.cts +8 -23
  76. package/__cjs/cache/core/types/common.cjs +1 -0
  77. package/__cjs/cache/core/types/common.cjs.map +1 -1
  78. package/__cjs/cache/index.cjs +4 -4
  79. package/__cjs/cache/index.cjs.map +1 -1
  80. package/__cjs/cache/index.d.cts +3 -3
  81. package/__cjs/cache/inmemory/entityStore.cjs +6 -5
  82. package/__cjs/cache/inmemory/entityStore.cjs.map +1 -1
  83. package/__cjs/cache/inmemory/entityStore.d.cts +3 -2
  84. package/__cjs/cache/inmemory/fragmentRegistry.cjs +3 -3
  85. package/__cjs/cache/inmemory/fragmentRegistry.cjs.map +1 -1
  86. package/__cjs/cache/inmemory/helpers.cjs +0 -8
  87. package/__cjs/cache/inmemory/helpers.cjs.map +1 -1
  88. package/__cjs/cache/inmemory/helpers.d.cts +3 -4
  89. package/__cjs/cache/inmemory/inMemoryCache.cjs +6 -18
  90. package/__cjs/cache/inmemory/inMemoryCache.cjs.map +1 -1
  91. package/__cjs/cache/inmemory/inMemoryCache.d.cts +9 -11
  92. package/__cjs/cache/inmemory/policies.cjs +5 -5
  93. package/__cjs/cache/inmemory/policies.cjs.map +1 -1
  94. package/__cjs/cache/inmemory/policies.d.cts +1 -1
  95. package/__cjs/cache/inmemory/reactiveVars.cjs.map +1 -1
  96. package/__cjs/cache/inmemory/reactiveVars.d.cts +7 -7
  97. package/__cjs/cache/inmemory/readFromStore.cjs +12 -54
  98. package/__cjs/cache/inmemory/readFromStore.cjs.map +1 -1
  99. package/__cjs/cache/inmemory/readFromStore.d.cts +1 -6
  100. package/__cjs/cache/inmemory/types.d.cts +3 -17
  101. package/__cjs/cache/inmemory/writeToStore.cjs +4 -4
  102. package/__cjs/cache/inmemory/writeToStore.cjs.map +1 -1
  103. package/__cjs/cache/inmemory/writeToStore.d.cts +2 -2
  104. package/__cjs/config/jest/areCombinedGraphQLErrorsEqual.cjs +6 -4
  105. package/__cjs/config/jest/areCombinedGraphQLErrorsEqual.cjs.map +1 -1
  106. package/__cjs/config/jest/areCombinedProtocolErrorsEqual.cjs +3 -3
  107. package/__cjs/config/jest/areCombinedProtocolErrorsEqual.cjs.map +1 -1
  108. package/__cjs/config/jest/areMissingFieldErrorsEqual.cjs +2 -3
  109. package/__cjs/config/jest/areMissingFieldErrorsEqual.cjs.map +1 -1
  110. package/__cjs/config/jest/areServerErrorsEqual.cjs +22 -0
  111. package/__cjs/config/jest/areServerErrorsEqual.cjs.map +1 -0
  112. package/__cjs/config/jest/areServerErrorsEqual.d.cts +3 -0
  113. package/__cjs/config/jest/resolver.cjs +11 -0
  114. package/__cjs/config/jest/resolver.cjs.map +1 -1
  115. package/__cjs/config/jest/setup.cjs +18 -1
  116. package/__cjs/config/jest/setup.cjs.map +1 -1
  117. package/__cjs/core/ApolloClient.cjs +36 -19
  118. package/__cjs/core/ApolloClient.cjs.map +1 -1
  119. package/__cjs/core/ApolloClient.d.cts +36 -26
  120. package/__cjs/core/LocalState.cjs +2 -2
  121. package/__cjs/core/LocalState.cjs.map +1 -1
  122. package/__cjs/core/LocalState.d.cts +8 -8
  123. package/__cjs/core/ObservableQuery.cjs +268 -104
  124. package/__cjs/core/ObservableQuery.cjs.map +1 -1
  125. package/__cjs/core/ObservableQuery.d.cts +156 -17
  126. package/__cjs/core/QueryInfo.cjs +12 -86
  127. package/__cjs/core/QueryInfo.cjs.map +1 -1
  128. package/__cjs/core/QueryInfo.d.cts +2 -11
  129. package/__cjs/core/QueryManager.cjs +148 -104
  130. package/__cjs/core/QueryManager.cjs.map +1 -1
  131. package/__cjs/core/QueryManager.d.cts +45 -24
  132. package/__cjs/core/index.cjs +42 -21
  133. package/__cjs/core/index.cjs.map +1 -1
  134. package/__cjs/core/index.d.cts +12 -11
  135. package/__cjs/core/types.d.cts +60 -7
  136. package/__cjs/core/watchQueryOptions.d.cts +32 -119
  137. package/__cjs/errors/CombinedGraphQLErrors.cjs +30 -11
  138. package/__cjs/errors/CombinedGraphQLErrors.cjs.map +1 -1
  139. package/__cjs/errors/CombinedGraphQLErrors.d.cts +21 -2
  140. package/__cjs/errors/CombinedProtocolErrors.cjs +13 -6
  141. package/__cjs/errors/CombinedProtocolErrors.cjs.map +1 -1
  142. package/__cjs/errors/CombinedProtocolErrors.d.cts +9 -0
  143. package/__cjs/errors/LinkError.cjs +20 -0
  144. package/__cjs/errors/LinkError.cjs.map +1 -0
  145. package/__cjs/errors/LinkError.d.cts +14 -0
  146. package/__cjs/errors/ServerError.cjs +6 -0
  147. package/__cjs/errors/ServerError.cjs.map +1 -1
  148. package/__cjs/errors/ServerError.d.cts +2 -0
  149. package/__cjs/errors/ServerParseError.cjs +6 -0
  150. package/__cjs/errors/ServerParseError.cjs.map +1 -1
  151. package/__cjs/errors/ServerParseError.d.cts +2 -0
  152. package/__cjs/errors/UnconventionalError.cjs +6 -0
  153. package/__cjs/errors/UnconventionalError.cjs.map +1 -1
  154. package/__cjs/errors/UnconventionalError.d.cts +2 -0
  155. package/__cjs/errors/index.cjs +19 -4
  156. package/__cjs/errors/index.cjs.map +1 -1
  157. package/__cjs/errors/index.d.cts +2 -3
  158. package/__cjs/errors/isErrorLike.cjs +12 -0
  159. package/__cjs/errors/isErrorLike.cjs.map +1 -0
  160. package/__cjs/errors/isErrorLike.d.cts +3 -0
  161. package/__cjs/errors/utils.cjs +18 -0
  162. package/__cjs/errors/utils.cjs.map +1 -0
  163. package/__cjs/errors/utils.d.cts +3 -0
  164. package/__cjs/invariantErrorCodes.cjs +121 -122
  165. package/__cjs/link/batch/batching.cjs.map +1 -1
  166. package/__cjs/link/batch/index.cjs +4 -2
  167. package/__cjs/link/batch/index.cjs.map +1 -1
  168. package/__cjs/link/batch/index.d.cts +2 -1
  169. package/__cjs/link/batch-http/index.cjs +3 -2
  170. package/__cjs/link/batch-http/index.cjs.map +1 -1
  171. package/__cjs/link/batch-http/index.d.cts +1 -1
  172. package/__cjs/link/context/index.cjs.map +1 -1
  173. package/__cjs/link/context/index.d.cts +1 -1
  174. package/__cjs/link/core/ApolloLink.cjs +2 -20
  175. package/__cjs/link/core/ApolloLink.cjs.map +1 -1
  176. package/__cjs/link/core/ApolloLink.d.cts +1 -3
  177. package/__cjs/link/core/index.cjs.map +1 -1
  178. package/__cjs/link/core/index.d.cts +1 -1
  179. package/__cjs/link/core/types.d.cts +1 -1
  180. package/__cjs/link/error/index.cjs +13 -28
  181. package/__cjs/link/error/index.cjs.map +1 -1
  182. package/__cjs/link/error/index.d.cts +4 -15
  183. package/__cjs/link/http/checkFetcher.cjs +1 -1
  184. package/__cjs/link/http/createHttpLink.cjs +1 -1
  185. package/__cjs/link/http/createHttpLink.d.cts +2 -1
  186. package/__cjs/link/http/parseAndCheckHttpResponse.cjs +4 -3
  187. package/__cjs/link/http/parseAndCheckHttpResponse.cjs.map +1 -1
  188. package/__cjs/link/http/serializeFetchParameter.cjs +1 -1
  189. package/__cjs/link/persisted-queries/index.cjs +3 -3
  190. package/__cjs/link/persisted-queries/index.cjs.map +1 -1
  191. package/__cjs/link/persisted-queries/index.d.cts +14 -3
  192. package/__cjs/link/remove-typename/removeTypenameFromVariables.cjs +1 -1
  193. package/__cjs/link/remove-typename/removeTypenameFromVariables.cjs.map +1 -1
  194. package/__cjs/link/remove-typename/removeTypenameFromVariables.d.cts +10 -1
  195. package/__cjs/link/retry/index.cjs +3 -2
  196. package/__cjs/link/retry/index.cjs.map +1 -1
  197. package/__cjs/link/retry/index.d.cts +1 -1
  198. package/__cjs/link/subscriptions/index.cjs +3 -1
  199. package/__cjs/link/subscriptions/index.cjs.map +1 -1
  200. package/__cjs/link/utils/validateOperation.cjs +1 -1
  201. package/__cjs/masking/maskDefinition.cjs +2 -2
  202. package/__cjs/masking/maskDefinition.cjs.map +1 -1
  203. package/__cjs/masking/maskDefinition.d.cts +1 -1
  204. package/__cjs/masking/maskFragment.cjs +2 -2
  205. package/__cjs/masking/maskFragment.cjs.map +1 -1
  206. package/__cjs/masking/maskFragment.d.cts +2 -2
  207. package/__cjs/masking/maskOperation.cjs +1 -1
  208. package/__cjs/masking/maskOperation.cjs.map +1 -1
  209. package/__cjs/masking/maskOperation.d.cts +2 -2
  210. package/__cjs/masking/utils.cjs +1 -1
  211. package/__cjs/react/context/ApolloConsumer.cjs +2 -2
  212. package/__cjs/react/context/ApolloConsumer.cjs.map +1 -1
  213. package/__cjs/react/context/ApolloConsumer.d.cts +7 -4
  214. package/__cjs/react/context/ApolloContext.cjs +2 -2
  215. package/__cjs/react/context/ApolloContext.cjs.map +1 -1
  216. package/__cjs/react/context/ApolloContext.d.cts +4 -4
  217. package/__cjs/react/context/ApolloProvider.cjs +2 -2
  218. package/__cjs/react/context/ApolloProvider.cjs.map +1 -1
  219. package/__cjs/react/context/ApolloProvider.d.cts +7 -5
  220. package/__cjs/react/hooks/internal/__use.cjs +1 -1
  221. package/__cjs/react/hooks/internal/__use.cjs.map +1 -1
  222. package/__cjs/react/hooks/internal/__use.d.cts +3 -1
  223. package/__cjs/react/hooks/internal/useDeepMemo.cjs +3 -1
  224. package/__cjs/react/hooks/internal/useDeepMemo.cjs.map +1 -1
  225. package/__cjs/react/hooks/internal/useIsomorphicLayoutEffect.cjs +1 -1
  226. package/__cjs/react/hooks/internal/useIsomorphicLayoutEffect.cjs.map +1 -1
  227. package/__cjs/react/hooks/internal/useIsomorphicLayoutEffect.d.cts +2 -2
  228. package/__cjs/react/hooks/internal/useRenderGuard.cjs +1 -1
  229. package/__cjs/react/hooks/internal/useRenderGuard.cjs.map +1 -1
  230. package/__cjs/react/hooks/internal/validateSuspenseHookOptions.cjs +28 -0
  231. package/__cjs/react/hooks/internal/validateSuspenseHookOptions.cjs.map +1 -0
  232. package/__cjs/react/hooks/internal/validateSuspenseHookOptions.d.cts +3 -0
  233. package/__cjs/react/hooks/internal/wrapHook.cjs +26 -5
  234. package/__cjs/react/hooks/internal/wrapHook.cjs.map +1 -1
  235. package/__cjs/react/hooks/internal/wrapHook.d.cts +7 -5
  236. package/__cjs/react/hooks/useApolloClient.cjs +3 -3
  237. package/__cjs/react/hooks/useApolloClient.cjs.map +1 -1
  238. package/__cjs/react/hooks/useApolloClient.d.cts +2 -2
  239. package/__cjs/react/hooks/useBackgroundQuery.cjs +3 -3
  240. package/__cjs/react/hooks/useBackgroundQuery.cjs.map +1 -1
  241. package/__cjs/react/hooks/useBackgroundQuery.d.cts +143 -46
  242. package/__cjs/react/hooks/useFragment.cjs +1 -1
  243. package/__cjs/react/hooks/useFragment.cjs.map +1 -1
  244. package/__cjs/react/hooks/useFragment.d.cts +51 -26
  245. package/__cjs/react/hooks/useLazyQuery.cjs +33 -32
  246. package/__cjs/react/hooks/useLazyQuery.cjs.map +1 -1
  247. package/__cjs/react/hooks/useLazyQuery.d.cts +278 -276
  248. package/__cjs/react/hooks/useLoadableQuery.cjs +22 -3
  249. package/__cjs/react/hooks/useLoadableQuery.cjs.map +1 -1
  250. package/__cjs/react/hooks/useLoadableQuery.d.cts +106 -34
  251. package/__cjs/react/hooks/useMutation.cjs +15 -23
  252. package/__cjs/react/hooks/useMutation.cjs.map +1 -1
  253. package/__cjs/react/hooks/useMutation.d.cts +198 -4
  254. package/__cjs/react/hooks/useQuery.cjs +88 -207
  255. package/__cjs/react/hooks/useQuery.cjs.map +1 -1
  256. package/__cjs/react/hooks/useQuery.d.cts +274 -4
  257. package/__cjs/react/hooks/useQueryRefHandlers.cjs +1 -1
  258. package/__cjs/react/hooks/useQueryRefHandlers.cjs.map +1 -1
  259. package/__cjs/react/hooks/useQueryRefHandlers.d.cts +23 -22
  260. package/__cjs/react/hooks/useReactiveVar.cjs +1 -1
  261. package/__cjs/react/hooks/useReactiveVar.cjs.map +1 -1
  262. package/__cjs/react/hooks/useReactiveVar.d.cts +1 -1
  263. package/__cjs/react/hooks/useReadQuery.cjs +1 -1
  264. package/__cjs/react/hooks/useReadQuery.cjs.map +1 -1
  265. package/__cjs/react/hooks/useReadQuery.d.cts +27 -25
  266. package/__cjs/react/hooks/useSubscription.cjs +10 -60
  267. package/__cjs/react/hooks/useSubscription.cjs.map +1 -1
  268. package/__cjs/react/hooks/useSubscription.d.cts +94 -3
  269. package/__cjs/react/hooks/useSuspenseFragment.cjs +1 -1
  270. package/__cjs/react/hooks/useSuspenseFragment.cjs.map +1 -1
  271. package/__cjs/react/hooks/useSuspenseFragment.d.cts +40 -38
  272. package/__cjs/react/hooks/useSuspenseQuery.cjs +8 -33
  273. package/__cjs/react/hooks/useSuspenseQuery.cjs.map +1 -1
  274. package/__cjs/react/hooks/useSuspenseQuery.d.cts +199 -38
  275. package/__cjs/react/hooks/useSyncExternalStore.cjs +2 -2
  276. package/__cjs/react/hooks/useSyncExternalStore.cjs.map +1 -1
  277. package/__cjs/react/index.cjs +35 -11
  278. package/__cjs/react/index.cjs.map +1 -1
  279. package/__cjs/react/index.d.cts +21 -6
  280. package/__cjs/react/index.react-server.cjs +48 -0
  281. package/__cjs/react/index.react-server.cjs.map +1 -0
  282. package/__cjs/react/index.react-server.d.cts +19 -0
  283. package/__cjs/react/internal/cache/FragmentReference.cjs.map +1 -1
  284. package/__cjs/react/internal/cache/FragmentReference.d.cts +3 -3
  285. package/__cjs/react/internal/cache/QueryReference.cjs +3 -14
  286. package/__cjs/react/internal/cache/QueryReference.cjs.map +1 -1
  287. package/__cjs/react/internal/cache/QueryReference.d.cts +7 -7
  288. package/__cjs/react/internal/cache/SuspenseCache.cjs.map +1 -1
  289. package/__cjs/react/internal/cache/SuspenseCache.d.cts +3 -3
  290. package/__cjs/react/internal/cache/getSuspenseCache.cjs.map +1 -1
  291. package/__cjs/react/internal/cache/getSuspenseCache.d.cts +4 -4
  292. package/__cjs/react/internal/index.cjs +3 -1
  293. package/__cjs/react/internal/index.cjs.map +1 -1
  294. package/__cjs/react/internal/index.d.cts +2 -0
  295. package/__cjs/react/internal/types.d.cts +9 -0
  296. package/__cjs/react/query-preloader/createQueryPreloader.cjs +1 -0
  297. package/__cjs/react/query-preloader/createQueryPreloader.cjs.map +1 -1
  298. package/__cjs/react/query-preloader/createQueryPreloader.d.cts +6 -45
  299. package/__cjs/react/ssr/getDataFromTree.cjs +24 -30
  300. package/__cjs/react/ssr/getDataFromTree.cjs.map +1 -1
  301. package/__cjs/react/ssr/getDataFromTree.d.cts +12 -1
  302. package/__cjs/react/ssr/index.cjs +3 -3
  303. package/__cjs/react/ssr/index.cjs.map +1 -1
  304. package/__cjs/react/ssr/index.d.cts +1 -1
  305. package/__cjs/react/ssr/prerenderStatic.cjs +151 -0
  306. package/__cjs/react/ssr/prerenderStatic.cjs.map +1 -0
  307. package/__cjs/react/ssr/prerenderStatic.d.cts +122 -0
  308. package/__cjs/react/ssr/renderToStringWithData.cjs +11 -5
  309. package/__cjs/react/ssr/renderToStringWithData.cjs.map +1 -1
  310. package/__cjs/react/ssr/renderToStringWithData.d.cts +5 -0
  311. package/__cjs/react/ssr/useSSRQuery.cjs +60 -0
  312. package/__cjs/react/ssr/useSSRQuery.cjs.map +1 -0
  313. package/__cjs/react/ssr/useSSRQuery.d.cts +5 -0
  314. package/__cjs/{utilities/types/TODO.cjs → react/types/deprecated.cjs} +1 -1
  315. package/__cjs/react/types/deprecated.cjs.map +1 -0
  316. package/__cjs/react/types/deprecated.d.cts +75 -0
  317. package/__cjs/react/types/types.documentation.d.cts +6 -34
  318. package/__cjs/testing/core/index.cjs +6 -3
  319. package/__cjs/testing/core/index.cjs.map +1 -1
  320. package/__cjs/testing/core/index.d.cts +3 -3
  321. package/__cjs/testing/core/mocking/mockClient.cjs +3 -4
  322. package/__cjs/testing/core/mocking/mockClient.cjs.map +1 -1
  323. package/__cjs/testing/core/mocking/mockClient.d.cts +2 -3
  324. package/__cjs/testing/core/mocking/mockLink.cjs +118 -112
  325. package/__cjs/testing/core/mocking/mockLink.cjs.map +1 -1
  326. package/__cjs/testing/core/mocking/mockLink.d.cts +26 -7
  327. package/__cjs/testing/experimental/createSchemaFetch.cjs +4 -4
  328. package/__cjs/testing/experimental/createSchemaFetch.cjs.map +1 -1
  329. package/__cjs/testing/experimental/createTestSchema.cjs.map +1 -1
  330. package/__cjs/testing/experimental/createTestSchema.d.cts +1 -1
  331. package/__cjs/testing/index.cjs +13 -2
  332. package/__cjs/testing/index.cjs.map +1 -1
  333. package/__cjs/testing/index.d.cts +2 -1
  334. package/__cjs/testing/internal/disposables/spyOnConsole.cjs +0 -1
  335. package/__cjs/testing/internal/disposables/spyOnConsole.cjs.map +1 -1
  336. package/__cjs/testing/internal/disposables/spyOnConsole.d.cts +0 -1
  337. package/__cjs/testing/internal/disposables/withProdMode.d.cts +1 -1
  338. package/__cjs/testing/internal/incremental.cjs.map +1 -1
  339. package/__cjs/testing/internal/incremental.d.cts +4 -3
  340. package/__cjs/testing/internal/index.cjs +14 -8
  341. package/__cjs/testing/internal/index.cjs.map +1 -1
  342. package/__cjs/testing/internal/index.d.cts +4 -3
  343. package/__cjs/testing/internal/renderHelpers.cjs.map +1 -1
  344. package/__cjs/testing/internal/renderHelpers.d.cts +3 -3
  345. package/__cjs/testing/internal/resetApolloContext.cjs +24 -0
  346. package/__cjs/testing/internal/resetApolloContext.cjs.map +1 -0
  347. package/__cjs/testing/internal/resetApolloContext.d.cts +10 -0
  348. package/__cjs/testing/internal/scenarios/index.cjs +9 -7
  349. package/__cjs/testing/internal/scenarios/index.cjs.map +1 -1
  350. package/__cjs/testing/internal/scenarios/index.d.cts +14 -5
  351. package/__cjs/testing/matchers/arrayWithLength.cjs +15 -0
  352. package/__cjs/testing/matchers/arrayWithLength.cjs.map +1 -0
  353. package/__cjs/testing/matchers/arrayWithLength.d.cts +3 -0
  354. package/__cjs/testing/matchers/index.cjs +6 -18
  355. package/__cjs/testing/matchers/index.cjs.map +1 -1
  356. package/__cjs/testing/matchers/toComplete.cjs.map +1 -1
  357. package/__cjs/testing/matchers/toEmitAnything.cjs.map +1 -1
  358. package/__cjs/testing/matchers/toEmitError.cjs.map +1 -1
  359. package/__cjs/testing/matchers/toEmitNext.cjs.map +1 -1
  360. package/__cjs/testing/matchers/{toEmitFetchResult.cjs → toEmitTypedValue.cjs} +9 -7
  361. package/__cjs/testing/matchers/toEmitTypedValue.cjs.map +1 -0
  362. package/__cjs/testing/matchers/{toEmitValueStrict.d.cts → toEmitTypedValue.d.cts} +2 -2
  363. package/__cjs/testing/matchers/toHaveSuspenseCacheEntryUsing.cjs +2 -2
  364. package/__cjs/testing/matchers/toHaveSuspenseCacheEntryUsing.cjs.map +1 -1
  365. package/__cjs/testing/matchers/toHaveSuspenseCacheEntryUsing.d.cts +1 -1
  366. package/__cjs/testing/matchers/toMatchDocument.cjs.map +1 -1
  367. package/__cjs/testing/matchers/toMatchDocument.d.cts +1 -1
  368. package/__cjs/testing/matchers/toStrictEqualTyped.cjs +26 -0
  369. package/__cjs/testing/matchers/toStrictEqualTyped.cjs.map +1 -0
  370. package/__cjs/testing/matchers/toStrictEqualTyped.d.cts +3 -0
  371. package/__cjs/testing/matchers/utils/getSerializableProperties.cjs +23 -0
  372. package/__cjs/testing/matchers/utils/getSerializableProperties.cjs.map +1 -0
  373. package/__cjs/testing/matchers/utils/getSerializableProperties.d.cts +2 -0
  374. package/__cjs/testing/react/MockedProvider.cjs +11 -7
  375. package/__cjs/testing/react/MockedProvider.cjs.map +1 -1
  376. package/__cjs/testing/react/MockedProvider.d.cts +8 -6
  377. package/__cjs/utilities/caching/sizes.cjs +2 -2
  378. package/__cjs/utilities/caching/sizes.cjs.map +1 -1
  379. package/__cjs/utilities/caching/sizes.d.cts +2 -20
  380. package/__cjs/utilities/common/canonicalStringify.cjs +2 -2
  381. package/__cjs/utilities/common/canonicalStringify.cjs.map +1 -1
  382. package/__cjs/utilities/common/errorHandling.d.cts +1 -1
  383. package/__cjs/utilities/common/maybeDeepFreeze.cjs +1 -0
  384. package/__cjs/utilities/common/maybeDeepFreeze.cjs.map +1 -1
  385. package/__cjs/utilities/common/maybeDeepFreeze.d.cts +1 -0
  386. package/__cjs/utilities/common/mergeOptions.cjs.map +1 -1
  387. package/__cjs/utilities/common/mergeOptions.d.cts +1 -1
  388. package/__cjs/utilities/graphql/getFromAST.cjs +15 -6
  389. package/__cjs/utilities/graphql/getFromAST.cjs.map +1 -1
  390. package/__cjs/utilities/graphql/getFromAST.d.cts +2 -2
  391. package/__cjs/utilities/graphql/operations.cjs.map +1 -1
  392. package/__cjs/utilities/graphql/operations.d.cts +1 -1
  393. package/__cjs/utilities/graphql/print.cjs +2 -2
  394. package/__cjs/utilities/graphql/print.cjs.map +1 -1
  395. package/__cjs/utilities/graphql/storeUtils.cjs +1 -1
  396. package/__cjs/utilities/graphql/transform.cjs +2 -2
  397. package/__cjs/utilities/index.cjs +39 -19
  398. package/__cjs/utilities/index.cjs.map +1 -1
  399. package/__cjs/utilities/index.d.cts +16 -15
  400. package/__cjs/utilities/{caching → internal}/getMemoryInternals.cjs +1 -3
  401. package/__cjs/utilities/internal/getMemoryInternals.cjs.map +1 -0
  402. package/__cjs/utilities/{caching → internal}/getMemoryInternals.d.cts +1 -2
  403. package/__cjs/utilities/internal/index.cjs +8 -1
  404. package/__cjs/utilities/internal/index.cjs.map +1 -1
  405. package/__cjs/utilities/internal/index.d.cts +2 -0
  406. package/__cjs/utilities/internal/index.production.cjs +11 -0
  407. package/__cjs/utilities/internal/index.production.cjs.map +1 -0
  408. package/__cjs/utilities/internal/index.production.d.cts +3 -0
  409. package/__cjs/utilities/internal/toQueryResult.cjs +13 -0
  410. package/__cjs/utilities/internal/toQueryResult.cjs.map +1 -0
  411. package/__cjs/utilities/internal/toQueryResult.d.cts +3 -0
  412. package/__cjs/utilities/invariant/index.development.cjs +1 -0
  413. package/__cjs/utilities/invariant/index.development.cjs.map +1 -1
  414. package/__cjs/utilities/subscriptions/relay/index.cjs +2 -2
  415. package/__cjs/utilities/subscriptions/relay/index.cjs.map +1 -1
  416. package/__cjs/utilities/subscriptions/relay/index.d.cts +1 -1
  417. package/__cjs/utilities/types/NoInfer.d.cts +1 -1
  418. package/__cjs/utilities/types/{OnlyRequiredProperties.cjs → VariablesOption.cjs} +1 -1
  419. package/__cjs/utilities/types/VariablesOption.cjs.map +1 -0
  420. package/__cjs/utilities/types/VariablesOption.d.cts +25 -0
  421. package/__cjs/version.cjs +1 -1
  422. package/__cjs/version.cjs.map +1 -1
  423. package/__cjs/version.d.cts +1 -1
  424. package/cache/core/cache.d.ts +19 -19
  425. package/cache/core/cache.js +1 -1
  426. package/cache/core/cache.js.map +1 -1
  427. package/cache/core/types/Cache.d.ts +9 -16
  428. package/cache/core/types/Cache.js.map +1 -1
  429. package/cache/core/types/DataProxy.d.ts +8 -23
  430. package/cache/core/types/common.js +1 -0
  431. package/cache/core/types/common.js.map +1 -1
  432. package/cache/index.d.ts +3 -3
  433. package/cache/index.js +1 -1
  434. package/cache/index.js.map +1 -1
  435. package/cache/inmemory/entityStore.d.ts +3 -2
  436. package/cache/inmemory/entityStore.js +6 -5
  437. package/cache/inmemory/entityStore.js.map +1 -1
  438. package/cache/inmemory/fragmentRegistry.js +1 -1
  439. package/cache/inmemory/fragmentRegistry.js.map +1 -1
  440. package/cache/inmemory/helpers.d.ts +0 -1
  441. package/cache/inmemory/helpers.js +0 -7
  442. package/cache/inmemory/helpers.js.map +1 -1
  443. package/cache/inmemory/inMemoryCache.d.ts +9 -11
  444. package/cache/inmemory/inMemoryCache.js +5 -17
  445. package/cache/inmemory/inMemoryCache.js.map +1 -1
  446. package/cache/inmemory/policies.d.ts +1 -1
  447. package/cache/inmemory/policies.js +5 -5
  448. package/cache/inmemory/policies.js.map +1 -1
  449. package/cache/inmemory/reactiveVars.d.ts +7 -7
  450. package/cache/inmemory/reactiveVars.js.map +1 -1
  451. package/cache/inmemory/readFromStore.d.ts +1 -6
  452. package/cache/inmemory/readFromStore.js +12 -54
  453. package/cache/inmemory/readFromStore.js.map +1 -1
  454. package/cache/inmemory/types.d.ts +3 -17
  455. package/cache/inmemory/writeToStore.d.ts +2 -2
  456. package/cache/inmemory/writeToStore.js +4 -4
  457. package/cache/inmemory/writeToStore.js.map +1 -1
  458. package/config/jest/areCombinedGraphQLErrorsEqual.js +6 -4
  459. package/config/jest/areCombinedGraphQLErrorsEqual.js.map +1 -1
  460. package/config/jest/areCombinedProtocolErrorsEqual.js +3 -3
  461. package/config/jest/areCombinedProtocolErrorsEqual.js.map +1 -1
  462. package/config/jest/areMissingFieldErrorsEqual.js +2 -3
  463. package/config/jest/areMissingFieldErrorsEqual.js.map +1 -1
  464. package/config/jest/areServerErrorsEqual.d.ts +3 -0
  465. package/config/jest/areServerErrorsEqual.js +18 -0
  466. package/config/jest/areServerErrorsEqual.js.map +1 -0
  467. package/config/jest/resolver.js +12 -1
  468. package/config/jest/resolver.js.map +1 -1
  469. package/config/jest/setup.js +19 -2
  470. package/config/jest/setup.js.map +1 -1
  471. package/core/ApolloClient.d.ts +36 -26
  472. package/core/ApolloClient.js +36 -19
  473. package/core/ApolloClient.js.map +1 -1
  474. package/core/LocalState.d.ts +6 -6
  475. package/core/LocalState.js +2 -2
  476. package/core/LocalState.js.map +1 -1
  477. package/core/ObservableQuery.d.ts +156 -17
  478. package/core/ObservableQuery.js +267 -102
  479. package/core/ObservableQuery.js.map +1 -1
  480. package/core/QueryInfo.d.ts +2 -11
  481. package/core/QueryInfo.js +12 -86
  482. package/core/QueryInfo.js.map +1 -1
  483. package/core/QueryManager.d.ts +32 -21
  484. package/core/QueryManager.js +151 -107
  485. package/core/QueryManager.js.map +1 -1
  486. package/core/index.d.ts +12 -11
  487. package/core/index.js +9 -6
  488. package/core/index.js.map +1 -1
  489. package/core/types.d.ts +60 -7
  490. package/core/watchQueryOptions.d.ts +32 -119
  491. package/errors/CombinedGraphQLErrors.d.ts +21 -2
  492. package/errors/CombinedGraphQLErrors.js +30 -11
  493. package/errors/CombinedGraphQLErrors.js.map +1 -1
  494. package/errors/CombinedProtocolErrors.d.ts +9 -0
  495. package/errors/CombinedProtocolErrors.js +13 -6
  496. package/errors/CombinedProtocolErrors.js.map +1 -1
  497. package/errors/LinkError.d.ts +14 -0
  498. package/errors/LinkError.js +16 -0
  499. package/errors/LinkError.js.map +1 -0
  500. package/errors/ServerError.d.ts +2 -0
  501. package/errors/ServerError.js +6 -0
  502. package/errors/ServerError.js.map +1 -1
  503. package/errors/ServerParseError.d.ts +2 -0
  504. package/errors/ServerParseError.js +6 -0
  505. package/errors/ServerParseError.js.map +1 -1
  506. package/errors/UnconventionalError.d.ts +2 -0
  507. package/errors/UnconventionalError.js +6 -0
  508. package/errors/UnconventionalError.js.map +1 -1
  509. package/errors/index.d.ts +2 -3
  510. package/errors/index.js +13 -1
  511. package/errors/index.js.map +1 -1
  512. package/errors/isErrorLike.d.ts +3 -0
  513. package/errors/isErrorLike.js +9 -0
  514. package/errors/isErrorLike.js.map +1 -0
  515. package/errors/utils.d.ts +3 -0
  516. package/errors/utils.js +14 -0
  517. package/errors/utils.js.map +1 -0
  518. package/invariantErrorCodes.js +121 -122
  519. package/legacyEntryPoints/testing/internal/index.d.ts +1 -0
  520. package/legacyEntryPoints/testing/internal/index.js +1 -0
  521. package/legacyEntryPoints/testing/internal/internal.cjs +1 -0
  522. package/legacyEntryPoints/testing/internal/internal.d.cts +1 -0
  523. package/link/batch/batching.js +1 -1
  524. package/link/batch/batching.js.map +1 -1
  525. package/link/batch/index.d.ts +2 -1
  526. package/link/batch/index.js +1 -1
  527. package/link/batch/index.js.map +1 -1
  528. package/link/batch-http/index.d.ts +1 -1
  529. package/link/batch-http/index.js +1 -1
  530. package/link/batch-http/index.js.map +1 -1
  531. package/link/context/index.d.ts +1 -1
  532. package/link/context/index.js.map +1 -1
  533. package/link/core/ApolloLink.d.ts +1 -3
  534. package/link/core/ApolloLink.js +2 -20
  535. package/link/core/ApolloLink.js.map +1 -1
  536. package/link/core/index.d.ts +1 -1
  537. package/link/core/index.js.map +1 -1
  538. package/link/core/types.d.ts +1 -1
  539. package/link/error/index.d.ts +4 -15
  540. package/link/error/index.js +14 -29
  541. package/link/error/index.js.map +1 -1
  542. package/link/http/checkFetcher.js +1 -1
  543. package/link/http/createHttpLink.js +1 -1
  544. package/link/http/parseAndCheckHttpResponse.js +4 -3
  545. package/link/http/parseAndCheckHttpResponse.js.map +1 -1
  546. package/link/http/serializeFetchParameter.js +1 -1
  547. package/link/persisted-queries/index.d.ts +2 -2
  548. package/link/persisted-queries/index.js +3 -3
  549. package/link/persisted-queries/index.js.map +1 -1
  550. package/link/remove-typename/removeTypenameFromVariables.js.map +1 -1
  551. package/link/retry/index.d.ts +1 -1
  552. package/link/retry/index.js +1 -1
  553. package/link/retry/index.js.map +1 -1
  554. package/link/subscriptions/index.js +3 -1
  555. package/link/subscriptions/index.js.map +1 -1
  556. package/link/utils/validateOperation.js +1 -1
  557. package/masking/maskDefinition.d.ts +1 -1
  558. package/masking/maskDefinition.js +2 -2
  559. package/masking/maskDefinition.js.map +1 -1
  560. package/masking/maskFragment.d.ts +2 -2
  561. package/masking/maskFragment.js +2 -2
  562. package/masking/maskFragment.js.map +1 -1
  563. package/masking/maskOperation.d.ts +2 -2
  564. package/masking/maskOperation.js +1 -1
  565. package/masking/maskOperation.js.map +1 -1
  566. package/masking/utils.js +1 -1
  567. package/package.json +58 -56
  568. package/react/context/ApolloConsumer.d.ts +7 -4
  569. package/react/context/ApolloConsumer.js +2 -2
  570. package/react/context/ApolloConsumer.js.map +1 -1
  571. package/react/context/ApolloContext.d.ts +4 -4
  572. package/react/context/ApolloContext.js +2 -2
  573. package/react/context/ApolloContext.js.map +1 -1
  574. package/react/context/ApolloProvider.d.ts +7 -5
  575. package/react/context/ApolloProvider.js +2 -2
  576. package/react/context/ApolloProvider.js.map +1 -1
  577. package/react/hooks/internal/__use.js +1 -1
  578. package/react/hooks/internal/__use.js.map +1 -1
  579. package/react/hooks/internal/useDeepMemo.js +3 -1
  580. package/react/hooks/internal/useDeepMemo.js.map +1 -1
  581. package/react/hooks/internal/useIsomorphicLayoutEffect.d.ts +1 -1
  582. package/react/hooks/internal/useIsomorphicLayoutEffect.js +1 -1
  583. package/react/hooks/internal/useIsomorphicLayoutEffect.js.map +1 -1
  584. package/react/hooks/internal/useRenderGuard.js +1 -1
  585. package/react/hooks/internal/useRenderGuard.js.map +1 -1
  586. package/react/hooks/internal/validateSuspenseHookOptions.d.ts +3 -0
  587. package/react/hooks/internal/validateSuspenseHookOptions.js +22 -0
  588. package/react/hooks/internal/validateSuspenseHookOptions.js.map +1 -0
  589. package/react/hooks/internal/wrapHook.d.ts +7 -5
  590. package/react/hooks/internal/wrapHook.js +24 -5
  591. package/react/hooks/internal/wrapHook.js.map +1 -1
  592. package/react/hooks/useApolloClient.d.ts +2 -2
  593. package/react/hooks/useApolloClient.js +2 -2
  594. package/react/hooks/useApolloClient.js.map +1 -1
  595. package/react/hooks/useBackgroundQuery.d.ts +143 -46
  596. package/react/hooks/useBackgroundQuery.js +3 -3
  597. package/react/hooks/useBackgroundQuery.js.map +1 -1
  598. package/react/hooks/useFragment.d.ts +51 -26
  599. package/react/hooks/useFragment.js +1 -1
  600. package/react/hooks/useFragment.js.map +1 -1
  601. package/react/hooks/useLazyQuery.d.ts +278 -276
  602. package/react/hooks/useLazyQuery.js +32 -31
  603. package/react/hooks/useLazyQuery.js.map +1 -1
  604. package/react/hooks/useLoadableQuery.d.ts +106 -34
  605. package/react/hooks/useLoadableQuery.js +22 -3
  606. package/react/hooks/useLoadableQuery.js.map +1 -1
  607. package/react/hooks/useMutation.d.ts +198 -4
  608. package/react/hooks/useMutation.js +15 -23
  609. package/react/hooks/useMutation.js.map +1 -1
  610. package/react/hooks/useQuery.d.ts +274 -4
  611. package/react/hooks/useQuery.js +87 -206
  612. package/react/hooks/useQuery.js.map +1 -1
  613. package/react/hooks/useQueryRefHandlers.d.ts +23 -22
  614. package/react/hooks/useQueryRefHandlers.js +1 -1
  615. package/react/hooks/useQueryRefHandlers.js.map +1 -1
  616. package/react/hooks/useReactiveVar.d.ts +1 -1
  617. package/react/hooks/useReactiveVar.js +1 -1
  618. package/react/hooks/useReactiveVar.js.map +1 -1
  619. package/react/hooks/useReadQuery.d.ts +27 -25
  620. package/react/hooks/useReadQuery.js +1 -1
  621. package/react/hooks/useReadQuery.js.map +1 -1
  622. package/react/hooks/useSubscription.d.ts +94 -9
  623. package/react/hooks/useSubscription.js +9 -56
  624. package/react/hooks/useSubscription.js.map +1 -1
  625. package/react/hooks/useSuspenseFragment.d.ts +40 -38
  626. package/react/hooks/useSuspenseFragment.js +1 -1
  627. package/react/hooks/useSuspenseFragment.js.map +1 -1
  628. package/react/hooks/useSuspenseQuery.d.ts +199 -38
  629. package/react/hooks/useSuspenseQuery.js +6 -27
  630. package/react/hooks/useSuspenseQuery.js.map +1 -1
  631. package/react/hooks/useSyncExternalStore.js +2 -2
  632. package/react/hooks/useSyncExternalStore.js.map +1 -1
  633. package/react/index.d.ts +21 -6
  634. package/react/index.js +17 -3
  635. package/react/index.js.map +1 -1
  636. package/react/index.react-server.d.ts +19 -0
  637. package/react/index.react-server.js +45 -0
  638. package/react/index.react-server.js.map +1 -0
  639. package/react/internal/cache/FragmentReference.d.ts +3 -3
  640. package/react/internal/cache/FragmentReference.js.map +1 -1
  641. package/react/internal/cache/QueryReference.d.ts +5 -5
  642. package/react/internal/cache/QueryReference.js +3 -14
  643. package/react/internal/cache/QueryReference.js.map +1 -1
  644. package/react/internal/cache/SuspenseCache.d.ts +3 -3
  645. package/react/internal/cache/SuspenseCache.js.map +1 -1
  646. package/react/internal/cache/getSuspenseCache.d.ts +3 -3
  647. package/react/internal/cache/getSuspenseCache.js.map +1 -1
  648. package/react/internal/index.d.ts +2 -0
  649. package/react/internal/index.js +2 -1
  650. package/react/internal/index.js.map +1 -1
  651. package/react/internal/types.d.ts +9 -0
  652. package/react/query-preloader/createQueryPreloader.d.ts +6 -45
  653. package/react/query-preloader/createQueryPreloader.js +1 -0
  654. package/react/query-preloader/createQueryPreloader.js.map +1 -1
  655. package/react/ssr/getDataFromTree.d.ts +12 -1
  656. package/react/ssr/getDataFromTree.js +24 -29
  657. package/react/ssr/getDataFromTree.js.map +1 -1
  658. package/react/ssr/index.d.ts +1 -1
  659. package/react/ssr/index.js +1 -1
  660. package/react/ssr/index.js.map +1 -1
  661. package/react/ssr/prerenderStatic.d.ts +122 -0
  662. package/react/ssr/prerenderStatic.js +147 -0
  663. package/react/ssr/prerenderStatic.js.map +1 -0
  664. package/react/ssr/renderToStringWithData.d.ts +5 -0
  665. package/react/ssr/renderToStringWithData.js +11 -5
  666. package/react/ssr/renderToStringWithData.js.map +1 -1
  667. package/react/ssr/useSSRQuery.d.ts +5 -0
  668. package/react/ssr/useSSRQuery.js +56 -0
  669. package/react/ssr/useSSRQuery.js.map +1 -0
  670. package/react/types/deprecated.d.ts +75 -0
  671. package/react/types/deprecated.js +2 -0
  672. package/react/types/deprecated.js.map +1 -0
  673. package/react/types/types.documentation.d.ts +6 -34
  674. package/testing/core/index.d.ts +3 -3
  675. package/testing/core/index.js +2 -2
  676. package/testing/core/index.js.map +1 -1
  677. package/testing/core/mocking/mockClient.d.ts +2 -3
  678. package/testing/core/mocking/mockClient.js +2 -3
  679. package/testing/core/mocking/mockClient.js.map +1 -1
  680. package/testing/core/mocking/mockLink.d.ts +26 -7
  681. package/testing/core/mocking/mockLink.js +117 -113
  682. package/testing/core/mocking/mockLink.js.map +1 -1
  683. package/testing/experimental/createSchemaFetch.js +2 -2
  684. package/testing/experimental/createSchemaFetch.js.map +1 -1
  685. package/testing/experimental/createTestSchema.d.ts +1 -1
  686. package/testing/experimental/createTestSchema.js.map +1 -1
  687. package/testing/index.d.ts +2 -1
  688. package/testing/index.js +1 -1
  689. package/testing/index.js.map +1 -1
  690. package/testing/internal/disposables/spyOnConsole.d.ts +0 -1
  691. package/testing/internal/disposables/spyOnConsole.js +0 -1
  692. package/testing/internal/disposables/spyOnConsole.js.map +1 -1
  693. package/testing/internal/incremental.d.ts +1 -1
  694. package/testing/internal/incremental.js.map +1 -1
  695. package/testing/internal/index.d.ts +4 -3
  696. package/testing/internal/index.js +4 -3
  697. package/testing/internal/index.js.map +1 -1
  698. package/testing/internal/renderHelpers.d.ts +3 -3
  699. package/testing/internal/renderHelpers.js.map +1 -1
  700. package/testing/internal/resetApolloContext.d.ts +10 -0
  701. package/testing/internal/resetApolloContext.js +20 -0
  702. package/testing/internal/resetApolloContext.js.map +1 -0
  703. package/testing/internal/scenarios/index.d.ts +6 -8
  704. package/testing/internal/scenarios/index.js +4 -2
  705. package/testing/internal/scenarios/index.js.map +1 -1
  706. package/testing/matchers/arrayWithLength.d.ts +3 -0
  707. package/testing/matchers/arrayWithLength.js +11 -0
  708. package/testing/matchers/arrayWithLength.js.map +1 -0
  709. package/testing/matchers/index.js +6 -18
  710. package/testing/matchers/index.js.map +1 -1
  711. package/testing/matchers/toComplete.js.map +1 -1
  712. package/testing/matchers/toEmitAnything.js.map +1 -1
  713. package/testing/matchers/toEmitError.js.map +1 -1
  714. package/testing/matchers/toEmitNext.js.map +1 -1
  715. package/testing/matchers/{toEmitValueStrict.d.ts → toEmitTypedValue.d.ts} +2 -2
  716. package/testing/matchers/{toEmitFetchResult.js → toEmitTypedValue.js} +7 -5
  717. package/testing/matchers/toEmitTypedValue.js.map +1 -0
  718. package/testing/matchers/toHaveSuspenseCacheEntryUsing.d.ts +1 -1
  719. package/testing/matchers/toHaveSuspenseCacheEntryUsing.js +1 -1
  720. package/testing/matchers/toHaveSuspenseCacheEntryUsing.js.map +1 -1
  721. package/testing/matchers/toMatchDocument.d.ts +1 -1
  722. package/testing/matchers/toMatchDocument.js.map +1 -1
  723. package/testing/matchers/toStrictEqualTyped.d.ts +3 -0
  724. package/testing/matchers/toStrictEqualTyped.js +22 -0
  725. package/testing/matchers/toStrictEqualTyped.js.map +1 -0
  726. package/testing/matchers/utils/getSerializableProperties.d.ts +2 -0
  727. package/testing/matchers/utils/getSerializableProperties.js +20 -0
  728. package/testing/matchers/utils/getSerializableProperties.js.map +1 -0
  729. package/testing/react/MockedProvider.d.ts +8 -6
  730. package/testing/react/MockedProvider.js +8 -4
  731. package/testing/react/MockedProvider.js.map +1 -1
  732. package/utilities/caching/sizes.d.ts +2 -20
  733. package/utilities/caching/sizes.js +2 -2
  734. package/utilities/caching/sizes.js.map +1 -1
  735. package/utilities/common/canonicalStringify.js +1 -1
  736. package/utilities/common/canonicalStringify.js.map +1 -1
  737. package/utilities/common/maybeDeepFreeze.d.ts +1 -0
  738. package/utilities/common/maybeDeepFreeze.js +1 -0
  739. package/utilities/common/maybeDeepFreeze.js.map +1 -1
  740. package/utilities/common/mergeOptions.d.ts +1 -1
  741. package/utilities/common/mergeOptions.js.map +1 -1
  742. package/utilities/graphql/getFromAST.d.ts +2 -2
  743. package/utilities/graphql/getFromAST.js +15 -6
  744. package/utilities/graphql/getFromAST.js.map +1 -1
  745. package/utilities/graphql/operations.d.ts +1 -1
  746. package/utilities/graphql/operations.js.map +1 -1
  747. package/utilities/graphql/print.js +1 -1
  748. package/utilities/graphql/print.js.map +1 -1
  749. package/utilities/graphql/storeUtils.js +1 -1
  750. package/utilities/graphql/transform.js +2 -2
  751. package/utilities/index.d.ts +16 -15
  752. package/utilities/index.js +12 -12
  753. package/utilities/index.js.map +1 -1
  754. package/utilities/{caching → internal}/getMemoryInternals.d.ts +0 -1
  755. package/utilities/{caching → internal}/getMemoryInternals.js +1 -3
  756. package/utilities/internal/getMemoryInternals.js.map +1 -0
  757. package/utilities/internal/index.d.ts +2 -0
  758. package/utilities/internal/index.js +2 -0
  759. package/utilities/internal/index.js.map +1 -1
  760. package/utilities/internal/index.production.d.ts +3 -0
  761. package/utilities/internal/index.production.js +7 -0
  762. package/utilities/internal/index.production.js.map +1 -0
  763. package/utilities/internal/toQueryResult.d.ts +3 -0
  764. package/utilities/internal/toQueryResult.js +10 -0
  765. package/utilities/internal/toQueryResult.js.map +1 -0
  766. package/utilities/invariant/index.development.js +1 -0
  767. package/utilities/invariant/index.development.js.map +1 -1
  768. package/utilities/subscriptions/relay/index.d.ts +1 -1
  769. package/utilities/subscriptions/relay/index.js +1 -1
  770. package/utilities/subscriptions/relay/index.js.map +1 -1
  771. package/utilities/types/NoInfer.d.ts +1 -1
  772. package/utilities/types/VariablesOption.d.ts +25 -0
  773. package/utilities/types/VariablesOption.js +2 -0
  774. package/utilities/types/VariablesOption.js.map +1 -0
  775. package/version.d.ts +1 -1
  776. package/version.js +1 -1
  777. package/version.js.map +1 -1
  778. package/__cjs/cache/inmemory/fixPolyfills.cjs +0 -10
  779. package/__cjs/cache/inmemory/fixPolyfills.cjs.map +0 -1
  780. package/__cjs/cache/inmemory/fixPolyfills.d.cts +0 -2
  781. package/__cjs/cache/inmemory/fixPolyfills.native.cjs +0 -53
  782. package/__cjs/cache/inmemory/fixPolyfills.native.cjs.map +0 -1
  783. package/__cjs/cache/inmemory/fixPolyfills.native.d.cts +0 -2
  784. package/__cjs/cache/inmemory/object-canon.cjs +0 -180
  785. package/__cjs/cache/inmemory/object-canon.cjs.map +0 -1
  786. package/__cjs/cache/inmemory/object-canon.d.cts +0 -12
  787. package/__cjs/index.cjs +0 -8
  788. package/__cjs/index.cjs.map +0 -1
  789. package/__cjs/index.d.cts +0 -3
  790. package/__cjs/link/http/iterators/async.cjs +0 -19
  791. package/__cjs/link/http/iterators/async.cjs.map +0 -1
  792. package/__cjs/link/http/iterators/async.d.cts +0 -6
  793. package/__cjs/link/http/iterators/nodeStream.cjs +0 -75
  794. package/__cjs/link/http/iterators/nodeStream.cjs.map +0 -1
  795. package/__cjs/link/http/iterators/nodeStream.d.cts +0 -7
  796. package/__cjs/link/http/iterators/promise.cjs +0 -32
  797. package/__cjs/link/http/iterators/promise.cjs.map +0 -1
  798. package/__cjs/link/http/iterators/promise.d.cts +0 -6
  799. package/__cjs/link/http/iterators/reader.cjs +0 -19
  800. package/__cjs/link/http/iterators/reader.cjs.map +0 -1
  801. package/__cjs/link/http/iterators/reader.d.cts +0 -6
  802. package/__cjs/link/http/responseIterator.cjs +0 -50
  803. package/__cjs/link/http/responseIterator.cjs.map +0 -1
  804. package/__cjs/link/http/responseIterator.d.cts +0 -7
  805. package/__cjs/react/context/index.cjs +0 -10
  806. package/__cjs/react/context/index.cjs.map +0 -1
  807. package/__cjs/react/context/index.d.cts +0 -7
  808. package/__cjs/react/hooks/index.cjs +0 -27
  809. package/__cjs/react/hooks/index.cjs.map +0 -1
  810. package/__cjs/react/hooks/index.d.cts +0 -22
  811. package/__cjs/react/parser/index.cjs +0 -115
  812. package/__cjs/react/parser/index.cjs.map +0 -1
  813. package/__cjs/react/parser/index.d.cts +0 -18
  814. package/__cjs/react/ssr/RenderPromises.cjs +0 -104
  815. package/__cjs/react/ssr/RenderPromises.cjs.map +0 -1
  816. package/__cjs/react/ssr/RenderPromises.d.cts +0 -22
  817. package/__cjs/react/types/types.d.cts +0 -689
  818. package/__cjs/testing/matchers/toEmitApolloQueryResult.cjs +0 -40
  819. package/__cjs/testing/matchers/toEmitApolloQueryResult.cjs.map +0 -1
  820. package/__cjs/testing/matchers/toEmitApolloQueryResult.d.cts +0 -8
  821. package/__cjs/testing/matchers/toEmitFetchResult.cjs.map +0 -1
  822. package/__cjs/testing/matchers/toEmitFetchResult.d.cts +0 -8
  823. package/__cjs/testing/matchers/toEmitMatchedValue.cjs +0 -40
  824. package/__cjs/testing/matchers/toEmitMatchedValue.cjs.map +0 -1
  825. package/__cjs/testing/matchers/toEmitMatchedValue.d.cts +0 -7
  826. package/__cjs/testing/matchers/toEmitValue.cjs +0 -41
  827. package/__cjs/testing/matchers/toEmitValue.cjs.map +0 -1
  828. package/__cjs/testing/matchers/toEmitValue.d.cts +0 -4
  829. package/__cjs/testing/matchers/toEmitValueStrict.cjs +0 -46
  830. package/__cjs/testing/matchers/toEmitValueStrict.cjs.map +0 -1
  831. package/__cjs/testing/matchers/toEqualApolloQueryResult.cjs +0 -24
  832. package/__cjs/testing/matchers/toEqualApolloQueryResult.cjs.map +0 -1
  833. package/__cjs/testing/matchers/toEqualApolloQueryResult.d.cts +0 -6
  834. package/__cjs/testing/matchers/toEqualFetchResult.cjs +0 -24
  835. package/__cjs/testing/matchers/toEqualFetchResult.cjs.map +0 -1
  836. package/__cjs/testing/matchers/toEqualFetchResult.d.cts +0 -4
  837. package/__cjs/testing/matchers/toEqualLazyQueryResult.cjs +0 -40
  838. package/__cjs/testing/matchers/toEqualLazyQueryResult.cjs.map +0 -1
  839. package/__cjs/testing/matchers/toEqualLazyQueryResult.d.cts +0 -10
  840. package/__cjs/testing/matchers/toEqualQueryResult.cjs +0 -40
  841. package/__cjs/testing/matchers/toEqualQueryResult.cjs.map +0 -1
  842. package/__cjs/testing/matchers/toEqualQueryResult.d.cts +0 -9
  843. package/__cjs/utilities/caching/getMemoryInternals.cjs.map +0 -1
  844. package/__cjs/utilities/types/OnlyRequiredProperties.cjs.map +0 -1
  845. package/__cjs/utilities/types/OnlyRequiredProperties.d.cts +0 -7
  846. package/__cjs/utilities/types/TODO.cjs.map +0 -1
  847. package/__cjs/utilities/types/TODO.d.cts +0 -3
  848. package/cache/inmemory/fixPolyfills.d.ts +0 -2
  849. package/cache/inmemory/fixPolyfills.js +0 -10
  850. package/cache/inmemory/fixPolyfills.js.map +0 -1
  851. package/cache/inmemory/fixPolyfills.native.d.ts +0 -2
  852. package/cache/inmemory/fixPolyfills.native.js +0 -53
  853. package/cache/inmemory/fixPolyfills.native.js.map +0 -1
  854. package/cache/inmemory/object-canon.d.ts +0 -12
  855. package/cache/inmemory/object-canon.js +0 -176
  856. package/cache/inmemory/object-canon.js.map +0 -1
  857. package/index.d.ts +0 -3
  858. package/index.js +0 -3
  859. package/index.js.map +0 -1
  860. package/legacyEntryPoints/react/context/context.cjs +0 -1
  861. package/legacyEntryPoints/react/context/context.d.cts +0 -1
  862. package/legacyEntryPoints/react/context/index.d.ts +0 -1
  863. package/legacyEntryPoints/react/context/index.js +0 -1
  864. package/legacyEntryPoints/react/hooks/hooks.cjs +0 -1
  865. package/legacyEntryPoints/react/hooks/hooks.d.cts +0 -1
  866. package/legacyEntryPoints/react/hooks/index.d.ts +0 -1
  867. package/legacyEntryPoints/react/hooks/index.js +0 -1
  868. package/legacyEntryPoints/react/parser/index.d.ts +0 -1
  869. package/legacyEntryPoints/react/parser/index.js +0 -1
  870. package/legacyEntryPoints/react/parser/parser.cjs +0 -1
  871. package/legacyEntryPoints/react/parser/parser.d.cts +0 -1
  872. package/link/http/iterators/async.d.ts +0 -6
  873. package/link/http/iterators/async.js +0 -16
  874. package/link/http/iterators/async.js.map +0 -1
  875. package/link/http/iterators/nodeStream.d.ts +0 -7
  876. package/link/http/iterators/nodeStream.js +0 -72
  877. package/link/http/iterators/nodeStream.js.map +0 -1
  878. package/link/http/iterators/promise.d.ts +0 -6
  879. package/link/http/iterators/promise.js +0 -29
  880. package/link/http/iterators/promise.js.map +0 -1
  881. package/link/http/iterators/reader.d.ts +0 -6
  882. package/link/http/iterators/reader.js +0 -16
  883. package/link/http/iterators/reader.js.map +0 -1
  884. package/link/http/responseIterator.d.ts +0 -7
  885. package/link/http/responseIterator.js +0 -46
  886. package/link/http/responseIterator.js.map +0 -1
  887. package/react/context/index.d.ts +0 -7
  888. package/react/context/index.js +0 -4
  889. package/react/context/index.js.map +0 -1
  890. package/react/hooks/index.d.ts +0 -22
  891. package/react/hooks/index.js +0 -15
  892. package/react/hooks/index.js.map +0 -1
  893. package/react/parser/index.d.ts +0 -18
  894. package/react/parser/index.js +0 -109
  895. package/react/parser/index.js.map +0 -1
  896. package/react/ssr/RenderPromises.d.ts +0 -22
  897. package/react/ssr/RenderPromises.js +0 -100
  898. package/react/ssr/RenderPromises.js.map +0 -1
  899. package/react/types/types.d.ts +0 -689
  900. package/testing/matchers/toEmitApolloQueryResult.d.ts +0 -8
  901. package/testing/matchers/toEmitApolloQueryResult.js +0 -36
  902. package/testing/matchers/toEmitApolloQueryResult.js.map +0 -1
  903. package/testing/matchers/toEmitFetchResult.d.ts +0 -8
  904. package/testing/matchers/toEmitFetchResult.js.map +0 -1
  905. package/testing/matchers/toEmitMatchedValue.d.ts +0 -7
  906. package/testing/matchers/toEmitMatchedValue.js +0 -36
  907. package/testing/matchers/toEmitMatchedValue.js.map +0 -1
  908. package/testing/matchers/toEmitValue.d.ts +0 -4
  909. package/testing/matchers/toEmitValue.js +0 -37
  910. package/testing/matchers/toEmitValue.js.map +0 -1
  911. package/testing/matchers/toEmitValueStrict.js +0 -42
  912. package/testing/matchers/toEmitValueStrict.js.map +0 -1
  913. package/testing/matchers/toEqualApolloQueryResult.d.ts +0 -6
  914. package/testing/matchers/toEqualApolloQueryResult.js +0 -20
  915. package/testing/matchers/toEqualApolloQueryResult.js.map +0 -1
  916. package/testing/matchers/toEqualFetchResult.d.ts +0 -4
  917. package/testing/matchers/toEqualFetchResult.js +0 -20
  918. package/testing/matchers/toEqualFetchResult.js.map +0 -1
  919. package/testing/matchers/toEqualLazyQueryResult.d.ts +0 -10
  920. package/testing/matchers/toEqualLazyQueryResult.js +0 -36
  921. package/testing/matchers/toEqualLazyQueryResult.js.map +0 -1
  922. package/testing/matchers/toEqualQueryResult.d.ts +0 -9
  923. package/testing/matchers/toEqualQueryResult.js +0 -36
  924. package/testing/matchers/toEqualQueryResult.js.map +0 -1
  925. package/utilities/caching/getMemoryInternals.js.map +0 -1
  926. package/utilities/types/OnlyRequiredProperties.d.ts +0 -7
  927. package/utilities/types/OnlyRequiredProperties.js +0 -2
  928. package/utilities/types/OnlyRequiredProperties.js.map +0 -1
  929. package/utilities/types/TODO.d.ts +0 -3
  930. package/utilities/types/TODO.js +0 -2
  931. package/utilities/types/TODO.js.map +0 -1
  932. /package/__cjs/react/{types → internal}/types.cjs +0 -0
  933. /package/__cjs/react/{types → internal}/types.cjs.map +0 -0
  934. /package/react/{types → internal}/types.js +0 -0
  935. /package/react/{types → internal}/types.js.map +0 -0
package/CHANGELOG.md CHANGED
@@ -1,5 +1,492 @@
1
1
  # @apollo/client
2
2
 
3
+ ## 4.0.0-alpha.10
4
+
5
+ ### Major Changes
6
+
7
+ - [#12559](https://github.com/apollographql/apollo-client/pull/12559) [`49ace0e`](https://github.com/apollographql/apollo-client/commit/49ace0e2119b7fd5997dcf051002ebd4ba2e0bc4) Thanks [@jerelmiller](https://github.com/jerelmiller)! - `ObservableQuery.variables` can now be reset back to empty when calling `reobserve` with `variables: undefined`. Previously the `variables` key would be ignored so `variables` would remain unchanged.
8
+
9
+ - [#12559](https://github.com/apollographql/apollo-client/pull/12559) [`49ace0e`](https://github.com/apollographql/apollo-client/commit/49ace0e2119b7fd5997dcf051002ebd4ba2e0bc4) Thanks [@jerelmiller](https://github.com/jerelmiller)! - `never` is no longer supported as a valid `TVariables` generic argument for APIs that require `variables` as part of its type. Use `Record<string, never>` instead.
10
+
11
+ - [#12559](https://github.com/apollographql/apollo-client/pull/12559) [`49ace0e`](https://github.com/apollographql/apollo-client/commit/49ace0e2119b7fd5997dcf051002ebd4ba2e0bc4) Thanks [@jerelmiller](https://github.com/jerelmiller)! - When passing a `variables` key with the value `undefined`, the value will be replaced by the default value in the query, if it is provided, rather than leave it as `undefined`.
12
+
13
+ ```ts
14
+ // given this query
15
+ const query = gql`
16
+ query PaginatedQuery($limit: Int! = 10, $offset: Int) {
17
+ list(limit: $limit, offset: $offset) {
18
+ id
19
+ }
20
+ }
21
+ `;
22
+
23
+ const observable = client.query({
24
+ query,
25
+ variables: { limit: 5, offset: 0 },
26
+ });
27
+ console.log(observable.variables); // => { limit: 5, offset: 0 }
28
+
29
+ observable.reobserve({ variables: { limit: undefined, offset: 10 } });
30
+ // limit is now `10`. This would previously be `undefined`
31
+ console.log(observable.variables); // => { limit: 10, offset: 10 }
32
+ ```
33
+
34
+ - [#12562](https://github.com/apollographql/apollo-client/pull/12562) [`90bf0e6`](https://github.com/apollographql/apollo-client/commit/90bf0e61516a382182f212ac8ab891099e2eb009) Thanks [@jerelmiller](https://github.com/jerelmiller)! - `client.query` no longer supports a `fetchPolicy` of `standby`. `standby` does not fetch and did not return `data`. `standby` is meant for watched queries where fetching should be on hold.
35
+
36
+ ### Minor Changes
37
+
38
+ - [#12557](https://github.com/apollographql/apollo-client/pull/12557) [`51d26ae`](https://github.com/apollographql/apollo-client/commit/51d26ae631c6631a189c98ea9357b18e77a9a876) Thanks [@jerelmiller](https://github.com/jerelmiller)! - Add ability to specify message formatter for `CombinedGraphQLErrors` and `CombinedProtocolErrors`. To provide your own message formatter, override the static `formatMessage` property on these classes.
39
+
40
+ ```ts
41
+ CombinedGraphQLErrors.formatMessage = (
42
+ errors,
43
+ { result, defaultFormatMessage }
44
+ ) => {
45
+ return "Some formatted message";
46
+ };
47
+
48
+ CombinedProtocolErrors.formatMessage = (errors, { defaultFormatMessage }) => {
49
+ return "Some formatted message";
50
+ };
51
+ ```
52
+
53
+ - [#12546](https://github.com/apollographql/apollo-client/pull/12546) [`5dffbbe`](https://github.com/apollographql/apollo-client/commit/5dffbbe407eb1d9adbcb0fff89f2d3a75dc1ad2b) Thanks [@jerelmiller](https://github.com/jerelmiller)! - Add a static `is` method to error types defined by Apollo Client. `is` makes it simpler to determine whether an error is a specific type, which can be helpful in cases where you'd like to narrow the error type in order to use specific properties from that error.
54
+
55
+ This change applies to the following error types:
56
+
57
+ - `CombinedGraphQLErrors`
58
+ - `CombinedProtocolErrors`
59
+ - `ServerError`
60
+ - `ServerParseError`
61
+ - `UnconventionalError`
62
+
63
+ **Example**
64
+
65
+ ```ts
66
+ import { CombinedGraphQLErrors } from "@apollo/client";
67
+
68
+ if (CombinedGraphQLErrors.is(error)) {
69
+ console.log(error.message);
70
+ error.errors.forEach((graphQLError) => console.log(graphQLError.message));
71
+ }
72
+ ```
73
+
74
+ - [#12561](https://github.com/apollographql/apollo-client/pull/12561) [`99d72bf`](https://github.com/apollographql/apollo-client/commit/99d72bfdb38e3d9679f60b9acb065a84e3b42fd6) Thanks [@jerelmiller](https://github.com/jerelmiller)! - Add the ability to detect if an error was an error was emitted from the link chain. This is useful if your application throws custom errors in other areas of the application and you'd like to differentiate them from errors emitted by the link chain itself.
75
+
76
+ To detect if an error was emitted from the link chain, use `LinkError.is`.
77
+
78
+ ```ts
79
+ import { LinkError } from "@apollo/client";
80
+
81
+ client.query({ query }).catch((error) => {
82
+ if (LinkError.is(error)) {
83
+ // This error originated from the link chain
84
+ }
85
+ });
86
+ ```
87
+
88
+ ### Patch Changes
89
+
90
+ - [#12559](https://github.com/apollographql/apollo-client/pull/12559) [`49ace0e`](https://github.com/apollographql/apollo-client/commit/49ace0e2119b7fd5997dcf051002ebd4ba2e0bc4) Thanks [@jerelmiller](https://github.com/jerelmiller)! - The `variables` option used with various APIs are now enforced more consistently across the client when `TVariables` contains required variables. If required `variables` are not provided, TypeScript will now complain that it requires a `variables` option.
91
+
92
+ This change affects the following APIs:
93
+
94
+ - `client.query`
95
+ - `client.mutate`
96
+ - `client.subscribe`
97
+ - `client.watchQuery`
98
+ - `useBackgroundQuery`
99
+ - `useQuery`
100
+ - `useSubscription`
101
+ - `useSuspenseQuery`
102
+
103
+ - [#12559](https://github.com/apollographql/apollo-client/pull/12559) [`49ace0e`](https://github.com/apollographql/apollo-client/commit/49ace0e2119b7fd5997dcf051002ebd4ba2e0bc4) Thanks [@jerelmiller](https://github.com/jerelmiller)! - Fix type of `variables` returned from `useLazyQuery`. When `called` is `false`, `variables` is now `Partial<TVariables>` instead of `TVariables`.
104
+
105
+ - [#12562](https://github.com/apollographql/apollo-client/pull/12562) [`90bf0e6`](https://github.com/apollographql/apollo-client/commit/90bf0e61516a382182f212ac8ab891099e2eb009) Thanks [@jerelmiller](https://github.com/jerelmiller)! - `client.query` no longer supports `notifyOnNetworkStatusChange` in options. An error will be thrown if this option is set. The effects of this option were not observable by `client.query` since `client.query` emits a single result.
106
+
107
+ - [#12557](https://github.com/apollographql/apollo-client/pull/12557) [`51d26ae`](https://github.com/apollographql/apollo-client/commit/51d26ae631c6631a189c98ea9357b18e77a9a876) Thanks [@jerelmiller](https://github.com/jerelmiller)! - Update format of the error message for `CombinedGraphQLErrors` and `CombinedProtocolErrors` to be more like v3.x.
108
+
109
+ ```diff
110
+ console.log(error.message);
111
+ - `The GraphQL server returned with errors:
112
+ - - Email not found
113
+ - - Username already in use`
114
+ + `Email not found
115
+ + Username already in use`
116
+ ```
117
+
118
+ - [#12559](https://github.com/apollographql/apollo-client/pull/12559) [`49ace0e`](https://github.com/apollographql/apollo-client/commit/49ace0e2119b7fd5997dcf051002ebd4ba2e0bc4) Thanks [@jerelmiller](https://github.com/jerelmiller)! - `ObservableQuery.variables` has been updated to return `TVariables` rather than `TVariables | undefined`. This is more consistent with the runtime value where an empty object (`{}`) will be returned when the `variables` option is not provided.
119
+
120
+ ## 4.0.0-alpha.9
121
+
122
+ ### Major Changes
123
+
124
+ - [#12536](https://github.com/apollographql/apollo-client/pull/12536) [`e14205a`](https://github.com/apollographql/apollo-client/commit/e14205ad5909f95aa04684acd0ca2f25956ee50c) Thanks [@jerelmiller](https://github.com/jerelmiller)! - An initial loading state is now emitted from `ObservableQuery` when subscribing if `notifyOnNetworkStatusChange` is set to `true`.
125
+
126
+ - [#12512](https://github.com/apollographql/apollo-client/pull/12512) [`e809b71`](https://github.com/apollographql/apollo-client/commit/e809b71aa9a02917a286afdbb03d5be8e5947c53) Thanks [@jerelmiller](https://github.com/jerelmiller)! - `notifyOnNetworkStatusChange` now defaults to `true`. This means that loading states will be emitted (core API) or rendered (React) by default when calling `refetch`, `fetchMore`, etc. To maintain the old behavior, set `notifyOnNetworkStatusChange` to `false` in `defaultOptions`.
127
+
128
+ ```ts
129
+ new ApolloClient({
130
+ defaultOptions: {
131
+ watchQuery: {
132
+ // Use the v3 default
133
+ notifyOnNetworkStatusChange: false,
134
+ },
135
+ },
136
+ });
137
+ ```
138
+
139
+ ### Patch Changes
140
+
141
+ - [#12536](https://github.com/apollographql/apollo-client/pull/12536) [`e14205a`](https://github.com/apollographql/apollo-client/commit/e14205ad5909f95aa04684acd0ca2f25956ee50c) Thanks [@jerelmiller](https://github.com/jerelmiller)! - The returned `networkStatus` in `useLazyQuery` is now set to `setVariables` when calling the `useLazyQuery` `execute` function for the first time with variables.
142
+
143
+ - [#12536](https://github.com/apollographql/apollo-client/pull/12536) [`e14205a`](https://github.com/apollographql/apollo-client/commit/e14205ad5909f95aa04684acd0ca2f25956ee50c) Thanks [@jerelmiller](https://github.com/jerelmiller)! - Ensure `ObservableQuery` stops polling if switching to a `standby` `fetchPolicy`. When switching back to a non-`standby` `fetchPolicy`, polling will resume.
144
+
145
+ - [#12536](https://github.com/apollographql/apollo-client/pull/12536) [`e14205a`](https://github.com/apollographql/apollo-client/commit/e14205ad5909f95aa04684acd0ca2f25956ee50c) Thanks [@jerelmiller](https://github.com/jerelmiller)! - Ensure a loading state is emitted when calling the `execute` function after changing clients in `useLazyQuery`.
146
+
147
+ - [#12542](https://github.com/apollographql/apollo-client/pull/12542) [`afb4fce`](https://github.com/apollographql/apollo-client/commit/afb4fce08859b2c6eebf288230a7c35b7acf2da6) Thanks [@jerelmiller](https://github.com/jerelmiller)! - Ensure `useLazyQuery` does not return a `partial` property which is not specified by the result type.
148
+
149
+ ## 4.0.0-alpha.8
150
+
151
+ ### Major Changes
152
+
153
+ - [#12539](https://github.com/apollographql/apollo-client/pull/12539) [`dd0d6d6`](https://github.com/apollographql/apollo-client/commit/dd0d6d6d96d8b810e30dc2fdee2ac8a2477d0017) Thanks [@jerelmiller](https://github.com/jerelmiller)! - `onError` link now uses a single `error` property to report the error that caused the link callback to be called. This will be an instance of `CombinedGraphQLErrors` in the event GraphQL errors were emitted from the terminating link, `CombinedProtocolErrors` if the terminating link emitted protocol errors, or the unwrapped error type if any other non-GraphQL error was thrown or emitted.
154
+
155
+ ```diff
156
+ - const errorLink = onError(({ graphQLErrors, networkError, protocolErrors }) => {
157
+ - graphQLErrors.forEach(error => console.log(error.message));
158
+ + const errorLink = onError(({ error }) => {
159
+ + if (error.name === 'CombinedGraphQLErrors') {
160
+ + error.errors.forEach(rawError => console.log(rawError.message));
161
+ + }
162
+ });
163
+ ```
164
+
165
+ - [#12533](https://github.com/apollographql/apollo-client/pull/12533) [`73221d8`](https://github.com/apollographql/apollo-client/commit/73221d87bd5640986f86fe3ee50c63ed49834cbb) Thanks [@jerelmiller](https://github.com/jerelmiller)! - Remove the `onError` and `setOnError` methods from `ApolloLink`. `onError` was only used by `MockLink` to rewrite errors if `setOnError` was used.
166
+
167
+ - [#12531](https://github.com/apollographql/apollo-client/pull/12531) [`7784b46`](https://github.com/apollographql/apollo-client/commit/7784b46117a4f91a270a020ed1a24f042cb9ee17) Thanks [@jerelmiller](https://github.com/jerelmiller)! - Mocked responses passed to `MockLink` now accept a callback for the `request.variables` option. This is used to determine if the mock should be matched for a set of request variables. With this change, the `variableMatcher` option has been removed in favor of passing a callback to `variables`. Update by moving the callback function from `variableMatcher` to `request.variables`.
168
+
169
+ ```diff
170
+ new MockLink([
171
+ {
172
+ request: {
173
+ query,
174
+ + variables: (requestVariables) => true
175
+ },
176
+ - variableMatcher: (requestVariables) => true
177
+ }
178
+ ]);
179
+ ```
180
+
181
+ - [#12526](https://github.com/apollographql/apollo-client/pull/12526) [`391af1d`](https://github.com/apollographql/apollo-client/commit/391af1dd733219b7e1e14cfff9d5e3ce3967242f) Thanks [@phryneas](https://github.com/phryneas)! - The `@apollo/client` and `@apollo/client/core` entry points are now equal.
182
+ In the next major, the `@apollo/client/core` entry point will be removed.
183
+ Please change imports over from `@apollo/client/core` to `@apollo/client`.
184
+
185
+ - [#12525](https://github.com/apollographql/apollo-client/pull/12525) [`8785186`](https://github.com/apollographql/apollo-client/commit/87851863b94eebbc208671b17aeca73748ac41f6) Thanks [@jerelmiller](https://github.com/jerelmiller)! - Throw an error when a client-only query is used in a mocked response passed to `MockLink`.
186
+
187
+ - [#12532](https://github.com/apollographql/apollo-client/pull/12532) [`ae0dcad`](https://github.com/apollographql/apollo-client/commit/ae0dcad89924e6b8090ca3182df30e528589b562) Thanks [@jerelmiller](https://github.com/jerelmiller)! - Default the `delay` for all mocked responses passed to `MockLink` using `realisticDelay`. This ensures your test handles loading states by default and is not reliant on a specific timing.
188
+
189
+ If you would like to restore the old behavior, use a global default delay of `0`.
190
+
191
+ ```ts
192
+ MockLink.defaultOptions = {
193
+ delay: 0,
194
+ };
195
+ ```
196
+
197
+ - [#12530](https://github.com/apollographql/apollo-client/pull/12530) [`2973e2a`](https://github.com/apollographql/apollo-client/commit/2973e2a6e6fd81fa59b769d84c252c98ca69440d) Thanks [@jerelmiller](https://github.com/jerelmiller)! - Remove `newData` option for mocked responses passed to `MockLink` or the `mocks` option on `MockedProvider`. This option was undocumented and was nearly identical to using the `result` option as a callback.
198
+
199
+ To replicate the old behavior of `newData`, use `result` as a callback and add the `maxUsageCount` option with a value set to `Number.POSITIVE_INFINITY`.
200
+
201
+ **with `MockLink`**
202
+
203
+ ```diff
204
+ new MockLink([
205
+ {
206
+ request: { query, variables },
207
+ - newData: (variables) => ({ data: { greeting: "Hello " + variables.greeting } }),
208
+ + result: (variables) => ({ data: { greeting: "Hello " + variables.greeting } }),
209
+ + maxUsageCount: Number.POSITIVE_INFINITY,
210
+ }
211
+ ])
212
+ ```
213
+
214
+ **with `MockedProvider`**
215
+
216
+ ```diff
217
+ <MockedProvider
218
+ mocks={[
219
+ {
220
+ request: { query, variables },
221
+ - newData: (variables) => ({ data: { greeting: "Hello " + variables.greeting } }),
222
+ + result: (variables) => ({ data: { greeting: "Hello " + variables.greeting } }),
223
+ + maxUsageCount: Number.POSITIVE_INFINITY,
224
+ }
225
+ ]}
226
+ />
227
+ ```
228
+
229
+ ### Minor Changes
230
+
231
+ - [#12532](https://github.com/apollographql/apollo-client/pull/12532) [`ae0dcad`](https://github.com/apollographql/apollo-client/commit/ae0dcad89924e6b8090ca3182df30e528589b562) Thanks [@jerelmiller](https://github.com/jerelmiller)! - Allow mocked responses passed to `MockLink` to accept a callback for the `delay` option. The `delay` callback will be given the current operation which can be used to determine what delay should be used for the mock.
232
+
233
+ - [#12532](https://github.com/apollographql/apollo-client/pull/12532) [`ae0dcad`](https://github.com/apollographql/apollo-client/commit/ae0dcad89924e6b8090ca3182df30e528589b562) Thanks [@jerelmiller](https://github.com/jerelmiller)! - Introduce a new `realisticDelay` helper function for use with the `delay` callback for mocked responses used with `MockLink`. `realisticDelay` will generate a random value between 20 and 50ms to provide an experience closer to unpredictable network latency. `realisticDelay` can be configured with a `min` and `max` to set different thresholds if the defaults are not sufficient.
234
+
235
+ ```ts
236
+ import { realisticDelay } from "@apollo/client/testing";
237
+
238
+ new MockLink([
239
+ {
240
+ request: { query },
241
+ result: { data: { greeting: "Hello" } },
242
+ delay: realisticDelay(),
243
+ },
244
+ {
245
+ request: { query },
246
+ result: { data: { greeting: "Hello" } },
247
+ delay: realisticDelay({ min: 10, max: 100 }),
248
+ },
249
+ ]);
250
+ ```
251
+
252
+ - [#12532](https://github.com/apollographql/apollo-client/pull/12532) [`ae0dcad`](https://github.com/apollographql/apollo-client/commit/ae0dcad89924e6b8090ca3182df30e528589b562) Thanks [@jerelmiller](https://github.com/jerelmiller)! - Add ability to specify a default `delay` for all mocked responses passed to `MockLink`. This `delay` can be configured globally (all instances of `MockLink` will use the global defaults), or per-instance (all mocks in a single instance will use the defaults). A `delay` defined on a single mock will supercede all default delays. Per-instance defaults supercede global defaults.
253
+
254
+ **Global defaults**
255
+
256
+ ```ts
257
+ MockLink.defaultOptions = {
258
+ // Use a default delay of 20ms for all mocks in all instances without a specified delay
259
+ delay: 20,
260
+
261
+ // altenatively use a callback which will be executed for each mock
262
+ delay: () => getRandomNumber(),
263
+
264
+ // or use the built-in `realisticDelay`. This is the default
265
+ delay: realisticDelay(),
266
+ };
267
+ ```
268
+
269
+ **Per-instance defaults**
270
+
271
+ ```ts
272
+ new MockLink(
273
+ [
274
+ // Use the default delay
275
+ {
276
+ request: { query },
277
+ result: { data: { greeting: "Hello" } },
278
+ },
279
+ {
280
+ request: { query },
281
+ result: { data: { greeting: "Hello" } },
282
+ // Override the default for this mock
283
+ delay: 10,
284
+ },
285
+ ],
286
+ {
287
+ defaultOptions: {
288
+ // Use a default delay of 20ms for all mocks without a specified delay
289
+ delay: 20,
290
+
291
+ // altenatively use a callback which will be executed for each mock
292
+ delay: () => getRandomNumber(),
293
+
294
+ // or use the built-in `realisticDelay`. This is the default
295
+ delay: realisticDelay(),
296
+ },
297
+ }
298
+ );
299
+ ```
300
+
301
+ ## 4.0.0-alpha.7
302
+
303
+ ### Major Changes
304
+
305
+ - [#12513](https://github.com/apollographql/apollo-client/pull/12513) [`9c3207c`](https://github.com/apollographql/apollo-client/commit/9c3207c44ddad1f8b845c09495d6c070ace8de7b) Thanks [@phryneas](https://github.com/phryneas)! - Removed the `@apollo/client/react/context` and `@apollo/client/react/hooks` entry points. Please use `@apollo/client/react` instead.
306
+
307
+ - [#12513](https://github.com/apollographql/apollo-client/pull/12513) [`9c3207c`](https://github.com/apollographql/apollo-client/commit/9c3207c44ddad1f8b845c09495d6c070ace8de7b) Thanks [@phryneas](https://github.com/phryneas)! - Removed the `@apollo/client/react/parser` entry point. There is no replacement.
308
+
309
+ ### Patch Changes
310
+
311
+ - [#12513](https://github.com/apollographql/apollo-client/pull/12513) [`9c3207c`](https://github.com/apollographql/apollo-client/commit/9c3207c44ddad1f8b845c09495d6c070ace8de7b) Thanks [@phryneas](https://github.com/phryneas)! - Removed the `parser` cache. The functionality has been replaced in a way that doesn't need caching.
312
+
313
+ ## 4.0.0-alpha.6
314
+
315
+ ### Major Changes
316
+
317
+ - [#12485](https://github.com/apollographql/apollo-client/pull/12485) [`d338303`](https://github.com/apollographql/apollo-client/commit/d3383033d306b7d66e90f5f3170c24453cd76464) Thanks [@jerelmiller](https://github.com/jerelmiller)! - Throw an error for queries and mutations if the link chain completes without emitting a value.
318
+
319
+ - [#12484](https://github.com/apollographql/apollo-client/pull/12484) [`9a8b9ce`](https://github.com/apollographql/apollo-client/commit/9a8b9cebbcf290984a4f154f261a4090e636e50e) Thanks [@jerelmiller](https://github.com/jerelmiller)! - Remove `loading`, `networkStatus`, and `partial` properties on all promise-based query APIs. These properties were mostly static and were unnecessary since promise resolution guaranteed that the query was not longer loading.
320
+
321
+ This affects the following APIs:
322
+
323
+ - `client.query`
324
+ - `client.refetchQueries`
325
+ - `client.reFetchObservableQueries`
326
+ - `client.resetStore`
327
+ - `observableQuery.fetchMore`
328
+ - `observableQuery.refetch`
329
+ - `observableQuery.reobserve`
330
+ - `observableQuery.setVariables`
331
+ - The `useLazyQuery` `execute` function
332
+
333
+ ### Minor Changes
334
+
335
+ - [#12497](https://github.com/apollographql/apollo-client/pull/12497) [`ff2cbe1`](https://github.com/apollographql/apollo-client/commit/ff2cbe1db1815c30f5fda7f6c07091663e065582) Thanks [@jerelmiller](https://github.com/jerelmiller)! - Add a `data` property to `CombinedGraphQLErrors` that captures any partial data returned by the GraphQL response when `errors` are also returned.
336
+
337
+ - [#12488](https://github.com/apollographql/apollo-client/pull/12488) [`c98b633`](https://github.com/apollographql/apollo-client/commit/c98b6335de5b15e546aa5db79a8cf2dc9d914dcf) Thanks [@phryneas](https://github.com/phryneas)! - Add a new method for static SSR of React components, `prerenderStatic`.
338
+ The old methods, `getDataFromTree`, `getMarkupFromTree` and `renderToStringWithData`
339
+ have been deprecated in favor of `prerenderStatic`.
340
+
341
+ If used with React 19 and the `prerender` or `prerenderToNodeStream` apis from
342
+ `react-dom/static`, this method can now be used to SSR-prerender suspense-enabled
343
+ hook APIs.
344
+
345
+ ## 4.0.0-alpha.5
346
+
347
+ ### Major Changes
348
+
349
+ - [#12478](https://github.com/apollographql/apollo-client/pull/12478) [`5ea6a45`](https://github.com/apollographql/apollo-client/commit/5ea6a45b3ec2f0d526abe78ae03c42bb519f87c7) Thanks [@jerelmiller](https://github.com/jerelmiller)! - Remove `variables` from the result returned from `useSubscription`.
350
+
351
+ - [#12476](https://github.com/apollographql/apollo-client/pull/12476) [`6afff60`](https://github.com/apollographql/apollo-client/commit/6afff60beece953406af2cbe07f7ccbf973cadaa) Thanks [@jerelmiller](https://github.com/jerelmiller)! - Subscriptions now emit a `SubscribeResult` instead of a `FetchResult`. As a result, the `errors` field has been removed in favor of `error`.
352
+
353
+ - [#12475](https://github.com/apollographql/apollo-client/pull/12475) [`3de63eb`](https://github.com/apollographql/apollo-client/commit/3de63ebcdf95a87adc31e6b4a39cae5391ed945a) Thanks [@jerelmiller](https://github.com/jerelmiller)! - Unify error behavior on mutations for GraphQL errors and network errors by ensuring network errors are subject to the `errorPolicy`. Network errors created when using an `errorPolicy` of `all` will now resolve the promise and be returned on the `error` property of the result, or stripped away when the `errorPolicy` is `none`.
354
+
355
+ - [#12475](https://github.com/apollographql/apollo-client/pull/12475) [`3de63eb`](https://github.com/apollographql/apollo-client/commit/3de63ebcdf95a87adc31e6b4a39cae5391ed945a) Thanks [@jerelmiller](https://github.com/jerelmiller)! - `client.mutate` now returns a `MutateResult` instead of `FetchResult`. As a result, the `errors` property has been removed in favor of `error` which is set if either a network error occured or GraphQL errors are returned from the server.
356
+
357
+ `useMutation` now also returns a `MutateResult` instead of a `FetchResult`.
358
+
359
+ - [#12475](https://github.com/apollographql/apollo-client/pull/12475) [`3de63eb`](https://github.com/apollographql/apollo-client/commit/3de63ebcdf95a87adc31e6b4a39cae5391ed945a) Thanks [@jerelmiller](https://github.com/jerelmiller)! - Mutations no longer report errors if the GraphQL result from the server contains an empty array of errors.
360
+
361
+ - [#12476](https://github.com/apollographql/apollo-client/pull/12476) [`6afff60`](https://github.com/apollographql/apollo-client/commit/6afff60beece953406af2cbe07f7ccbf973cadaa) Thanks [@jerelmiller](https://github.com/jerelmiller)! - Unify error behavior on subscriptions for GraphQL errors and network errors by ensuring network errors are subject to the `errorPolicy`. Network errors that terminate the connection will now be emitted on the `error` property passed to the `next` callback followed by a call to the `complete` callback.
362
+
363
+ - [#12478](https://github.com/apollographql/apollo-client/pull/12478) [`5ea6a45`](https://github.com/apollographql/apollo-client/commit/5ea6a45b3ec2f0d526abe78ae03c42bb519f87c7) Thanks [@jerelmiller](https://github.com/jerelmiller)! - Remove deprecated `onSubscriptionData` and `onSubscriptionComplete` callbacks from `useSubscription`. Use `onData` and `onComplete` instead.
364
+
365
+ - [#12476](https://github.com/apollographql/apollo-client/pull/12476) [`6afff60`](https://github.com/apollographql/apollo-client/commit/6afff60beece953406af2cbe07f7ccbf973cadaa) Thanks [@jerelmiller](https://github.com/jerelmiller)! - GraphQL errors or network errors emitted while using an `errorPolicy` of `ignore` in subscriptions will no longer emit a result if there is no `data` emitted along with the error.
366
+
367
+ - [#12476](https://github.com/apollographql/apollo-client/pull/12476) [`6afff60`](https://github.com/apollographql/apollo-client/commit/6afff60beece953406af2cbe07f7ccbf973cadaa) Thanks [@jerelmiller](https://github.com/jerelmiller)! - Subscriptions no longer emit errors in the `error` callback and instead provide errors on the `error` property on the result passed to the `next` callback. As a result, errors will no longer automatically terminate the connection allowing additional results to be emitted when the connection stays open.
368
+
369
+ When an error terminates the downstream connection, a `next` event will be emitted with an `error` property followed by a `complete` event instead.
370
+
371
+ ### Minor Changes
372
+
373
+ - [#12487](https://github.com/apollographql/apollo-client/pull/12487) [`b695e5e`](https://github.com/apollographql/apollo-client/commit/b695e5e10ab0eb47948e914b610f67c40267349e) Thanks [@phryneas](https://github.com/phryneas)! - Split out SSR-specific code from useQuery hook, remove RenderPromises
374
+
375
+ ### Patch Changes
376
+
377
+ - [#12487](https://github.com/apollographql/apollo-client/pull/12487) [`b695e5e`](https://github.com/apollographql/apollo-client/commit/b695e5e10ab0eb47948e914b610f67c40267349e) Thanks [@phryneas](https://github.com/phryneas)! - `useQuery` with `ssr: false` - previously, `skip` had a higher priortity than `ssr: false` while `ssr: false` had a higher priority than `fetchPolicy: "standby"` (which is roughly equivalent to `skip`).
378
+
379
+ This priority has been adjusted so now both `skip` and `fetchPolicy: "standby"` have a higher priority than `ssr: false` and will return `loading: false`, while `ssr: false` will only come after those and will return `loading: true` if those are not set.
380
+
381
+ - [#12475](https://github.com/apollographql/apollo-client/pull/12475) [`3de63eb`](https://github.com/apollographql/apollo-client/commit/3de63ebcdf95a87adc31e6b4a39cae5391ed945a) Thanks [@jerelmiller](https://github.com/jerelmiller)! - Fix an issue where passing `onError` to `useMutation` would resolve the promise returned by the `mutate` function instead of rejecting when using an `errorPolicy` of `none`.
382
+
383
+ - [#12475](https://github.com/apollographql/apollo-client/pull/12475) [`3de63eb`](https://github.com/apollographql/apollo-client/commit/3de63ebcdf95a87adc31e6b4a39cae5391ed945a) Thanks [@jerelmiller](https://github.com/jerelmiller)! - Fix an issue where additional response properties were returned on the result returned from `client.mutate`, such as `@defer` payload fields. These properties are now stripped out to correspond to the TypeScript type.
384
+
385
+ ## 4.0.0-alpha.4
386
+
387
+ ### Major Changes
388
+
389
+ - [#12463](https://github.com/apollographql/apollo-client/pull/12463) [`3868df8`](https://github.com/apollographql/apollo-client/commit/3868df81f973dc7b5a79fadf4dc1b0e291003b7f) Thanks [@jerelmiller](https://github.com/jerelmiller)! - `ObservableQuery.setOptions` has been removed as it was an alias of `reobserve`. Prefer using `reobserve` directly instead.
390
+
391
+ ```diff
392
+ const observable = client.watchQuery(options);
393
+
394
+ // Use reobserve to set new options and reevaluate the query
395
+ - observable.setOptions(newOptions);
396
+ + observable.reobserve(newOptions);
397
+ ```
398
+
399
+ As a result of this change, `reobserve` has been marked for public use and is no longer considered an internal API. The `newNetworkStatus` argument has been removed to facilitate this change.
400
+
401
+ - [#12470](https://github.com/apollographql/apollo-client/pull/12470) [`d32902f`](https://github.com/apollographql/apollo-client/commit/d32902f26a4c5dea30421ee52aeea52df3e5334e) Thanks [@phryneas](https://github.com/phryneas)! - `ssrMode`, `ssrForceFetchDelay` and `disableNetworkFetches` have been reworked:
402
+
403
+ Previously, a `ObservableQuery` created by `client.query` or `client.watchQuery`
404
+ while one of those were active would permanently be changed from a `fetchPolicy`
405
+ of `"network-only"` or `"cache-and-network"` to `"cache-first"`, and stay that way
406
+ even long after `disableNetworkFetches` would have been deactivated.
407
+
408
+ Now, the `ObservableQuery` will keep their original `fetchPolicy`, but queries
409
+ made during `disableNetworkFetches` will just apply the `fetchPolicy` replacement
410
+ at request time, just for that one request.
411
+
412
+ `ApolloClient.disableNetworkFetches` has been renamed to `ApolloClient.prioritizeCacheValues` to better reflect this behaviour.
413
+
414
+ - [#12465](https://github.com/apollographql/apollo-client/pull/12465) [`a132163`](https://github.com/apollographql/apollo-client/commit/a1321637cafb4023d6df416e9467294114d8346b) Thanks [@jerelmiller](https://github.com/jerelmiller)! - Flatten out React hook types. As a result, the base types have been removed. Prefer using the hook types instead. Removed types include:
415
+
416
+ - `BaseMutationOptions`
417
+ - `BaseQueryOptions`
418
+ - `BaseSubscriptionOptions`
419
+ - `ObservableQueryFields`
420
+ - `MutationSharedOptions`
421
+ - `QueryFunctionOptions`
422
+
423
+ - [#12463](https://github.com/apollographql/apollo-client/pull/12463) [`3868df8`](https://github.com/apollographql/apollo-client/commit/3868df81f973dc7b5a79fadf4dc1b0e291003b7f) Thanks [@jerelmiller](https://github.com/jerelmiller)! - `useQuery` no longer returns `reobserve` as part of its result. It was possible to use `reobserve` to set new options on the underlying `ObservableQuery` instance which differed from the options passed to the hook. This could result in unexpected results. Instead prefer to rerender the hook with new options.
424
+
425
+ ### Patch Changes
426
+
427
+ - [#12465](https://github.com/apollographql/apollo-client/pull/12465) [`a132163`](https://github.com/apollographql/apollo-client/commit/a1321637cafb4023d6df416e9467294114d8346b) Thanks [@jerelmiller](https://github.com/jerelmiller)! - Rename all React hook result types and options. These types have all moved under a namespace that matches the hook name. For example, `useQuery` exports `useQuery.Options` and `useQuery.Result` types. As such, the old hook types have been deprecated and will be removed in v5.
428
+
429
+ ## 4.0.0-alpha.3
430
+
431
+ ### Major Changes
432
+
433
+ - [#12457](https://github.com/apollographql/apollo-client/pull/12457) [`32e85ea`](https://github.com/apollographql/apollo-client/commit/32e85ea9eb93c1ffb10d6f70e9e2775e1326e9aa) Thanks [@jerelmiller](https://github.com/jerelmiller)! - Network errors triggered by queries now adhere to the `errorPolicy`. This means that GraphQL errors and network errors now behave the same way. Previously promise-based APIs, such as `client.query`, would reject the promise with the network error even if `errorPolicy` was set to `ignore`. The promise is now resolved with the `error` property set to the network error instead.
434
+
435
+ - [#12464](https://github.com/apollographql/apollo-client/pull/12464) [`0595f39`](https://github.com/apollographql/apollo-client/commit/0595f39deba52ac43fa0780b742564134ec7ab89) Thanks [@jerelmiller](https://github.com/jerelmiller)! - Remove the `called` property from `useQuery`.
436
+
437
+ ## 4.0.0-alpha.2
438
+
439
+ ### Major Changes
440
+
441
+ - [#12450](https://github.com/apollographql/apollo-client/pull/12450) [`876d070`](https://github.com/apollographql/apollo-client/commit/876d07042cf3348b3769b2bb415aa5f70ce9844c) Thanks [@jerelmiller](https://github.com/jerelmiller)! - Remove `TSerialized` generic argument to `ApolloCache`. The `ApolloCache` base cache abstraction now returns `unknown` for `cache.extract` which can be overridden by a cache subclass.
442
+
443
+ - [#12450](https://github.com/apollographql/apollo-client/pull/12450) [`876d070`](https://github.com/apollographql/apollo-client/commit/876d07042cf3348b3769b2bb415aa5f70ce9844c) Thanks [@jerelmiller](https://github.com/jerelmiller)! - Remove the `TCacheShape` generic argument to `ApolloClient`. `client.extract()` now returns `unknown` by default. You will either need to type-cast this to the expected serialized shape, or use the `cache.extract()` directly from the subclass to get more specific types.
444
+
445
+ - [#12446](https://github.com/apollographql/apollo-client/pull/12446) [`ab920d2`](https://github.com/apollographql/apollo-client/commit/ab920d2701aa276482dbc78b44a1c25c76467bc9) Thanks [@jerelmiller](https://github.com/jerelmiller)! - Removes the `defaultOptions` option from `useQuery`. Use options directly or use the global `ApolloClient` `defaultOptions`.
446
+
447
+ - [#12442](https://github.com/apollographql/apollo-client/pull/12442) [`c5ead08`](https://github.com/apollographql/apollo-client/commit/c5ead08d0f10ddd6232b742defe9620533bf41e6) Thanks [@jerelmiller](https://github.com/jerelmiller)! - Remove the deprecated `canonizeResults` option. It was prone to memory leaks. As such, some results that were referentially equal when `canonizeResults` option was set to `true` no longer retain the same object identity.
448
+
449
+ - [#12442](https://github.com/apollographql/apollo-client/pull/12442) [`c5ead08`](https://github.com/apollographql/apollo-client/commit/c5ead08d0f10ddd6232b742defe9620533bf41e6) Thanks [@jerelmiller](https://github.com/jerelmiller)! - Remove `resetResultIdentities` option from `InMemoryCache.gc()`. This affected object canonization which has been removed.
450
+
451
+ - [#12451](https://github.com/apollographql/apollo-client/pull/12451) [`77e1b13`](https://github.com/apollographql/apollo-client/commit/77e1b133bdba32c67b5a840090dbacb16282dee9) Thanks [@jerelmiller](https://github.com/jerelmiller)! - Default the `TData` generic type to `unknown` in all APIs that use a `TData` generic argument such as `useQuery`, `client.query`, etc.
452
+
453
+ ### Patch Changes
454
+
455
+ - [#12451](https://github.com/apollographql/apollo-client/pull/12451) [`77e1b13`](https://github.com/apollographql/apollo-client/commit/77e1b133bdba32c67b5a840090dbacb16282dee9) Thanks [@jerelmiller](https://github.com/jerelmiller)! - Default `TVariables` generic type to `OperationVariables` instead of `any` throughout the client in areas that did not yet have the default as such.
456
+
457
+ - [#12454](https://github.com/apollographql/apollo-client/pull/12454) [`925548a`](https://github.com/apollographql/apollo-client/commit/925548a9baadb19b7bb78ee84c6f9e64b55c39e9) Thanks [@phryneas](https://github.com/phryneas)! - Fix up the 4.0 CommonJS build
458
+
459
+ ## 4.0.0-alpha.1
460
+
461
+ ### Major Changes
462
+
463
+ - [#12433](https://github.com/apollographql/apollo-client/pull/12433) [`b86e50b`](https://github.com/apollographql/apollo-client/commit/b86e50b1dc121cd67fe73655256b6c61afc18cb4) Thanks [@phryneas](https://github.com/phryneas)! - Remove workarounds for streaming with non-WhatWG response bodies to reduce bundle size.
464
+
465
+ This removes support for `fetch` implementations that return Node Streams, Async Iterators or Blob instances as `Response.body`.
466
+
467
+ In the WhatWG Fetch specification, [`Response.body`](https://fetch.spec.whatwg.org/#body) is specified as a WhatWG [ReadableStream](https://streams.spec.whatwg.org/#readablestream).
468
+
469
+ At this point in time, this is natively supported in browsers, `node` and React Native (via [react-native-fetch-api](https://www.npmjs.com/package/react-native-fetch-api), see our [setup instructions for React Native](https://www.apollographql.com/docs/react/integrations/react-native#consuming-multipart-http-via-text-streaming)).
470
+
471
+ If you are using an older `fetch` polyfill that deviates from the spec, this might not be compatible - for example, [node-fetch](https://github.com/node-fetch/node-fetch?tab=readme-ov-file#interface-body) returns a node `Readable` instead of a `ReadableStream`.
472
+ In those cases, please switch to a compatible alternative such as the `node`-native `fetch`, or `undici`.
473
+
474
+ ### Minor Changes
475
+
476
+ - [#12438](https://github.com/apollographql/apollo-client/pull/12438) [`5089516`](https://github.com/apollographql/apollo-client/commit/5089516aa3ad140df22bb8a458faeeb884ed0388) Thanks [@phryneas](https://github.com/phryneas)! - Drop `rehackt` dependency.
477
+ We can now directly import from `react` without causing build errors in RSC.
478
+
479
+ - [#12437](https://github.com/apollographql/apollo-client/pull/12437) [`4779dc7`](https://github.com/apollographql/apollo-client/commit/4779dc7badaba10d8c7a271eb0da6a079049b65d) Thanks [@phryneas](https://github.com/phryneas)! - Remove polyfills for Object.freeze,seal and preventExtensions in React Native
480
+
481
+ These polyfills were only necessary until React Native 0.59, which
482
+ [patched the problem](https://github.com/facebook/react-native/pull/21492) on
483
+ the React Native side.
484
+
485
+ With React Native 0.61, the `Map` function was [completely replaced](https://github.com/facebook/react-native/commit/93b9ac74e59bbe84ea388d7c1879857b4acab114)
486
+ with a native implementation that never had the problems we guarded against.
487
+
488
+ - [#12438](https://github.com/apollographql/apollo-client/pull/12438) [`5089516`](https://github.com/apollographql/apollo-client/commit/5089516aa3ad140df22bb8a458faeeb884ed0388) Thanks [@phryneas](https://github.com/phryneas)! - Add `react-server` entry point with stubs for normal exports.
489
+
3
490
  ## 4.0.0-alpha.0
4
491
 
5
492
  ### Major Changes
@@ -418,6 +905,26 @@
418
905
 
419
906
  - [#12384](https://github.com/apollographql/apollo-client/pull/12384) [`6aa6fd3`](https://github.com/apollographql/apollo-client/commit/6aa6fd316cfdb31ebbe3e3133cca2965604e7ca1) Thanks [@jerelmiller](https://github.com/jerelmiller)! - Don't emit a partial cache result from `cache-only` queries when `returnPartialData` is `false`.
420
907
 
908
+ ## 3.13.7
909
+
910
+ ### Patch Changes
911
+
912
+ - [#12540](https://github.com/apollographql/apollo-client/pull/12540) [`0098932`](https://github.com/apollographql/apollo-client/commit/009893220934081f6e5733bff5863c768a597117) Thanks [@phryneas](https://github.com/phryneas)! - Refactor: Move notification scheduling logic from `QueryInfo` to `ObservableQuery`
913
+
914
+ - [#12540](https://github.com/apollographql/apollo-client/pull/12540) [`0098932`](https://github.com/apollographql/apollo-client/commit/009893220934081f6e5733bff5863c768a597117) Thanks [@phryneas](https://github.com/phryneas)! - Refactored cache emit logic for ObservableQuery. This should be an invisible change.
915
+
916
+ ## 3.13.6
917
+
918
+ ### Patch Changes
919
+
920
+ - [#12285](https://github.com/apollographql/apollo-client/pull/12285) [`cdc55ff`](https://github.com/apollographql/apollo-client/commit/cdc55ff54bf4c83ec8571508ec4bf8156af1bc97) Thanks [@phryneas](https://github.com/phryneas)! - keep ObservableQuery created by useQuery non-active before it is first subscribed
921
+
922
+ ## 3.13.5
923
+
924
+ ### Patch Changes
925
+
926
+ - [#12461](https://github.com/apollographql/apollo-client/pull/12461) [`12c8d06`](https://github.com/apollographql/apollo-client/commit/12c8d06f1ef7cfbece8e3a63b7ad09d91334f663) Thanks [@jerelmiller](https://github.com/jerelmiller)! - Fix an issue where a `cache-first` query would return the result for previous variables when a cache update is issued after simultaneously changing variables and skipping the query.
927
+
421
928
  ## 3.13.4
422
929
 
423
930
  ### Patch Changes
@@ -11,9 +11,9 @@ const rxjs_1 = require("rxjs");
11
11
  const masking_1 = require("@apollo/client/masking");
12
12
  const utilities_1 = require("@apollo/client/utilities");
13
13
  const environment_1 = require("@apollo/client/utilities/environment");
14
+ const internal_1 = require("@apollo/client/utilities/internal");
14
15
  const invariant_1 = require("@apollo/client/utilities/invariant");
15
16
  const equalByQuery_js_1 = require("../../core/equalByQuery.cjs");
16
- const getMemoryInternals_js_1 = require("../../utilities/caching/getMemoryInternals.cjs");
17
17
  class ApolloCache {
18
18
  assumeImmutableResults = false;
19
19
  // Function used to lookup a fragment when a fragment definition is not part
@@ -144,7 +144,7 @@ class ApolloCache {
144
144
  // time we receive the same fragment in readFragment.
145
145
  getFragmentDoc = (0, optimism_1.wrap)(utilities_1.getFragmentQueryDocument, {
146
146
  max: utilities_1.cacheSizes["cache.fragmentQueryDocuments"] ||
147
- utilities_1.defaultCacheSizes["cache.fragmentQueryDocuments"],
147
+ 1000 /* defaultCacheSizes["cache.fragmentQueryDocuments"] */,
148
148
  cache: caches_1.WeakCache,
149
149
  });
150
150
  readFragment(options, optimistic = !!options.optimistic) {
@@ -203,6 +203,6 @@ class ApolloCache {
203
203
  }
204
204
  exports.ApolloCache = ApolloCache;
205
205
  if (environment_1.__DEV__) {
206
- ApolloCache.prototype.getMemoryInternals = getMemoryInternals_js_1.getApolloCacheMemoryInternals;
206
+ ApolloCache.prototype.getMemoryInternals = internal_1.getApolloCacheMemoryInternals;
207
207
  }
208
208
  //# sourceMappingURL=cache.cjs.map