@apollo/client 4.0.0-alpha.14 → 4.0.0-alpha.16

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 (521) hide show
  1. package/CHANGELOG.md +97 -0
  2. package/__cjs/cache/core/cache.cjs.map +1 -1
  3. package/__cjs/cache/core/cache.d.cts +2 -2
  4. package/__cjs/cache/core/types/DataProxy.d.cts +1 -2
  5. package/__cjs/cache/core/types/common.cjs.map +1 -1
  6. package/__cjs/cache/core/types/common.d.cts +1 -2
  7. package/__cjs/cache/inmemory/inMemoryCache.cjs.map +1 -1
  8. package/__cjs/cache/inmemory/inMemoryCache.d.cts +1 -2
  9. package/__cjs/core/ObservableQuery.cjs +6 -0
  10. package/__cjs/core/ObservableQuery.cjs.map +1 -1
  11. package/__cjs/core/QueryManager.cjs +2 -4
  12. package/__cjs/core/QueryManager.cjs.map +1 -1
  13. package/__cjs/core/watchQueryOptions.d.cts +2 -1
  14. package/__cjs/errors/ServerError.cjs +3 -4
  15. package/__cjs/errors/ServerError.cjs.map +1 -1
  16. package/__cjs/errors/ServerError.d.cts +8 -8
  17. package/__cjs/link/batch-http/batchHttpLink.cjs +0 -35
  18. package/__cjs/link/batch-http/batchHttpLink.cjs.map +1 -1
  19. package/__cjs/link/http/createHttpLink.cjs +1 -1
  20. package/__cjs/link/http/createHttpLink.cjs.map +1 -1
  21. package/__cjs/link/http/parseAndCheckHttpResponse.cjs +20 -55
  22. package/__cjs/link/http/parseAndCheckHttpResponse.cjs.map +1 -1
  23. package/__cjs/link/http/parseAndCheckHttpResponse.d.cts +0 -2
  24. package/__cjs/link/http/selectHttpOptionsAndBody.cjs +1 -1
  25. package/__cjs/link/http/selectHttpOptionsAndBody.cjs.map +1 -1
  26. package/__cjs/link/persisted-queries/index.cjs +12 -10
  27. package/__cjs/link/persisted-queries/index.cjs.map +1 -1
  28. package/__cjs/react/hooks/useBackgroundQuery.cjs.map +1 -1
  29. package/__cjs/react/hooks/useBackgroundQuery.d.cts +2 -1
  30. package/__cjs/react/hooks/useFragment.cjs.map +1 -1
  31. package/__cjs/react/hooks/useFragment.d.cts +2 -1
  32. package/__cjs/react/hooks/useLoadableQuery.cjs.map +1 -1
  33. package/__cjs/react/hooks/useLoadableQuery.d.cts +1 -1
  34. package/__cjs/react/hooks/useQuery.cjs +10 -25
  35. package/__cjs/react/hooks/useQuery.cjs.map +1 -1
  36. package/__cjs/react/hooks/useQuery.d.cts +0 -1
  37. package/__cjs/react/hooks/useSuspenseQuery.cjs.map +1 -1
  38. package/__cjs/react/hooks/useSuspenseQuery.d.cts +2 -1
  39. package/__cjs/react/query-preloader/createQueryPreloader.cjs.map +1 -1
  40. package/__cjs/react/query-preloader/createQueryPreloader.d.cts +2 -1
  41. package/__cjs/react/ssr/useSSRQuery.cjs +11 -2
  42. package/__cjs/react/ssr/useSSRQuery.cjs.map +1 -1
  43. package/__cjs/testing/core/mocking/mockLink.cjs +0 -6
  44. package/__cjs/testing/core/mocking/mockLink.cjs.map +1 -1
  45. package/__cjs/testing/core/mocking/mockLink.d.cts +19 -20
  46. package/__cjs/testing/core/mocking/mockSubscriptionLink.cjs +0 -4
  47. package/__cjs/testing/core/mocking/mockSubscriptionLink.cjs.map +1 -1
  48. package/__cjs/testing/core/mocking/mockSubscriptionLink.d.cts +7 -6
  49. package/__cjs/testing/core/types/deprecated.cjs +3 -0
  50. package/__cjs/testing/core/types/deprecated.cjs.map +1 -0
  51. package/__cjs/testing/core/types/deprecated.d.cts +10 -0
  52. package/__cjs/testing/index.cjs +6 -13
  53. package/__cjs/testing/index.cjs.map +1 -1
  54. package/__cjs/testing/index.d.cts +3 -2
  55. package/__cjs/testing/react/MockedProvider.cjs +2 -2
  56. package/__cjs/testing/react/MockedProvider.cjs.map +1 -1
  57. package/__cjs/testing/react/MockedProvider.d.cts +2 -3
  58. package/__cjs/utilities/DeepPartial.cjs.map +1 -0
  59. package/__cjs/utilities/{internal/types/DeepPartial.d.cts → DeepPartial.d.cts} +3 -5
  60. package/__cjs/utilities/index.cjs.map +1 -1
  61. package/__cjs/utilities/index.d.cts +1 -0
  62. package/__cjs/utilities/internal/index.cjs.map +1 -1
  63. package/__cjs/utilities/internal/index.d.cts +0 -1
  64. package/__cjs/utilities/subscriptions/relay/index.cjs +1 -1
  65. package/__cjs/utilities/subscriptions/relay/index.cjs.map +1 -1
  66. package/__cjs/version.cjs +1 -1
  67. package/cache/core/cache.d.ts +2 -2
  68. package/cache/core/cache.js.map +1 -1
  69. package/cache/core/types/DataProxy.d.ts +1 -2
  70. package/cache/core/types/common.d.ts +1 -2
  71. package/cache/core/types/common.js.map +1 -1
  72. package/cache/inmemory/inMemoryCache.d.ts +1 -2
  73. package/cache/inmemory/inMemoryCache.js.map +1 -1
  74. package/core/ObservableQuery.js +6 -0
  75. package/core/ObservableQuery.js.map +1 -1
  76. package/core/QueryManager.js +1 -3
  77. package/core/QueryManager.js.map +1 -1
  78. package/core/watchQueryOptions.d.ts +2 -1
  79. package/errors/ServerError.d.ts +8 -8
  80. package/errors/ServerError.js +3 -4
  81. package/errors/ServerError.js.map +1 -1
  82. package/link/batch-http/batchHttpLink.js +0 -35
  83. package/link/batch-http/batchHttpLink.js.map +1 -1
  84. package/link/http/createHttpLink.js +2 -2
  85. package/link/http/createHttpLink.js.map +1 -1
  86. package/link/http/parseAndCheckHttpResponse.d.ts +0 -2
  87. package/link/http/parseAndCheckHttpResponse.js +20 -54
  88. package/link/http/parseAndCheckHttpResponse.js.map +1 -1
  89. package/link/http/selectHttpOptionsAndBody.js +1 -1
  90. package/link/http/selectHttpOptionsAndBody.js.map +1 -1
  91. package/link/persisted-queries/index.js +12 -10
  92. package/link/persisted-queries/index.js.map +1 -1
  93. package/package.json +5 -165
  94. package/react/hooks/useBackgroundQuery.d.ts +2 -1
  95. package/react/hooks/useBackgroundQuery.js.map +1 -1
  96. package/react/hooks/useFragment.d.ts +2 -1
  97. package/react/hooks/useFragment.js.map +1 -1
  98. package/react/hooks/useLoadableQuery.d.ts +1 -1
  99. package/react/hooks/useLoadableQuery.js.map +1 -1
  100. package/react/hooks/useQuery.d.ts +0 -1
  101. package/react/hooks/useQuery.js +10 -25
  102. package/react/hooks/useQuery.js.map +1 -1
  103. package/react/hooks/useSuspenseQuery.d.ts +2 -1
  104. package/react/hooks/useSuspenseQuery.js.map +1 -1
  105. package/react/query-preloader/createQueryPreloader.d.ts +2 -1
  106. package/react/query-preloader/createQueryPreloader.js.map +1 -1
  107. package/react/ssr/useSSRQuery.js +11 -2
  108. package/react/ssr/useSSRQuery.js.map +1 -1
  109. package/testing/core/mocking/mockLink.d.ts +19 -20
  110. package/testing/core/mocking/mockLink.js +0 -5
  111. package/testing/core/mocking/mockLink.js.map +1 -1
  112. package/testing/core/mocking/mockSubscriptionLink.d.ts +7 -6
  113. package/testing/core/mocking/mockSubscriptionLink.js +0 -3
  114. package/testing/core/mocking/mockSubscriptionLink.js.map +1 -1
  115. package/testing/core/types/deprecated.d.ts +10 -0
  116. package/testing/core/types/deprecated.js +2 -0
  117. package/testing/core/types/deprecated.js.map +1 -0
  118. package/testing/index.d.ts +3 -2
  119. package/testing/index.js +2 -1
  120. package/testing/index.js.map +1 -1
  121. package/testing/react/MockedProvider.d.ts +2 -3
  122. package/testing/react/MockedProvider.js +1 -1
  123. package/testing/react/MockedProvider.js.map +1 -1
  124. package/utilities/{internal/types/DeepPartial.d.ts → DeepPartial.d.ts} +3 -5
  125. package/utilities/DeepPartial.js.map +1 -0
  126. package/utilities/index.d.ts +1 -0
  127. package/utilities/index.js.map +1 -1
  128. package/utilities/internal/index.d.ts +0 -1
  129. package/utilities/internal/index.js.map +1 -1
  130. package/utilities/subscriptions/relay/index.js +2 -2
  131. package/utilities/subscriptions/relay/index.js.map +1 -1
  132. package/version.js +1 -1
  133. package/.changeset/README.md +0 -8
  134. package/.changeset/afraid-grapes-call.md +0 -5
  135. package/.changeset/afraid-moons-arrive.md +0 -5
  136. package/.changeset/beige-mirrors-talk.md +0 -15
  137. package/.changeset/brave-moons-juggle.md +0 -5
  138. package/.changeset/brave-radios-wait.md +0 -5
  139. package/.changeset/bright-ads-share.md +0 -5
  140. package/.changeset/calm-frogs-remain.md +0 -7
  141. package/.changeset/calm-seals-relate.md +0 -5
  142. package/.changeset/chatty-planes-grin.md +0 -5
  143. package/.changeset/clean-sheep-hide.md +0 -6
  144. package/.changeset/clever-zebras-mate.md +0 -5
  145. package/.changeset/config.json +0 -14
  146. package/.changeset/cool-bikes-shake.md +0 -12
  147. package/.changeset/cool-kiwis-hunt.md +0 -15
  148. package/.changeset/cuddly-spiders-tie.md +0 -5
  149. package/.changeset/curvy-flies-accept.md +0 -5
  150. package/.changeset/curvy-pianos-count.md +0 -5
  151. package/.changeset/dirty-cobras-change.md +0 -7
  152. package/.changeset/dirty-eagles-poke.md +0 -5
  153. package/.changeset/dirty-trees-pump.md +0 -5
  154. package/.changeset/early-eggs-develop.md +0 -22
  155. package/.changeset/eighty-squids-fix.md +0 -15
  156. package/.changeset/eleven-kangaroos-jump.md +0 -5
  157. package/.changeset/empty-rabbits-move.md +0 -5
  158. package/.changeset/few-crabs-move.md +0 -6
  159. package/.changeset/fluffy-shoes-applaud.md +0 -5
  160. package/.changeset/forty-hairs-occur.md +0 -5
  161. package/.changeset/forty-shrimps-fry.md +0 -5
  162. package/.changeset/forty-tomatoes-punch.md +0 -5
  163. package/.changeset/four-countries-clean.md +0 -24
  164. package/.changeset/four-ghosts-watch.md +0 -5
  165. package/.changeset/fresh-moose-hope.md +0 -5
  166. package/.changeset/friendly-olives-refuse.md +0 -5
  167. package/.changeset/funny-boats-wink.md +0 -35
  168. package/.changeset/funny-jeans-invent.md +0 -16
  169. package/.changeset/funny-terms-deny.md +0 -5
  170. package/.changeset/fuzzy-seahorses-hunt.md +0 -5
  171. package/.changeset/fuzzy-tips-sit.md +0 -5
  172. package/.changeset/gentle-badgers-train.md +0 -5
  173. package/.changeset/gentle-waves-cough.md +0 -5
  174. package/.changeset/giant-apes-thank.md +0 -5
  175. package/.changeset/giant-bags-share.md +0 -5
  176. package/.changeset/gold-oranges-double.md +0 -5
  177. package/.changeset/good-dolphins-peel.md +0 -113
  178. package/.changeset/gorgeous-chefs-tap.md +0 -5
  179. package/.changeset/great-roses-jog.md +0 -15
  180. package/.changeset/grumpy-vans-type.md +0 -5
  181. package/.changeset/healthy-apes-sneeze.md +0 -5
  182. package/.changeset/hip-vans-act.md +0 -5
  183. package/.changeset/hot-cycles-notice.md +0 -5
  184. package/.changeset/hungry-bikes-cough.md +0 -5
  185. package/.changeset/itchy-chefs-run.md +0 -23
  186. package/.changeset/itchy-drinks-refuse.md +0 -5
  187. package/.changeset/itchy-roses-accept.md +0 -5
  188. package/.changeset/khaki-keys-deliver.md +0 -5
  189. package/.changeset/khaki-spies-work.md +0 -11
  190. package/.changeset/kind-fishes-develop.md +0 -17
  191. package/.changeset/large-plants-know.md +0 -5
  192. package/.changeset/late-trainers-peel.md +0 -7
  193. package/.changeset/light-apes-rescue.md +0 -5
  194. package/.changeset/light-dolphins-taste.md +0 -5
  195. package/.changeset/light-sloths-end.md +0 -16
  196. package/.changeset/little-parrots-bow.md +0 -14
  197. package/.changeset/little-spoons-kick.md +0 -7
  198. package/.changeset/loud-cows-raise.md +0 -7
  199. package/.changeset/lucky-hats-push.md +0 -7
  200. package/.changeset/lucky-sheep-explain.md +0 -34
  201. package/.changeset/many-buses-allow.md +0 -5
  202. package/.changeset/many-papayas-hide.md +0 -5
  203. package/.changeset/mean-lizards-think.md +0 -5
  204. package/.changeset/metal-needles-search.md +0 -5
  205. package/.changeset/mighty-penguins-wink.md +0 -16
  206. package/.changeset/modern-feet-do.md +0 -5
  207. package/.changeset/moody-lobsters-listen.md +0 -7
  208. package/.changeset/nervous-fireants-bow.md +0 -5
  209. package/.changeset/nervous-goats-allow.md +0 -5
  210. package/.changeset/nice-donkeys-reflect.md +0 -5
  211. package/.changeset/nice-dots-matter.md +0 -5
  212. package/.changeset/nice-waves-work.md +0 -7
  213. package/.changeset/ninety-bags-bake.md +0 -17
  214. package/.changeset/odd-chicken-hide.md +0 -17
  215. package/.changeset/odd-lemons-relax.md +0 -5
  216. package/.changeset/olive-cougars-ring.md +0 -9
  217. package/.changeset/orange-suits-laugh.md +0 -5
  218. package/.changeset/perfect-ducks-reflect.md +0 -12
  219. package/.changeset/perfect-vans-give.md +0 -7
  220. package/.changeset/polite-bees-care.md +0 -26
  221. package/.changeset/poor-eels-punch.md +0 -5
  222. package/.changeset/popular-games-sleep.md +0 -5
  223. package/.changeset/pre.json +0 -161
  224. package/.changeset/purple-bears-flash.md +0 -5
  225. package/.changeset/purple-lions-cough.md +0 -5
  226. package/.changeset/rare-houses-prove.md +0 -5
  227. package/.changeset/real-gorillas-move.md +0 -21
  228. package/.changeset/real-teachers-peel.md +0 -5
  229. package/.changeset/rich-eagles-cross.md +0 -5
  230. package/.changeset/rich-kids-carry.md +0 -9
  231. package/.changeset/rude-fans-study.md +0 -5
  232. package/.changeset/serious-items-develop.md +0 -17
  233. package/.changeset/serious-moons-juggle.md +0 -5
  234. package/.changeset/seven-dragons-repair.md +0 -14
  235. package/.changeset/seven-foxes-melt.md +0 -5
  236. package/.changeset/seven-schools-carry.md +0 -5
  237. package/.changeset/shaggy-pugs-add.md +0 -52
  238. package/.changeset/shiny-carrots-invent.md +0 -5
  239. package/.changeset/short-jokes-jam.md +0 -27
  240. package/.changeset/short-months-complain.md +0 -5
  241. package/.changeset/short-tomatoes-attend.md +0 -5
  242. package/.changeset/silly-knives-exist.md +0 -5
  243. package/.changeset/silly-seas-confess.md +0 -5
  244. package/.changeset/sixty-bats-cry.md +0 -6
  245. package/.changeset/slimy-chicken-melt.md +0 -5
  246. package/.changeset/slimy-maps-press.md +0 -5
  247. package/.changeset/slow-ravens-explain.md +0 -19
  248. package/.changeset/small-buttons-rhyme.md +0 -5
  249. package/.changeset/small-cycles-rescue.md +0 -5
  250. package/.changeset/small-kids-film.md +0 -14
  251. package/.changeset/small-poems-rest.md +0 -5
  252. package/.changeset/smart-rats-explode.md +0 -5
  253. package/.changeset/smooth-coins-collect.md +0 -5
  254. package/.changeset/smooth-pens-reply.md +0 -7
  255. package/.changeset/soft-mails-clean.md +0 -5
  256. package/.changeset/sour-kids-deliver.md +0 -5
  257. package/.changeset/sour-pillows-guess.md +0 -7
  258. package/.changeset/spotty-mugs-poke.md +0 -5
  259. package/.changeset/strange-seahorses-impress.md +0 -17
  260. package/.changeset/strong-rivers-fry.md +0 -34
  261. package/.changeset/stupid-pumpkins-travel.md +0 -13
  262. package/.changeset/swift-rivers-share.md +0 -13
  263. package/.changeset/tall-bikes-develop.md +0 -5
  264. package/.changeset/tall-cups-suffer.md +0 -13
  265. package/.changeset/tame-doors-shop.md +0 -14
  266. package/.changeset/tame-points-work.md +0 -11
  267. package/.changeset/tender-swans-flash.md +0 -16
  268. package/.changeset/thick-books-grin.md +0 -5
  269. package/.changeset/thin-peas-hear.md +0 -16
  270. package/.changeset/thirty-pens-jump.md +0 -5
  271. package/.changeset/tidy-pandas-punch.md +0 -5
  272. package/.changeset/tidy-squids-poke.md +0 -12
  273. package/.changeset/tough-rockets-allow.md +0 -5
  274. package/.changeset/tough-taxis-smoke.md +0 -7
  275. package/.changeset/tough-tips-drop.md +0 -15
  276. package/.changeset/tricky-tables-shave.md +0 -5
  277. package/.changeset/twenty-snakes-sort.md +0 -7
  278. package/.changeset/unlucky-kiwis-sell.md +0 -5
  279. package/.changeset/unlucky-sheep-change.md +0 -5
  280. package/.changeset/warm-ties-sit.md +0 -7
  281. package/.changeset/wicked-forks-double.md +0 -33
  282. package/.changeset/wicked-kiwis-buy.md +0 -5
  283. package/.changeset/witty-paws-marry.md +0 -26
  284. package/.changeset/yellow-cats-judge.md +0 -13
  285. package/.changeset/young-phones-fold.md +0 -5
  286. package/.changeset/young-snails-grin.md +0 -5
  287. package/.changeset/young-turtles-explode.md +0 -5
  288. package/__cjs/masking/__benches__/types.bench.cjs +0 -223
  289. package/__cjs/masking/__benches__/types.bench.cjs.map +0 -1
  290. package/__cjs/masking/__benches__/types.bench.d.cts +0 -2
  291. package/__cjs/testing/core/index.cjs +0 -20
  292. package/__cjs/testing/core/index.cjs.map +0 -1
  293. package/__cjs/testing/core/index.d.cts +0 -7
  294. package/__cjs/testing/core/mocking/mockClient.cjs +0 -17
  295. package/__cjs/testing/core/mocking/mockClient.cjs.map +0 -1
  296. package/__cjs/testing/core/mocking/mockClient.d.cts +0 -4
  297. package/__cjs/testing/core/wait.cjs +0 -11
  298. package/__cjs/testing/core/wait.cjs.map +0 -1
  299. package/__cjs/testing/core/wait.d.cts +0 -3
  300. package/__cjs/testing/core/withConsoleSpy.cjs +0 -33
  301. package/__cjs/testing/core/withConsoleSpy.cjs.map +0 -1
  302. package/__cjs/testing/core/withConsoleSpy.d.cts +0 -7
  303. package/__cjs/testing/internal/ObservableStream.cjs +0 -110
  304. package/__cjs/testing/internal/ObservableStream.cjs.map +0 -1
  305. package/__cjs/testing/internal/ObservableStream.d.cts +0 -39
  306. package/__cjs/testing/internal/disposables/enableFakeTimers.cjs +0 -19
  307. package/__cjs/testing/internal/disposables/enableFakeTimers.cjs.map +0 -1
  308. package/__cjs/testing/internal/disposables/enableFakeTimers.d.cts +0 -7
  309. package/__cjs/testing/internal/disposables/index.cjs +0 -12
  310. package/__cjs/testing/internal/disposables/index.cjs.map +0 -1
  311. package/__cjs/testing/internal/disposables/index.d.cts +0 -5
  312. package/__cjs/testing/internal/disposables/spyOnConsole.cjs +0 -24
  313. package/__cjs/testing/internal/disposables/spyOnConsole.cjs.map +0 -1
  314. package/__cjs/testing/internal/disposables/spyOnConsole.d.cts +0 -8
  315. package/__cjs/testing/internal/disposables/withCleanup.cjs +0 -22
  316. package/__cjs/testing/internal/disposables/withCleanup.cjs.map +0 -1
  317. package/__cjs/testing/internal/disposables/withCleanup.d.cts +0 -7
  318. package/__cjs/testing/internal/disposables/withProdMode.cjs +0 -17
  319. package/__cjs/testing/internal/disposables/withProdMode.cjs.map +0 -1
  320. package/__cjs/testing/internal/disposables/withProdMode.d.cts +0 -4
  321. package/__cjs/testing/internal/incremental.cjs +0 -124
  322. package/__cjs/testing/internal/incremental.cjs.map +0 -1
  323. package/__cjs/testing/internal/incremental.d.cts +0 -16
  324. package/__cjs/testing/internal/index.cjs +0 -34
  325. package/__cjs/testing/internal/index.cjs.map +0 -1
  326. package/__cjs/testing/internal/index.d.cts +0 -12
  327. package/__cjs/testing/internal/link.cjs +0 -22
  328. package/__cjs/testing/internal/link.cjs.map +0 -1
  329. package/__cjs/testing/internal/link.d.cts +0 -6
  330. package/__cjs/testing/internal/messageChannelPolyfill.cjs +0 -18
  331. package/__cjs/testing/internal/messageChannelPolyfill.cjs.map +0 -1
  332. package/__cjs/testing/internal/messageChannelPolyfill.d.cts +0 -2
  333. package/__cjs/testing/internal/renderHelpers.cjs +0 -21
  334. package/__cjs/testing/internal/renderHelpers.cjs.map +0 -1
  335. package/__cjs/testing/internal/renderHelpers.d.cts +0 -14
  336. package/__cjs/testing/internal/resetApolloContext.cjs +0 -24
  337. package/__cjs/testing/internal/resetApolloContext.cjs.map +0 -1
  338. package/__cjs/testing/internal/resetApolloContext.d.cts +0 -10
  339. package/__cjs/testing/internal/rtl/actAsync.cjs +0 -18
  340. package/__cjs/testing/internal/rtl/actAsync.cjs.map +0 -1
  341. package/__cjs/testing/internal/rtl/actAsync.d.cts +0 -2
  342. package/__cjs/testing/internal/rtl/renderAsync.cjs +0 -15
  343. package/__cjs/testing/internal/rtl/renderAsync.cjs.map +0 -1
  344. package/__cjs/testing/internal/rtl/renderAsync.d.cts +0 -9
  345. package/__cjs/testing/internal/rtl/renderHookAsync.cjs +0 -37
  346. package/__cjs/testing/internal/rtl/renderHookAsync.cjs.map +0 -1
  347. package/__cjs/testing/internal/rtl/renderHookAsync.d.cts +0 -8
  348. package/__cjs/testing/internal/scenarios/index.cjs +0 -104
  349. package/__cjs/testing/internal/scenarios/index.cjs.map +0 -1
  350. package/__cjs/testing/internal/scenarios/index.d.cts +0 -83
  351. package/__cjs/testing/matchers/arrayWithLength.cjs +0 -15
  352. package/__cjs/testing/matchers/arrayWithLength.cjs.map +0 -1
  353. package/__cjs/testing/matchers/arrayWithLength.d.cts +0 -3
  354. package/__cjs/testing/matchers/index.cjs +0 -31
  355. package/__cjs/testing/matchers/index.cjs.map +0 -1
  356. package/__cjs/testing/matchers/index.d.cts +0 -2
  357. package/__cjs/testing/matchers/isSameClient.cjs +0 -19
  358. package/__cjs/testing/matchers/isSameClient.cjs.map +0 -1
  359. package/__cjs/testing/matchers/isSameClient.d.cts +0 -3
  360. package/__cjs/testing/matchers/isSameObservableQuery.cjs +0 -19
  361. package/__cjs/testing/matchers/isSameObservableQuery.cjs.map +0 -1
  362. package/__cjs/testing/matchers/isSameObservableQuery.d.cts +0 -3
  363. package/__cjs/testing/matchers/toBeDisposed.cjs +0 -20
  364. package/__cjs/testing/matchers/toBeDisposed.cjs.map +0 -1
  365. package/__cjs/testing/matchers/toBeDisposed.d.cts +0 -3
  366. package/__cjs/testing/matchers/toBeGarbageCollected.cjs +0 -43
  367. package/__cjs/testing/matchers/toBeGarbageCollected.cjs.map +0 -1
  368. package/__cjs/testing/matchers/toBeGarbageCollected.d.cts +0 -8
  369. package/__cjs/testing/matchers/toComplete.cjs +0 -30
  370. package/__cjs/testing/matchers/toComplete.cjs.map +0 -1
  371. package/__cjs/testing/matchers/toComplete.d.cts +0 -4
  372. package/__cjs/testing/matchers/toEmitAnything.cjs +0 -33
  373. package/__cjs/testing/matchers/toEmitAnything.cjs.map +0 -1
  374. package/__cjs/testing/matchers/toEmitAnything.d.cts +0 -4
  375. package/__cjs/testing/matchers/toEmitError.cjs +0 -46
  376. package/__cjs/testing/matchers/toEmitError.cjs.map +0 -1
  377. package/__cjs/testing/matchers/toEmitError.d.cts +0 -7
  378. package/__cjs/testing/matchers/toEmitNext.cjs +0 -30
  379. package/__cjs/testing/matchers/toEmitNext.cjs.map +0 -1
  380. package/__cjs/testing/matchers/toEmitNext.d.cts +0 -4
  381. package/__cjs/testing/matchers/toEmitTypedValue.cjs +0 -42
  382. package/__cjs/testing/matchers/toEmitTypedValue.cjs.map +0 -1
  383. package/__cjs/testing/matchers/toEmitTypedValue.d.cts +0 -12
  384. package/__cjs/testing/matchers/toHaveSuspenseCacheEntryUsing.cjs +0 -26
  385. package/__cjs/testing/matchers/toHaveSuspenseCacheEntryUsing.cjs.map +0 -1
  386. package/__cjs/testing/matchers/toHaveSuspenseCacheEntryUsing.d.cts +0 -11
  387. package/__cjs/testing/matchers/toMatchDocument.cjs +0 -37
  388. package/__cjs/testing/matchers/toMatchDocument.cjs.map +0 -1
  389. package/__cjs/testing/matchers/toMatchDocument.d.cts +0 -4
  390. package/__cjs/testing/matchers/toRerenderWithSimilarSnapshot.cjs +0 -65
  391. package/__cjs/testing/matchers/toRerenderWithSimilarSnapshot.cjs.map +0 -1
  392. package/__cjs/testing/matchers/toRerenderWithSimilarSnapshot.d.cts +0 -20
  393. package/__cjs/testing/matchers/toStrictEqualTyped.cjs +0 -32
  394. package/__cjs/testing/matchers/toStrictEqualTyped.cjs.map +0 -1
  395. package/__cjs/testing/matchers/toStrictEqualTyped.d.cts +0 -12
  396. package/__cjs/testing/matchers/utils/getSerializableProperties.cjs +0 -36
  397. package/__cjs/testing/matchers/utils/getSerializableProperties.cjs.map +0 -1
  398. package/__cjs/testing/matchers/utils/getSerializableProperties.d.cts +0 -4
  399. package/__cjs/utilities/internal/types/DeepPartial.cjs.map +0 -1
  400. package/legacyEntryPoints/testing/core/core.cjs +0 -1
  401. package/legacyEntryPoints/testing/core/core.d.cts +0 -1
  402. package/legacyEntryPoints/testing/core/index.d.ts +0 -1
  403. package/legacyEntryPoints/testing/core/index.js +0 -1
  404. package/legacyEntryPoints/testing/internal/index.d.ts +0 -1
  405. package/legacyEntryPoints/testing/internal/index.js +0 -1
  406. package/legacyEntryPoints/testing/internal/internal.cjs +0 -1
  407. package/legacyEntryPoints/testing/internal/internal.d.cts +0 -1
  408. package/masking/__benches__/types.bench.d.ts +0 -2
  409. package/masking/__benches__/types.bench.js +0 -221
  410. package/masking/__benches__/types.bench.js.map +0 -1
  411. package/testing/core/index.d.ts +0 -7
  412. package/testing/core/index.js +0 -6
  413. package/testing/core/index.js.map +0 -1
  414. package/testing/core/mocking/mockClient.d.ts +0 -4
  415. package/testing/core/mocking/mockClient.js +0 -14
  416. package/testing/core/mocking/mockClient.js.map +0 -1
  417. package/testing/core/wait.d.ts +0 -3
  418. package/testing/core/wait.js +0 -7
  419. package/testing/core/wait.js.map +0 -1
  420. package/testing/core/withConsoleSpy.d.ts +0 -7
  421. package/testing/core/withConsoleSpy.js +0 -28
  422. package/testing/core/withConsoleSpy.js.map +0 -1
  423. package/testing/internal/ObservableStream.d.ts +0 -39
  424. package/testing/internal/ObservableStream.js +0 -105
  425. package/testing/internal/ObservableStream.js.map +0 -1
  426. package/testing/internal/disposables/enableFakeTimers.d.ts +0 -7
  427. package/testing/internal/disposables/enableFakeTimers.js +0 -16
  428. package/testing/internal/disposables/enableFakeTimers.js.map +0 -1
  429. package/testing/internal/disposables/index.d.ts +0 -5
  430. package/testing/internal/disposables/index.js +0 -5
  431. package/testing/internal/disposables/index.js.map +0 -1
  432. package/testing/internal/disposables/spyOnConsole.d.ts +0 -8
  433. package/testing/internal/disposables/spyOnConsole.js +0 -21
  434. package/testing/internal/disposables/spyOnConsole.js.map +0 -1
  435. package/testing/internal/disposables/withCleanup.d.ts +0 -7
  436. package/testing/internal/disposables/withCleanup.js +0 -19
  437. package/testing/internal/disposables/withCleanup.js.map +0 -1
  438. package/testing/internal/disposables/withProdMode.d.ts +0 -4
  439. package/testing/internal/disposables/withProdMode.js +0 -13
  440. package/testing/internal/disposables/withProdMode.js.map +0 -1
  441. package/testing/internal/incremental.d.ts +0 -16
  442. package/testing/internal/incremental.js +0 -120
  443. package/testing/internal/incremental.js.map +0 -1
  444. package/testing/internal/index.d.ts +0 -12
  445. package/testing/internal/index.js +0 -11
  446. package/testing/internal/index.js.map +0 -1
  447. package/testing/internal/link.d.ts +0 -6
  448. package/testing/internal/link.js +0 -18
  449. package/testing/internal/link.js.map +0 -1
  450. package/testing/internal/messageChannelPolyfill.d.ts +0 -2
  451. package/testing/internal/messageChannelPolyfill.js +0 -16
  452. package/testing/internal/messageChannelPolyfill.js.map +0 -1
  453. package/testing/internal/renderHelpers.d.ts +0 -14
  454. package/testing/internal/renderHelpers.js +0 -16
  455. package/testing/internal/renderHelpers.js.map +0 -1
  456. package/testing/internal/resetApolloContext.d.ts +0 -10
  457. package/testing/internal/resetApolloContext.js +0 -20
  458. package/testing/internal/resetApolloContext.js.map +0 -1
  459. package/testing/internal/rtl/actAsync.d.ts +0 -2
  460. package/testing/internal/rtl/actAsync.js +0 -14
  461. package/testing/internal/rtl/actAsync.js.map +0 -1
  462. package/testing/internal/rtl/renderAsync.d.ts +0 -9
  463. package/testing/internal/rtl/renderAsync.js +0 -12
  464. package/testing/internal/rtl/renderAsync.js.map +0 -1
  465. package/testing/internal/rtl/renderHookAsync.d.ts +0 -8
  466. package/testing/internal/rtl/renderHookAsync.js +0 -33
  467. package/testing/internal/rtl/renderHookAsync.js.map +0 -1
  468. package/testing/internal/scenarios/index.d.ts +0 -83
  469. package/testing/internal/scenarios/index.js +0 -97
  470. package/testing/internal/scenarios/index.js.map +0 -1
  471. package/testing/matchers/arrayWithLength.d.ts +0 -3
  472. package/testing/matchers/arrayWithLength.js +0 -11
  473. package/testing/matchers/arrayWithLength.js.map +0 -1
  474. package/testing/matchers/index.d.ts +0 -2
  475. package/testing/matchers/index.js +0 -29
  476. package/testing/matchers/index.js.map +0 -1
  477. package/testing/matchers/isSameClient.d.ts +0 -3
  478. package/testing/matchers/isSameClient.js +0 -15
  479. package/testing/matchers/isSameClient.js.map +0 -1
  480. package/testing/matchers/isSameObservableQuery.d.ts +0 -3
  481. package/testing/matchers/isSameObservableQuery.js +0 -15
  482. package/testing/matchers/isSameObservableQuery.js.map +0 -1
  483. package/testing/matchers/toBeDisposed.d.ts +0 -3
  484. package/testing/matchers/toBeDisposed.js +0 -16
  485. package/testing/matchers/toBeDisposed.js.map +0 -1
  486. package/testing/matchers/toBeGarbageCollected.d.ts +0 -8
  487. package/testing/matchers/toBeGarbageCollected.js +0 -39
  488. package/testing/matchers/toBeGarbageCollected.js.map +0 -1
  489. package/testing/matchers/toComplete.d.ts +0 -4
  490. package/testing/matchers/toComplete.js +0 -26
  491. package/testing/matchers/toComplete.js.map +0 -1
  492. package/testing/matchers/toEmitAnything.d.ts +0 -4
  493. package/testing/matchers/toEmitAnything.js +0 -29
  494. package/testing/matchers/toEmitAnything.js.map +0 -1
  495. package/testing/matchers/toEmitError.d.ts +0 -7
  496. package/testing/matchers/toEmitError.js +0 -42
  497. package/testing/matchers/toEmitError.js.map +0 -1
  498. package/testing/matchers/toEmitNext.d.ts +0 -4
  499. package/testing/matchers/toEmitNext.js +0 -26
  500. package/testing/matchers/toEmitNext.js.map +0 -1
  501. package/testing/matchers/toEmitTypedValue.d.ts +0 -12
  502. package/testing/matchers/toEmitTypedValue.js +0 -38
  503. package/testing/matchers/toEmitTypedValue.js.map +0 -1
  504. package/testing/matchers/toHaveSuspenseCacheEntryUsing.d.ts +0 -11
  505. package/testing/matchers/toHaveSuspenseCacheEntryUsing.js +0 -22
  506. package/testing/matchers/toHaveSuspenseCacheEntryUsing.js.map +0 -1
  507. package/testing/matchers/toMatchDocument.d.ts +0 -4
  508. package/testing/matchers/toMatchDocument.js +0 -33
  509. package/testing/matchers/toMatchDocument.js.map +0 -1
  510. package/testing/matchers/toRerenderWithSimilarSnapshot.d.ts +0 -20
  511. package/testing/matchers/toRerenderWithSimilarSnapshot.js +0 -62
  512. package/testing/matchers/toRerenderWithSimilarSnapshot.js.map +0 -1
  513. package/testing/matchers/toStrictEqualTyped.d.ts +0 -12
  514. package/testing/matchers/toStrictEqualTyped.js +0 -28
  515. package/testing/matchers/toStrictEqualTyped.js.map +0 -1
  516. package/testing/matchers/utils/getSerializableProperties.d.ts +0 -4
  517. package/testing/matchers/utils/getSerializableProperties.js +0 -33
  518. package/testing/matchers/utils/getSerializableProperties.js.map +0 -1
  519. package/utilities/internal/types/DeepPartial.js.map +0 -1
  520. /package/__cjs/utilities/{internal/types/DeepPartial.cjs → DeepPartial.cjs} +0 -0
  521. /package/utilities/{internal/types/DeepPartial.js → DeepPartial.js} +0 -0
@@ -1,22 +0,0 @@
1
- ---
2
- "@apollo/client": minor
3
- ---
4
-
5
- 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.
6
-
7
- ```ts
8
- import { realisticDelay } from '@apollo/client/testing';
9
-
10
- new MockLink([
11
- {
12
- request: { query },
13
- result: { data: { greeting: 'Hello' }},
14
- delay: realisticDelay()
15
- },
16
- {
17
- request: { query },
18
- result: { data: { greeting: 'Hello' }},
19
- delay: realisticDelay({ min: 10, max: 100 })
20
- },
21
- ]);
22
- ```
@@ -1,15 +0,0 @@
1
- ---
2
- "@apollo/client": major
3
- ---
4
-
5
- `ObservableQuery.setOptions` has been removed as it was an alias of `reobserve`. Prefer using `reobserve` directly instead.
6
-
7
- ```diff
8
- const observable = client.watchQuery(options);
9
-
10
- // Use reobserve to set new options and reevaluate the query
11
- - observable.setOptions(newOptions);
12
- + observable.reobserve(newOptions);
13
- ```
14
-
15
- 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.
@@ -1,5 +0,0 @@
1
- ---
2
- "@apollo/client": major
3
- ---
4
-
5
- Remove `variables` from the result returned from `useSubscription`.
@@ -1,5 +0,0 @@
1
- ---
2
- "@apollo/client": major
3
- ---
4
-
5
- The `previousData` property on `useLazyQuery` will now change only when `data` changes. Previously `previousData` would change to the same value as `data` while the query was loading.
@@ -1,6 +0,0 @@
1
- ---
2
- "@apollo/client": major
3
- ---
4
-
5
- `ObservableQuery` will now keep previous `data` around when emitting a `loading` state, unless `query` or `variables` changed.
6
- Note that `@exports` variables are not taken into account for this, so `data` will stay around even if they change.
@@ -1,5 +0,0 @@
1
- ---
2
- "@apollo/client": major
3
- ---
4
-
5
- Remove deprecated `partialRefetch` option.
@@ -1,5 +0,0 @@
1
- ---
2
- "@apollo/client": major
3
- ---
4
-
5
- Calling `refetch` with new variables will now set the `networkStatus` to `refetch` instead of `setVariables`.
@@ -1,5 +0,0 @@
1
- ---
2
- "@apollo/client": major
3
- ---
4
-
5
- Subscriptions now emit a `SubscribeResult` instead of a `FetchResult`. As a result, the `errors` field has been removed in favor of `error`.
@@ -1,5 +0,0 @@
1
- ---
2
- "@apollo/client": patch
3
- ---
4
-
5
- The returned `networkStatus` in `useLazyQuery` is now set to `setVariables` when calling the `useLazyQuery` `execute` function for the first time with variables.
@@ -1,24 +0,0 @@
1
- ---
2
- "@apollo/client": minor
3
- ---
4
-
5
- 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.
6
-
7
- This change applies to the following error types:
8
- - `CombinedGraphQLErrors`
9
- - `CombinedProtocolErrors`
10
- - `ServerError`
11
- - `ServerParseError`
12
- - `UnconventionalError`
13
-
14
- **Example**
15
-
16
- ```ts
17
- import { CombinedGraphQLErrors } from "@apollo/client";
18
-
19
- if (CombinedGraphQLErrors.is(error)) {
20
- console.log(error.message);
21
- error.errors.forEach((graphQLError) => console.log(graphQLError.message))
22
- }
23
- ```
24
-
@@ -1,5 +0,0 @@
1
- ---
2
- "@apollo/client": major
3
- ---
4
-
5
- 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.
@@ -1,5 +0,0 @@
1
- ---
2
- "@apollo/client": major
3
- ---
4
-
5
- Remove the `iterateObserversSafely` utility function.
@@ -1,5 +0,0 @@
1
- ---
2
- "@apollo/client": major
3
- ---
4
-
5
- Remove the `@apollo/client/testing/experimental` test utilities. Use [GraphQL Testing Library](https://github.com/apollographql/graphql-testing-library) instead.
@@ -1,35 +0,0 @@
1
- ---
2
- "@apollo/client": minor
3
- ---
4
-
5
- Revamp local resolvers and fix several issues from the existing `resolvers` option.
6
- - Throwing errors in a resolver will set the field value as `null` and add an error to the response's `errors` array.
7
- - Remote results are dealiased before they are passed as the parent object to a resolver so that you can access fields by their field name.
8
- - You can now specify a `context` function that you can use to customize the `requestContext` given to resolvers.
9
- - The `LocalState` class accepts a `Resolvers` generic that provides autocompletion and type checking against your resolver types to ensure your resolvers are type-safe.
10
- - `data: null` is now handled correctly and does not call your local resolvers when the server does not provide a result.
11
- - Additional warnings have been added to provide hints when resolvers behave unexpectedly.
12
-
13
- ```ts
14
- import { LocalState } from "@apollo/client/local-state";
15
-
16
- import { Resolvers } from "./path/to/local-resolvers-types.ts";
17
-
18
- // LocalState now accepts a `Resolvers` generic.
19
- const localState = new LocalState<Resolvers>({
20
- // The return value of this funciton
21
- context: (options) => ({
22
- // ...
23
- }),
24
- resolvers: {
25
- // ...
26
- }
27
- });
28
-
29
- // You may also pass a `ContextValue` generic used to ensure the `context`
30
- // function returns the correct type. This type is inferred from your resolvers
31
- // if not provided.
32
- new LocalState<Resolvers, ContextValue>({
33
- // ...
34
- });
35
- ```
@@ -1,16 +0,0 @@
1
- ---
2
- "@apollo/client": major
3
- ---
4
-
5
- `ssrMode`, `ssrForceFetchDelay` and `disableNetworkFetches` have been reworked:
6
-
7
- Previously, a `ObservableQuery` created by `client.query` or `client.watchQuery`
8
- while one of those were active would permanently be changed from a `fetchPolicy`
9
- of `"network-only"` or `"cache-and-network"` to `"cache-first"`, and stay that way
10
- even long after `disableNetworkFetches` would have been deactivated.
11
-
12
- Now, the `ObservableQuery` will keep their original `fetchPolicy`, but queries
13
- made during `disableNetworkFetches` will just apply the `fetchPolicy` replacement
14
- at request time, just for that one request.
15
-
16
- `ApolloClient.disableNetworkFetches` has been renamed to `ApolloClient.prioritizeCacheValues` to better reflect this behaviour.
@@ -1,5 +0,0 @@
1
- ---
2
- "@apollo/client": major
3
- ---
4
-
5
- `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.
@@ -1,5 +0,0 @@
1
- ---
2
- "@apollo/client": patch
3
- ---
4
-
5
- Remove code that strips `@client` fields in `HttpLink` and `BatchHttpLink`. This was unused code since core handles removing `@client` fields and should have no observable change.
@@ -1,5 +0,0 @@
1
- ---
2
- "@apollo/client": patch
3
- ---
4
-
5
- Ensure `ObservableQuery` stops polling if switching to a `standby` `fetchPolicy`. When switching back to a non-`standby` `fetchPolicy`, polling will resume.
@@ -1,5 +0,0 @@
1
- ---
2
- "@apollo/client": major
3
- ---
4
-
5
- `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.
@@ -1,5 +0,0 @@
1
- ---
2
- "@apollo/client": major
3
- ---
4
-
5
- The `cache` and `forceFetch` properties are no longer available on context when calling `operation.getContext()`. `cache` can be accessed through the `operation` with `operation.client.cache` instead. `forceFetch` has been replaced with `queryDeduplication` which specifies whether `queryDeduplication` was enabled for the request or not.
@@ -1,5 +0,0 @@
1
- ---
2
- "@apollo/client": major
3
- ---
4
-
5
- Remove the `onError` and `setOnError` methods from `ApolloLink`. `onError` was only used by `MockLink` to rewrite errors if `setOnError` was used.
@@ -1,5 +0,0 @@
1
- ---
2
- "@apollo/client": major
3
- ---
4
-
5
- Throw an error for queries and mutations if the link chain completes without emitting a value.
@@ -1,5 +0,0 @@
1
- ---
2
- "@apollo/client": major
3
- ---
4
-
5
- Removed `getLastResult`, `getLastError` and `resetLastResults` from `ObservableQuery`
@@ -1,113 +0,0 @@
1
- ---
2
- "@apollo/client": major
3
- ---
4
-
5
- Apollo Client no longer wraps errors in `ApolloError`. `ApolloError` has been replaced with separate error classes depending on the cause of the error. As such, APIs that return an `error` property have been updated to use the generic `Error` type. Use `instanceof` to check for more specific error types.
6
-
7
- ## Migration guide
8
-
9
- `ApolloError` encapsulated 4 main error properties. The type of error would determine which property was set:
10
- - `graphqlErrors` - Errors returned from the `errors` field by the GraphQL server
11
- - `networkError` - Any non-GraphQL error that caused the query to fail
12
- - `protocolErrors` - Transport-level errors that occur during [multipart HTTP subscriptions](https://www.apollographql.com/docs/graphos/routing/operations/subscriptions/multipart-protocol)
13
- - `clientErrors` - A space to define custom errors. Mostly unused.
14
-
15
- These errors were mutally exclusive, meaning both `networkError` and `graphqlErrors` were never set simultaneously. The following replaces each of these fields from `ApolloError`.
16
-
17
- ### `graphqlErrors`
18
-
19
- GraphQL errors are now encapsulated in a `CombinedGraphQLErrors` instance. You can access the raw GraphQL errors via the `errors` property.
20
-
21
- ```js
22
- import { CombinedGraphQLErrors } from '@apollo/client';
23
-
24
- // ...
25
-
26
- const { error } = useQuery(query);
27
-
28
- if (error && error instanceof CombinedGraphQLErrors) {
29
- console.log(error.errors);
30
- }
31
- ```
32
-
33
- ### `networkError`
34
-
35
- Network errors are no longer wrapped and are instead passed through directly.
36
-
37
- ```js
38
- const client = new ApolloClient({
39
- link: new ApolloLink(() => {
40
- return new Observable((observer) => {
41
- observer.error(new Error('Test error'));
42
- })
43
- })
44
- })
45
-
46
- // ...
47
-
48
- const { error } = useQuery(query);
49
-
50
- // error is `new Error('Test error')`;
51
- ```
52
-
53
- ### `protocolErrors`
54
-
55
- Protocol errors are now encapsulated in a `CombinedProtocolErrors` instance. You can access the raw protocol errors via the `errors` property.
56
-
57
-
58
- ```js
59
- import { CombinedProtocolErrors } from '@apollo/client';
60
-
61
- // ...
62
-
63
- const { error } = useSubscription(subscription);
64
-
65
- if (error && error instanceof CombinedProtocolErrors) {
66
- console.log(error.errors);
67
- }
68
- ```
69
-
70
- ### `clientErrors`
71
-
72
- These were unused by the client and have no replacement. Any non-GraphQL or non-protocol errors are now passed through unwrapped.
73
-
74
- ### Strings as errors
75
-
76
- If the link sends a string error, Apollo Client will wrap this in an `Error` instance. This ensures `error` properties are guaranteed to be of type `Error`.
77
-
78
- ```js
79
- const client = new ApolloClient({
80
- link: new ApolloLink(() => {
81
- return new Observable((observer) => {
82
- // Oops we sent a string instead of wrapping it in an `Error`
83
- observer.error('Test error');
84
- })
85
- })
86
- })
87
-
88
- // ...
89
-
90
- const { error } = useQuery(query);
91
-
92
- // The error string is wrapped and returned as `new Error('Test error')`;
93
- ```
94
-
95
- ### Non-error types
96
-
97
- If the link chain sends any other object type as an error, Apollo Client will wrap this in an `UnknownError` instance with the [`cause`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error/cause) set to the original object. This ensures `error` properties are guaranteed to be of type `Error`.
98
-
99
- ```js
100
- const client = new ApolloClient({
101
- link: new ApolloLink(() => {
102
- return new Observable((observer) => {
103
- observer.error({ message: 'Not a proper error type' });
104
- })
105
- })
106
- })
107
-
108
- // ...
109
-
110
- const { error } = useQuery(query);
111
-
112
- // error is an `UnknownError` instance. error.cause returns the original object.
113
- ```
@@ -1,5 +0,0 @@
1
- ---
2
- "@apollo/client": major
3
- ---
4
-
5
- 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.
@@ -1,15 +0,0 @@
1
- ---
2
- "@apollo/client": patch
3
- ---
4
-
5
- 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.
6
-
7
- This change affects the following APIs:
8
- - `client.query`
9
- - `client.mutate`
10
- - `client.subscribe`
11
- - `client.watchQuery`
12
- - `useBackgroundQuery`
13
- - `useQuery`
14
- - `useSubscription`
15
- - `useSuspenseQuery`
@@ -1,5 +0,0 @@
1
- ---
2
- "@apollo/client": major
3
- ---
4
-
5
- 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`.
@@ -1,5 +0,0 @@
1
- ---
2
- "@apollo/client": major
3
- ---
4
-
5
- Remove `fromError` utility function. Use [`throwError`](https://rxjs.dev/api/index/function/throwError) instead.
@@ -1,5 +0,0 @@
1
- ---
2
- "@apollo/client": patch
3
- ---
4
-
5
- Default `TVariables` generic type to `OperationVariables` instead of `any` throughout the client in areas that did not yet have the default as such.
@@ -1,5 +0,0 @@
1
- ---
2
- "@apollo/client": major
3
- ---
4
-
5
- Remove the deprecated `graphql`, `withQuery`, `withMutation`, `withSubscription`, and `withApollo` hoc components. Use the provided React hooks instead.
@@ -1,5 +0,0 @@
1
- ---
2
- "@apollo/client": patch
3
- ---
4
-
5
- Fix type of `variables` returned from `useLazyQuery`. When `called` is `false`, `variables` is now `Partial<TVariables>` instead of `TVariables`.
@@ -1,23 +0,0 @@
1
- ---
2
- "@apollo/client": major
3
- ---
4
-
5
- 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`.
6
-
7
- ```ts
8
- // given this query
9
- const query = gql`
10
- query PaginatedQuery($limit: Int! = 10, $offset: Int) {
11
- list(limit: $limit, offset: $offset) {
12
- id
13
- }
14
- }
15
- `
16
-
17
- const observable = client.query({ query, variables: { limit: 5, offset: 0 }});
18
- console.log(observable.variables) // => { limit: 5, offset: 0 }
19
-
20
- observable.reobserve({ variables: { limit: undefined, offset: 10 }})
21
- // limit is now `10`. This would previously be `undefined`
22
- console.log(observable.variables) // => { limit: 10, offset: 10 }
23
- ```
@@ -1,5 +0,0 @@
1
- ---
2
- "@apollo/client": major
3
- ---
4
-
5
- Remove `itAsync` test utility.
@@ -1,5 +0,0 @@
1
- ---
2
- "@apollo/client": patch
3
- ---
4
-
5
- Use an an empty object (`{}`) rather than an object with `null` prototype (`Object.create(null)`) in all areas that instantiate objects.
@@ -1,5 +0,0 @@
1
- ---
2
- "@apollo/client": major
3
- ---
4
-
5
- An initial loading state is now emitted from `ObservableQuery` when subscribing if `notifyOnNetworkStatusChange` is set to `true`.
@@ -1,11 +0,0 @@
1
- ---
2
- "@apollo/client": major
3
- ---
4
-
5
- Flatten out React hook types. As a result, the base types have been removed. Prefer using the hook types instead. Removed types include:
6
- - `BaseMutationOptions`
7
- - `BaseQueryOptions`
8
- - `BaseSubscriptionOptions`
9
- - `ObservableQueryFields`
10
- - `MutationSharedOptions`
11
- - `QueryFunctionOptions`
@@ -1,17 +0,0 @@
1
- ---
2
- "@apollo/client": major
3
- ---
4
-
5
- Updates the `ServerError` and `ServerParseError` types to be proper `Error` subclasses. Perviously these were plain `Error` intances with additional properties added at runtime. All properties are retained, but `instanceof` checks now work correctly.
6
-
7
- ```js
8
- import { ServerError, ServerParseError } from '@apollo/client';
9
-
10
- if (error instanceof ServerError) {
11
- // ...
12
- }
13
-
14
- if (error instanceof ServerParseError) {
15
- // ...
16
- }
17
- ```
@@ -1,5 +0,0 @@
1
- ---
2
- "@apollo/client": patch
3
- ---
4
-
5
- Ensure a loading state is emitted when calling the `execute` function after changing clients in `useLazyQuery`.
@@ -1,7 +0,0 @@
1
- ---
2
- "@apollo/client": patch
3
- ---
4
-
5
- * dropped the deprecated `DEV` export from `@apollo/client/utilities` and `@apollo/client/utilities/globals`
6
- * moved the `__DEV__` export from `@apollo/client/utilities/globals` to `@apollo/client/utilities/environment`
7
- * moved the `invariant`, `newInvariantError` and `InvariantError` exports from `@apollo/client/utilities/globals` to `@apollo/client/utilities/invariant`
@@ -1,5 +0,0 @@
1
- ---
2
- "@apollo/client": major
3
- ---
4
-
5
- `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.
@@ -1,5 +0,0 @@
1
- ---
2
- "@apollo/client": major
3
- ---
4
-
5
- `useLazyQuery` no longer supports SSR environments and will now throw if the `execute` function is called in SSR. If you need to run a query in an SSR environment, use `useQuery` instead.
@@ -1,16 +0,0 @@
1
- ---
2
- "@apollo/client": minor
3
- ---
4
-
5
- Apollo Client is no longer using `ts-invariant`, but ships with a modified variant of it.
6
-
7
- The existing export `setLogVerbosity` from `@apollo/client` is still available and
8
- now points to this new integration.
9
- **In most cases, you should be using this export.**
10
- It will no longer adjust the verbosity of `ts-invariant` and as such no longer
11
- influence other packages relying on `ts-invariant`.
12
-
13
- The new entry point `@apollo/client/utilities/invariant` now exports `invariant`,
14
- `InvariantError` and `setVerbosity`.
15
- (Note that these tools are mostly meant to be used by Apollo Client and libraries directly
16
- based on Apollo Client like the `@apollo/client-integration-*` packages.)
@@ -1,14 +0,0 @@
1
- ---
2
- "@apollo/client": major
3
- ---
4
-
5
- Removes the `resolvers` option from `ApolloClient`. Local resolvers have instead been moved to the new `LocalState` instance which is assigned to the `localState` option in `ApolloClient`. To migrate, move the `resolvers` values into a `LocalState` instance and assign that instance to `localState`.
6
-
7
- ```diff
8
- new ApolloClient({
9
- - resolvers: { /* ... */ }
10
- + localState: new LocalState({
11
- + resolvers: { /* ... */ }
12
- + }),
13
- });
14
- ```
@@ -1,7 +0,0 @@
1
- ---
2
- "@apollo/client": major
3
- ---
4
-
5
- `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.
6
-
7
- `useMutation` now also returns a `MutateResult` instead of a `FetchResult`.
@@ -1,7 +0,0 @@
1
- ---
2
- "@apollo/client": patch
3
- ---
4
-
5
- `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`).
6
-
7
- 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.
@@ -1,7 +0,0 @@
1
- ---
2
- "@apollo/client": major
3
- ---
4
-
5
- The execute function returned from `useLazyQuery` now only supports the `context` and `variables` options. This means that passing options supported by the hook no longer override the hook value.
6
-
7
- To change options, rerender the component with new options. These options will take effect with the next query execution.
@@ -1,34 +0,0 @@
1
- ---
2
- "@apollo/client": minor
3
- ---
4
-
5
- Provide an extension to define types for `context` passed to the link chain. To define your own types, use [declaration merging](https://www.typescriptlang.org/docs/handbook/declaration-merging.html) to add properties to the `DefaultContext` type.
6
-
7
- ```ts
8
- // @apollo-client.d.ts
9
- // This import is necessary to ensure all Apollo Client imports
10
- // are still available to the rest of the application.
11
- import '@apollo/client';
12
-
13
- declare module "@apollo/client" {
14
- interface DefaultContext extends Record<string, any> {
15
- myProperty: string;
16
- }
17
- }
18
- ```
19
-
20
- Links that provide context options can be used with this type to add those context types to `DefaultContext`. For example, to add context options from `HttpLink`, add the following code:
21
-
22
- ```ts
23
- import { HttpLink } from "@apollo/client";
24
-
25
- declare module "@apollo/client" {
26
- interface DefaultContext extends HttpLink.ContextOptions {
27
- myProperty: string;
28
- }
29
- }
30
- ```
31
-
32
- At this time, the following built-in links support context options:
33
- - `HttpLink.ContextOptions`
34
- - `BatchHttpLink.ContextOptions`
@@ -1,5 +0,0 @@
1
- ---
2
- "@apollo/client": patch
3
- ---
4
-
5
- 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`.
@@ -1,5 +0,0 @@
1
- ---
2
- "@apollo/client": major
3
- ---
4
-
5
- `ObservableQuery` will no longer terminate on errors and will instead emit a `next` value with an `error` property. This ensures that `ObservableQuery` instances can continue to receive updates after errors are returned in requests without the need to resubscribe to the observable.
@@ -1,5 +0,0 @@
1
- ---
2
- "@apollo/client": patch
3
- ---
4
-
5
- Ensure `useLazyQuery` does not return a `partial` property which is not specified by the result type.