@apollo/client 4.0.0-alpha.13 → 4.0.0-alpha.15

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 (671) hide show
  1. package/.changeset/beige-spiders-hope.md +5 -0
  2. package/.changeset/curvy-flies-accept.md +5 -0
  3. package/.changeset/few-crabs-move.md +6 -0
  4. package/.changeset/funny-boats-wink.md +35 -0
  5. package/.changeset/gold-oranges-double.md +5 -0
  6. package/.changeset/little-parrots-bow.md +14 -0
  7. package/.changeset/olive-cougars-ring.md +9 -0
  8. package/.changeset/poor-spiders-hunt.md +23 -0
  9. package/.changeset/pre.json +20 -0
  10. package/.changeset/selfish-spoons-approve.md +44 -0
  11. package/.changeset/serious-items-develop.md +17 -0
  12. package/.changeset/sixty-bats-cry.md +6 -0
  13. package/.changeset/slimy-ants-bake.md +5 -0
  14. package/.changeset/sour-colts-tell.md +5 -0
  15. package/.changeset/sour-guests-poke.md +5 -0
  16. package/.changeset/spotty-mugs-poke.md +5 -0
  17. package/.changeset/strange-walls-march.md +5 -0
  18. package/.changeset/strong-rivers-fry.md +34 -0
  19. package/.changeset/stupid-pumpkins-travel.md +13 -0
  20. package/.changeset/thirty-pens-jump.md +5 -0
  21. package/.changeset/wicked-kiwis-buy.md +5 -0
  22. package/CHANGELOG.md +213 -0
  23. package/__cjs/cache/core/cache.cjs +9 -7
  24. package/__cjs/cache/core/cache.cjs.map +1 -1
  25. package/__cjs/cache/core/cache.d.cts +9 -7
  26. package/__cjs/cache/inmemory/entityStore.cjs +3 -3
  27. package/__cjs/cache/inmemory/inMemoryCache.cjs.map +1 -1
  28. package/__cjs/cache/inmemory/inMemoryCache.d.cts +9 -7
  29. package/__cjs/cache/inmemory/key-extractor.cjs +1 -1
  30. package/__cjs/cache/inmemory/policies.cjs +4 -4
  31. package/__cjs/cache/inmemory/policies.cjs.map +1 -1
  32. package/__cjs/cache/inmemory/readFromStore.cjs +2 -2
  33. package/__cjs/cache/inmemory/readFromStore.cjs.map +1 -1
  34. package/__cjs/cache/inmemory/writeToStore.cjs +4 -4
  35. package/__cjs/cache/inmemory/writeToStore.cjs.map +1 -1
  36. package/__cjs/core/ApolloClient.cjs +23 -45
  37. package/__cjs/core/ApolloClient.cjs.map +1 -1
  38. package/__cjs/core/ApolloClient.d.cts +9 -21
  39. package/__cjs/core/ObservableQuery.cjs +564 -340
  40. package/__cjs/core/ObservableQuery.cjs.map +1 -1
  41. package/__cjs/core/ObservableQuery.d.cts +95 -33
  42. package/__cjs/core/QueryInfo.cjs +109 -179
  43. package/__cjs/core/QueryInfo.cjs.map +1 -1
  44. package/__cjs/core/QueryInfo.d.cts +9 -14
  45. package/__cjs/core/QueryManager.cjs +168 -108
  46. package/__cjs/core/QueryManager.cjs.map +1 -1
  47. package/__cjs/core/QueryManager.d.cts +12 -8
  48. package/__cjs/core/index.cjs +2 -1
  49. package/__cjs/core/index.cjs.map +1 -1
  50. package/__cjs/core/index.d.cts +2 -3
  51. package/__cjs/core/types.d.cts +18 -6
  52. package/__cjs/errors/LinkError.cjs +5 -1
  53. package/__cjs/errors/LinkError.cjs.map +1 -1
  54. package/__cjs/errors/LinkError.d.cts +5 -1
  55. package/__cjs/errors/LocalStateError.cjs +27 -0
  56. package/__cjs/errors/LocalStateError.cjs.map +1 -0
  57. package/__cjs/errors/LocalStateError.d.cts +20 -0
  58. package/__cjs/errors/index.cjs +5 -1
  59. package/__cjs/errors/index.cjs.map +1 -1
  60. package/__cjs/errors/index.d.cts +2 -0
  61. package/__cjs/invariantErrorCodes.cjs +130 -57
  62. package/__cjs/link/core/ApolloLink.cjs +17 -11
  63. package/__cjs/link/core/ApolloLink.cjs.map +1 -1
  64. package/__cjs/link/core/ApolloLink.d.cts +15 -9
  65. package/__cjs/link/http/checkFetcher.cjs +1 -1
  66. package/__cjs/link/http/createHttpLink.cjs +1 -1
  67. package/__cjs/link/http/parseAndCheckHttpResponse.cjs +1 -1
  68. package/__cjs/link/http/serializeFetchParameter.cjs +1 -1
  69. package/__cjs/link/persisted-queries/index.cjs +2 -2
  70. package/__cjs/link/utils/transformOperation.cjs +1 -1
  71. package/__cjs/link/utils/transformOperation.cjs.map +1 -1
  72. package/__cjs/link/utils/validateOperation.cjs +1 -1
  73. package/__cjs/local-state/LocalState.cjs +535 -0
  74. package/__cjs/local-state/LocalState.cjs.map +1 -0
  75. package/__cjs/local-state/LocalState.d.cts +89 -0
  76. package/__cjs/local-state/index.cjs +6 -0
  77. package/__cjs/local-state/index.cjs.map +1 -0
  78. package/__cjs/local-state/index.d.cts +2 -0
  79. package/__cjs/masking/maskFragment.cjs +5 -1
  80. package/__cjs/masking/maskFragment.cjs.map +1 -1
  81. package/__cjs/masking/maskFragment.d.cts +5 -1
  82. package/__cjs/masking/maskOperation.cjs +5 -1
  83. package/__cjs/masking/maskOperation.cjs.map +1 -1
  84. package/__cjs/masking/maskOperation.d.cts +5 -1
  85. package/__cjs/masking/utils.cjs +5 -1
  86. package/__cjs/masking/utils.cjs.map +1 -1
  87. package/__cjs/masking/utils.d.cts +5 -1
  88. package/__cjs/react/hooks/internal/wrapHook.cjs +36 -34
  89. package/__cjs/react/hooks/internal/wrapHook.cjs.map +1 -1
  90. package/__cjs/react/hooks/internal/wrapHook.d.cts +42 -38
  91. package/__cjs/react/hooks/useQuery.cjs +10 -25
  92. package/__cjs/react/hooks/useQuery.cjs.map +1 -1
  93. package/__cjs/react/hooks/useQuery.d.cts +0 -1
  94. package/__cjs/react/internal/cache/QueryReference.cjs +6 -9
  95. package/__cjs/react/internal/cache/QueryReference.cjs.map +1 -1
  96. package/__cjs/react/internal/cache/QueryReference.d.cts +25 -7
  97. package/__cjs/react/ssr/prerenderStatic.cjs +7 -0
  98. package/__cjs/react/ssr/prerenderStatic.cjs.map +1 -1
  99. package/__cjs/react/ssr/useSSRQuery.cjs +11 -2
  100. package/__cjs/react/ssr/useSSRQuery.cjs.map +1 -1
  101. package/__cjs/testing/core/mocking/mockLink.cjs +7 -9
  102. package/__cjs/testing/core/mocking/mockLink.cjs.map +1 -1
  103. package/__cjs/testing/core/mocking/mockLink.d.cts +29 -22
  104. package/__cjs/testing/core/mocking/mockSubscriptionLink.cjs +0 -4
  105. package/__cjs/testing/core/mocking/mockSubscriptionLink.cjs.map +1 -1
  106. package/__cjs/testing/core/mocking/mockSubscriptionLink.d.cts +7 -6
  107. package/__cjs/testing/core/types/deprecated.cjs +3 -0
  108. package/__cjs/testing/core/types/deprecated.cjs.map +1 -0
  109. package/__cjs/testing/core/types/deprecated.d.cts +10 -0
  110. package/__cjs/testing/index.cjs +6 -13
  111. package/__cjs/testing/index.cjs.map +1 -1
  112. package/__cjs/testing/index.d.cts +3 -2
  113. package/__cjs/testing/internal/ObservableStream.cjs +13 -1
  114. package/__cjs/testing/internal/ObservableStream.cjs.map +1 -1
  115. package/__cjs/testing/internal/ObservableStream.d.cts +12 -1
  116. package/__cjs/testing/internal/disposables/withCleanup.cjs +5 -1
  117. package/__cjs/testing/internal/disposables/withCleanup.cjs.map +1 -1
  118. package/__cjs/testing/internal/disposables/withCleanup.d.cts +5 -1
  119. package/__cjs/testing/internal/index.cjs +3 -1
  120. package/__cjs/testing/internal/index.cjs.map +1 -1
  121. package/__cjs/testing/internal/index.d.cts +1 -0
  122. package/__cjs/testing/internal/scenarios/index.cjs +4 -4
  123. package/__cjs/testing/internal/scenarios/index.cjs.map +1 -1
  124. package/__cjs/testing/internal/scenarios/index.d.cts +8 -8
  125. package/__cjs/testing/{core → internal}/wait.cjs +0 -4
  126. package/__cjs/testing/internal/wait.cjs.map +1 -0
  127. package/__cjs/testing/{core → internal}/wait.d.cts +0 -1
  128. package/__cjs/testing/matchers/index.cjs +2 -2
  129. package/__cjs/testing/matchers/index.cjs.map +1 -1
  130. package/__cjs/testing/matchers/toEmitTypedValue.cjs +1 -1
  131. package/__cjs/testing/matchers/toEmitTypedValue.cjs.map +1 -1
  132. package/__cjs/testing/matchers/toEmitTypedValue.d.cts +6 -1
  133. package/__cjs/testing/matchers/toRerenderWithSimilarSnapshot.cjs +31 -18
  134. package/__cjs/testing/matchers/toRerenderWithSimilarSnapshot.cjs.map +1 -1
  135. package/__cjs/testing/matchers/toRerenderWithSimilarSnapshot.d.cts +13 -6
  136. package/__cjs/testing/matchers/toStrictEqualTyped.cjs +1 -1
  137. package/__cjs/testing/matchers/toStrictEqualTyped.cjs.map +1 -1
  138. package/__cjs/testing/matchers/toStrictEqualTyped.d.cts +4 -0
  139. package/__cjs/testing/matchers/utils/getSerializableProperties.cjs +14 -2
  140. package/__cjs/testing/matchers/utils/getSerializableProperties.cjs.map +1 -1
  141. package/__cjs/testing/react/MockedProvider.cjs +4 -4
  142. package/__cjs/testing/react/MockedProvider.cjs.map +1 -1
  143. package/__cjs/testing/react/MockedProvider.d.cts +4 -5
  144. package/__cjs/utilities/graphql/DocumentTransform.cjs +10 -6
  145. package/__cjs/utilities/graphql/DocumentTransform.cjs.map +1 -1
  146. package/__cjs/utilities/graphql/DocumentTransform.d.cts +10 -6
  147. package/__cjs/utilities/internal/DeepMerger.cjs +5 -1
  148. package/__cjs/utilities/internal/DeepMerger.cjs.map +1 -1
  149. package/__cjs/utilities/internal/DeepMerger.d.cts +5 -1
  150. package/__cjs/utilities/internal/argumentsObjectFromField.cjs +5 -1
  151. package/__cjs/utilities/internal/argumentsObjectFromField.cjs.map +1 -1
  152. package/__cjs/utilities/internal/argumentsObjectFromField.d.cts +5 -1
  153. package/__cjs/utilities/internal/caches.cjs +24 -20
  154. package/__cjs/utilities/internal/caches.cjs.map +1 -1
  155. package/__cjs/utilities/internal/caches.d.cts +32 -24
  156. package/__cjs/utilities/internal/canUseDOM.cjs +5 -1
  157. package/__cjs/utilities/internal/canUseDOM.cjs.map +1 -1
  158. package/__cjs/utilities/internal/canUseDOM.d.cts +5 -1
  159. package/__cjs/utilities/internal/checkDocument.cjs +6 -3
  160. package/__cjs/utilities/internal/checkDocument.cjs.map +1 -1
  161. package/__cjs/utilities/internal/checkDocument.d.cts +6 -3
  162. package/__cjs/utilities/internal/cloneDeep.cjs +6 -4
  163. package/__cjs/utilities/internal/cloneDeep.cjs.map +1 -1
  164. package/__cjs/utilities/internal/cloneDeep.d.cts +6 -4
  165. package/__cjs/utilities/internal/compact.cjs +7 -5
  166. package/__cjs/utilities/internal/compact.cjs.map +1 -1
  167. package/__cjs/utilities/internal/compact.d.cts +7 -5
  168. package/__cjs/utilities/internal/createFragmentMap.cjs +7 -4
  169. package/__cjs/utilities/internal/createFragmentMap.cjs.map +1 -1
  170. package/__cjs/utilities/internal/createFragmentMap.d.cts +7 -4
  171. package/__cjs/utilities/internal/createFulfilledPromise.cjs +5 -1
  172. package/__cjs/utilities/internal/createFulfilledPromise.cjs.map +1 -1
  173. package/__cjs/utilities/internal/createFulfilledPromise.d.cts +5 -1
  174. package/__cjs/utilities/internal/createRejectedPromise.cjs +5 -1
  175. package/__cjs/utilities/internal/createRejectedPromise.cjs.map +1 -1
  176. package/__cjs/utilities/internal/createRejectedPromise.d.cts +5 -1
  177. package/__cjs/utilities/internal/dealias.cjs +21 -0
  178. package/__cjs/utilities/internal/dealias.cjs.map +1 -0
  179. package/__cjs/utilities/internal/dealias.d.cts +5 -0
  180. package/__cjs/utilities/internal/decoratePromise.cjs +5 -1
  181. package/__cjs/utilities/internal/decoratePromise.cjs.map +1 -1
  182. package/__cjs/utilities/internal/decoratePromise.d.cts +5 -1
  183. package/__cjs/utilities/internal/deepFreeze.cjs +5 -1
  184. package/__cjs/utilities/internal/deepFreeze.cjs.map +1 -1
  185. package/__cjs/utilities/internal/deepFreeze.d.cts +5 -1
  186. package/__cjs/utilities/internal/filterMap.cjs +31 -0
  187. package/__cjs/utilities/internal/filterMap.cjs.map +1 -0
  188. package/__cjs/utilities/internal/filterMap.d.cts +4 -0
  189. package/__cjs/utilities/internal/getDefaultValues.cjs +5 -1
  190. package/__cjs/utilities/internal/getDefaultValues.cjs.map +1 -1
  191. package/__cjs/utilities/internal/getDefaultValues.d.cts +5 -1
  192. package/__cjs/utilities/internal/getFragmentDefinition.cjs +5 -1
  193. package/__cjs/utilities/internal/getFragmentDefinition.cjs.map +1 -1
  194. package/__cjs/utilities/internal/getFragmentDefinition.d.cts +5 -1
  195. package/__cjs/utilities/internal/getFragmentDefinitions.cjs +5 -1
  196. package/__cjs/utilities/internal/getFragmentDefinitions.cjs.map +1 -1
  197. package/__cjs/utilities/internal/getFragmentDefinitions.d.cts +5 -1
  198. package/__cjs/utilities/internal/getFragmentFromSelection.cjs +5 -1
  199. package/__cjs/utilities/internal/getFragmentFromSelection.cjs.map +1 -1
  200. package/__cjs/utilities/internal/getFragmentFromSelection.d.cts +5 -1
  201. package/__cjs/utilities/internal/getFragmentQueryDocument.cjs +25 -23
  202. package/__cjs/utilities/internal/getFragmentQueryDocument.cjs.map +1 -1
  203. package/__cjs/utilities/internal/getFragmentQueryDocument.d.cts +25 -23
  204. package/__cjs/utilities/internal/getGraphQLErrorsFromResult.cjs +5 -1
  205. package/__cjs/utilities/internal/getGraphQLErrorsFromResult.cjs.map +1 -1
  206. package/__cjs/utilities/internal/getGraphQLErrorsFromResult.d.cts +5 -1
  207. package/__cjs/utilities/internal/getMainDefinition.cjs +8 -6
  208. package/__cjs/utilities/internal/getMainDefinition.cjs.map +1 -1
  209. package/__cjs/utilities/internal/getMainDefinition.d.cts +8 -6
  210. package/__cjs/utilities/internal/getMemoryInternals.cjs +15 -9
  211. package/__cjs/utilities/internal/getMemoryInternals.cjs.map +1 -1
  212. package/__cjs/utilities/internal/getMemoryInternals.d.cts +15 -9
  213. package/__cjs/utilities/internal/getOperationDefinition.cjs +5 -1
  214. package/__cjs/utilities/internal/getOperationDefinition.cjs.map +1 -1
  215. package/__cjs/utilities/internal/getOperationDefinition.d.cts +5 -1
  216. package/__cjs/utilities/internal/getOperationName.cjs +7 -5
  217. package/__cjs/utilities/internal/getOperationName.cjs.map +1 -1
  218. package/__cjs/utilities/internal/getOperationName.d.cts +6 -2
  219. package/__cjs/utilities/internal/getQueryDefinition.cjs +5 -1
  220. package/__cjs/utilities/internal/getQueryDefinition.cjs.map +1 -1
  221. package/__cjs/utilities/internal/getQueryDefinition.d.cts +5 -1
  222. package/__cjs/utilities/internal/getStoreKeyName.cjs +5 -1
  223. package/__cjs/utilities/internal/getStoreKeyName.cjs.map +1 -1
  224. package/__cjs/utilities/internal/getStoreKeyName.d.cts +5 -1
  225. package/__cjs/utilities/internal/graphQLResultHasError.cjs +5 -1
  226. package/__cjs/utilities/internal/graphQLResultHasError.cjs.map +1 -1
  227. package/__cjs/utilities/internal/graphQLResultHasError.d.cts +5 -1
  228. package/__cjs/utilities/internal/hasDirectives.cjs +5 -1
  229. package/__cjs/utilities/internal/hasDirectives.cjs.map +1 -1
  230. package/__cjs/utilities/internal/hasDirectives.d.cts +5 -1
  231. package/__cjs/utilities/internal/hasForcedResolvers.cjs +23 -0
  232. package/__cjs/utilities/internal/hasForcedResolvers.cjs.map +1 -0
  233. package/__cjs/utilities/internal/hasForcedResolvers.d.cts +3 -0
  234. package/__cjs/utilities/internal/index.cjs +8 -4
  235. package/__cjs/utilities/internal/index.cjs.map +1 -1
  236. package/__cjs/utilities/internal/index.d.cts +3 -1
  237. package/__cjs/utilities/internal/isArray.cjs +6 -4
  238. package/__cjs/utilities/internal/isArray.cjs.map +1 -1
  239. package/__cjs/utilities/internal/isArray.d.cts +6 -4
  240. package/__cjs/utilities/internal/isDocumentNode.cjs +5 -1
  241. package/__cjs/utilities/internal/isDocumentNode.cjs.map +1 -1
  242. package/__cjs/utilities/internal/isDocumentNode.d.cts +5 -1
  243. package/__cjs/utilities/internal/isExecutionPatchIncrementalResult.cjs +5 -1
  244. package/__cjs/utilities/internal/isExecutionPatchIncrementalResult.cjs.map +1 -1
  245. package/__cjs/utilities/internal/isExecutionPatchIncrementalResult.d.cts +5 -1
  246. package/__cjs/utilities/internal/isExecutionPatchIninitialResult.cjs +5 -1
  247. package/__cjs/utilities/internal/isExecutionPatchIninitialResult.cjs.map +1 -1
  248. package/__cjs/utilities/internal/isExecutionPatchIninitialResult.d.cts +5 -1
  249. package/__cjs/utilities/internal/isExecutionPatchResult.cjs +5 -1
  250. package/__cjs/utilities/internal/isExecutionPatchResult.cjs.map +1 -1
  251. package/__cjs/utilities/internal/isExecutionPatchResult.d.cts +5 -1
  252. package/__cjs/utilities/internal/isField.cjs +5 -1
  253. package/__cjs/utilities/internal/isField.cjs.map +1 -1
  254. package/__cjs/utilities/internal/isField.d.cts +5 -1
  255. package/__cjs/utilities/internal/isNonEmptyArray.cjs +5 -1
  256. package/__cjs/utilities/internal/isNonEmptyArray.cjs.map +1 -1
  257. package/__cjs/utilities/internal/isNonEmptyArray.d.cts +5 -1
  258. package/__cjs/utilities/internal/isNonNullObject.cjs +5 -1
  259. package/__cjs/utilities/internal/isNonNullObject.cjs.map +1 -1
  260. package/__cjs/utilities/internal/isNonNullObject.d.cts +5 -1
  261. package/__cjs/utilities/internal/isPlainObject.cjs +5 -1
  262. package/__cjs/utilities/internal/isPlainObject.cjs.map +1 -1
  263. package/__cjs/utilities/internal/isPlainObject.d.cts +5 -1
  264. package/__cjs/utilities/internal/makeReference.cjs +5 -1
  265. package/__cjs/utilities/internal/makeReference.cjs.map +1 -1
  266. package/__cjs/utilities/internal/makeReference.d.cts +5 -1
  267. package/__cjs/utilities/internal/makeUniqueId.cjs +7 -5
  268. package/__cjs/utilities/internal/makeUniqueId.cjs.map +1 -1
  269. package/__cjs/utilities/internal/makeUniqueId.d.cts +7 -5
  270. package/__cjs/utilities/internal/maybeDeepFreeze.cjs +5 -1
  271. package/__cjs/utilities/internal/maybeDeepFreeze.cjs.map +1 -1
  272. package/__cjs/utilities/internal/maybeDeepFreeze.d.cts +5 -1
  273. package/__cjs/utilities/internal/mergeDeep.cjs +5 -1
  274. package/__cjs/utilities/internal/mergeDeep.cjs.map +1 -1
  275. package/__cjs/utilities/internal/mergeDeep.d.cts +5 -1
  276. package/__cjs/utilities/internal/mergeDeepArray.cjs +5 -1
  277. package/__cjs/utilities/internal/mergeDeepArray.cjs.map +1 -1
  278. package/__cjs/utilities/internal/mergeDeepArray.d.cts +5 -1
  279. package/__cjs/utilities/internal/mergeIncrementalData.cjs +5 -1
  280. package/__cjs/utilities/internal/mergeIncrementalData.cjs.map +1 -1
  281. package/__cjs/utilities/internal/mergeIncrementalData.d.cts +5 -1
  282. package/__cjs/utilities/internal/mergeOptions.cjs +5 -1
  283. package/__cjs/utilities/internal/mergeOptions.cjs.map +1 -1
  284. package/__cjs/utilities/internal/mergeOptions.d.cts +5 -1
  285. package/__cjs/utilities/internal/omitDeep.cjs +5 -1
  286. package/__cjs/utilities/internal/omitDeep.cjs.map +1 -1
  287. package/__cjs/utilities/internal/omitDeep.d.cts +5 -1
  288. package/__cjs/utilities/internal/onAnyEvent.cjs +5 -1
  289. package/__cjs/utilities/internal/onAnyEvent.cjs.map +1 -1
  290. package/__cjs/utilities/internal/onAnyEvent.d.cts +5 -1
  291. package/__cjs/utilities/internal/removeDirectivesFromDocument.cjs +5 -1
  292. package/__cjs/utilities/internal/removeDirectivesFromDocument.cjs.map +1 -1
  293. package/__cjs/utilities/internal/removeDirectivesFromDocument.d.cts +5 -1
  294. package/__cjs/utilities/internal/resultKeyNameFromField.cjs +5 -1
  295. package/__cjs/utilities/internal/resultKeyNameFromField.cjs.map +1 -1
  296. package/__cjs/utilities/internal/resultKeyNameFromField.d.cts +5 -1
  297. package/__cjs/utilities/internal/shouldInclude.cjs +5 -1
  298. package/__cjs/utilities/internal/shouldInclude.cjs.map +1 -1
  299. package/__cjs/utilities/internal/shouldInclude.d.cts +5 -1
  300. package/__cjs/utilities/internal/storeKeyNameFromField.cjs +5 -1
  301. package/__cjs/utilities/internal/storeKeyNameFromField.cjs.map +1 -1
  302. package/__cjs/utilities/internal/storeKeyNameFromField.d.cts +5 -1
  303. package/__cjs/utilities/internal/stringifyForDisplay.cjs +5 -1
  304. package/__cjs/utilities/internal/stringifyForDisplay.cjs.map +1 -1
  305. package/__cjs/utilities/internal/stringifyForDisplay.d.cts +5 -1
  306. package/__cjs/utilities/internal/toQueryResult.cjs +5 -1
  307. package/__cjs/utilities/internal/toQueryResult.cjs.map +1 -1
  308. package/__cjs/utilities/internal/toQueryResult.d.cts +5 -1
  309. package/__cjs/utilities/internal/types/DecoratedPromise.d.cts +5 -1
  310. package/__cjs/utilities/internal/types/DeepOmit.d.cts +5 -1
  311. package/__cjs/utilities/internal/types/DeepPartial.d.cts +5 -1
  312. package/__cjs/utilities/internal/types/FragmentMap.d.cts +6 -4
  313. package/__cjs/utilities/internal/types/FragmentMapFunction.d.cts +5 -1
  314. package/__cjs/utilities/internal/types/FulfilledPromise.d.cts +5 -1
  315. package/__cjs/utilities/internal/types/IsAny.d.cts +5 -1
  316. package/__cjs/utilities/internal/types/PendingPromise.d.cts +5 -1
  317. package/__cjs/utilities/internal/types/Prettify.d.cts +5 -1
  318. package/__cjs/utilities/internal/types/Primitive.d.cts +5 -1
  319. package/__cjs/utilities/internal/types/RejectedPromise.d.cts +5 -1
  320. package/__cjs/utilities/internal/types/RemoveIndexSignature.d.cts +5 -1
  321. package/__cjs/utilities/internal/types/VariablesOption.d.cts +5 -1
  322. package/__cjs/utilities/internal/valueToObjectRepresentation.cjs +5 -1
  323. package/__cjs/utilities/internal/valueToObjectRepresentation.cjs.map +1 -1
  324. package/__cjs/utilities/internal/valueToObjectRepresentation.d.cts +5 -1
  325. package/__cjs/version.cjs +1 -1
  326. package/cache/core/cache.d.ts +9 -7
  327. package/cache/core/cache.js +9 -7
  328. package/cache/core/cache.js.map +1 -1
  329. package/cache/inmemory/entityStore.js +3 -3
  330. package/cache/inmemory/inMemoryCache.d.ts +9 -7
  331. package/cache/inmemory/inMemoryCache.js.map +1 -1
  332. package/cache/inmemory/key-extractor.js +1 -1
  333. package/cache/inmemory/policies.js +4 -4
  334. package/cache/inmemory/policies.js.map +1 -1
  335. package/cache/inmemory/readFromStore.js +2 -2
  336. package/cache/inmemory/readFromStore.js.map +1 -1
  337. package/cache/inmemory/writeToStore.js +4 -4
  338. package/cache/inmemory/writeToStore.js.map +1 -1
  339. package/core/ApolloClient.d.ts +9 -21
  340. package/core/ApolloClient.js +23 -45
  341. package/core/ApolloClient.js.map +1 -1
  342. package/core/ObservableQuery.d.ts +95 -33
  343. package/core/ObservableQuery.js +569 -345
  344. package/core/ObservableQuery.js.map +1 -1
  345. package/core/QueryInfo.d.ts +9 -14
  346. package/core/QueryInfo.js +109 -179
  347. package/core/QueryInfo.js.map +1 -1
  348. package/core/QueryManager.d.ts +12 -8
  349. package/core/QueryManager.js +151 -110
  350. package/core/QueryManager.js.map +1 -1
  351. package/core/index.d.ts +2 -3
  352. package/core/index.js +1 -1
  353. package/core/index.js.map +1 -1
  354. package/core/types.d.ts +18 -6
  355. package/errors/LinkError.d.ts +5 -1
  356. package/errors/LinkError.js +5 -1
  357. package/errors/LinkError.js.map +1 -1
  358. package/errors/LocalStateError.d.ts +20 -0
  359. package/errors/LocalStateError.js +23 -0
  360. package/errors/LocalStateError.js.map +1 -0
  361. package/errors/index.d.ts +2 -0
  362. package/errors/index.js +2 -0
  363. package/errors/index.js.map +1 -1
  364. package/invariantErrorCodes.js +130 -57
  365. package/legacyEntryPoints/local-state/index.d.ts +1 -0
  366. package/legacyEntryPoints/local-state/index.js +1 -0
  367. package/legacyEntryPoints/local-state/local-state.cjs +1 -0
  368. package/legacyEntryPoints/local-state/local-state.d.cts +1 -0
  369. package/link/core/ApolloLink.d.ts +15 -9
  370. package/link/core/ApolloLink.js +17 -11
  371. package/link/core/ApolloLink.js.map +1 -1
  372. package/link/http/checkFetcher.js +1 -1
  373. package/link/http/createHttpLink.js +1 -1
  374. package/link/http/parseAndCheckHttpResponse.js +1 -1
  375. package/link/http/serializeFetchParameter.js +1 -1
  376. package/link/persisted-queries/index.js +2 -2
  377. package/link/utils/transformOperation.js +1 -1
  378. package/link/utils/transformOperation.js.map +1 -1
  379. package/link/utils/validateOperation.js +1 -1
  380. package/local-state/LocalState.d.ts +89 -0
  381. package/local-state/LocalState.js +527 -0
  382. package/local-state/LocalState.js.map +1 -0
  383. package/local-state/index.d.ts +2 -0
  384. package/local-state/index.js +2 -0
  385. package/local-state/index.js.map +1 -0
  386. package/masking/maskFragment.d.ts +5 -1
  387. package/masking/maskFragment.js +5 -1
  388. package/masking/maskFragment.js.map +1 -1
  389. package/masking/maskOperation.d.ts +5 -1
  390. package/masking/maskOperation.js +5 -1
  391. package/masking/maskOperation.js.map +1 -1
  392. package/masking/utils.d.ts +5 -1
  393. package/masking/utils.js +5 -1
  394. package/masking/utils.js.map +1 -1
  395. package/package.json +7 -155
  396. package/react/hooks/internal/wrapHook.d.ts +42 -38
  397. package/react/hooks/internal/wrapHook.js +36 -34
  398. package/react/hooks/internal/wrapHook.js.map +1 -1
  399. package/react/hooks/useQuery.d.ts +0 -1
  400. package/react/hooks/useQuery.js +10 -25
  401. package/react/hooks/useQuery.js.map +1 -1
  402. package/react/internal/cache/QueryReference.d.ts +25 -7
  403. package/react/internal/cache/QueryReference.js +6 -9
  404. package/react/internal/cache/QueryReference.js.map +1 -1
  405. package/react/ssr/prerenderStatic.js +7 -0
  406. package/react/ssr/prerenderStatic.js.map +1 -1
  407. package/react/ssr/useSSRQuery.js +11 -2
  408. package/react/ssr/useSSRQuery.js.map +1 -1
  409. package/testing/core/mocking/mockLink.d.ts +29 -22
  410. package/testing/core/mocking/mockLink.js +9 -10
  411. package/testing/core/mocking/mockLink.js.map +1 -1
  412. package/testing/core/mocking/mockSubscriptionLink.d.ts +7 -6
  413. package/testing/core/mocking/mockSubscriptionLink.js +0 -3
  414. package/testing/core/mocking/mockSubscriptionLink.js.map +1 -1
  415. package/testing/core/types/deprecated.d.ts +10 -0
  416. package/testing/core/types/deprecated.js +2 -0
  417. package/testing/core/types/deprecated.js.map +1 -0
  418. package/testing/index.d.ts +3 -2
  419. package/testing/index.js +2 -1
  420. package/testing/index.js.map +1 -1
  421. package/testing/internal/ObservableStream.d.ts +12 -1
  422. package/testing/internal/ObservableStream.js +13 -1
  423. package/testing/internal/ObservableStream.js.map +1 -1
  424. package/testing/internal/disposables/withCleanup.d.ts +5 -1
  425. package/testing/internal/disposables/withCleanup.js +5 -1
  426. package/testing/internal/disposables/withCleanup.js.map +1 -1
  427. package/testing/internal/index.d.ts +1 -0
  428. package/testing/internal/index.js +2 -1
  429. package/testing/internal/index.js.map +1 -1
  430. package/testing/internal/scenarios/index.d.ts +8 -8
  431. package/testing/internal/scenarios/index.js +4 -4
  432. package/testing/internal/scenarios/index.js.map +1 -1
  433. package/testing/{core → internal}/wait.d.ts +0 -1
  434. package/testing/{core → internal}/wait.js +0 -3
  435. package/testing/internal/wait.js.map +1 -0
  436. package/testing/matchers/index.js +2 -2
  437. package/testing/matchers/index.js.map +1 -1
  438. package/testing/matchers/toEmitTypedValue.d.ts +6 -1
  439. package/testing/matchers/toEmitTypedValue.js +1 -1
  440. package/testing/matchers/toEmitTypedValue.js.map +1 -1
  441. package/testing/matchers/toRerenderWithSimilarSnapshot.d.ts +13 -6
  442. package/testing/matchers/toRerenderWithSimilarSnapshot.js +30 -15
  443. package/testing/matchers/toRerenderWithSimilarSnapshot.js.map +1 -1
  444. package/testing/matchers/toStrictEqualTyped.d.ts +4 -0
  445. package/testing/matchers/toStrictEqualTyped.js +1 -1
  446. package/testing/matchers/toStrictEqualTyped.js.map +1 -1
  447. package/testing/matchers/utils/getSerializableProperties.js +14 -2
  448. package/testing/matchers/utils/getSerializableProperties.js.map +1 -1
  449. package/testing/react/MockedProvider.d.ts +4 -5
  450. package/testing/react/MockedProvider.js +3 -3
  451. package/testing/react/MockedProvider.js.map +1 -1
  452. package/utilities/graphql/DocumentTransform.d.ts +10 -6
  453. package/utilities/graphql/DocumentTransform.js +10 -6
  454. package/utilities/graphql/DocumentTransform.js.map +1 -1
  455. package/utilities/internal/DeepMerger.d.ts +5 -1
  456. package/utilities/internal/DeepMerger.js +5 -1
  457. package/utilities/internal/DeepMerger.js.map +1 -1
  458. package/utilities/internal/argumentsObjectFromField.d.ts +5 -1
  459. package/utilities/internal/argumentsObjectFromField.js +5 -1
  460. package/utilities/internal/argumentsObjectFromField.js.map +1 -1
  461. package/utilities/internal/caches.d.ts +32 -24
  462. package/utilities/internal/caches.js +24 -20
  463. package/utilities/internal/caches.js.map +1 -1
  464. package/utilities/internal/canUseDOM.d.ts +5 -1
  465. package/utilities/internal/canUseDOM.js +5 -1
  466. package/utilities/internal/canUseDOM.js.map +1 -1
  467. package/utilities/internal/checkDocument.d.ts +6 -3
  468. package/utilities/internal/checkDocument.js +6 -3
  469. package/utilities/internal/checkDocument.js.map +1 -1
  470. package/utilities/internal/cloneDeep.d.ts +6 -4
  471. package/utilities/internal/cloneDeep.js +6 -4
  472. package/utilities/internal/cloneDeep.js.map +1 -1
  473. package/utilities/internal/compact.d.ts +7 -5
  474. package/utilities/internal/compact.js +7 -5
  475. package/utilities/internal/compact.js.map +1 -1
  476. package/utilities/internal/createFragmentMap.d.ts +7 -4
  477. package/utilities/internal/createFragmentMap.js +7 -4
  478. package/utilities/internal/createFragmentMap.js.map +1 -1
  479. package/utilities/internal/createFulfilledPromise.d.ts +5 -1
  480. package/utilities/internal/createFulfilledPromise.js +5 -1
  481. package/utilities/internal/createFulfilledPromise.js.map +1 -1
  482. package/utilities/internal/createRejectedPromise.d.ts +5 -1
  483. package/utilities/internal/createRejectedPromise.js +5 -1
  484. package/utilities/internal/createRejectedPromise.js.map +1 -1
  485. package/utilities/internal/dealias.d.ts +5 -0
  486. package/utilities/internal/dealias.js +18 -0
  487. package/utilities/internal/dealias.js.map +1 -0
  488. package/utilities/internal/decoratePromise.d.ts +5 -1
  489. package/utilities/internal/decoratePromise.js +5 -1
  490. package/utilities/internal/decoratePromise.js.map +1 -1
  491. package/utilities/internal/deepFreeze.d.ts +5 -1
  492. package/utilities/internal/deepFreeze.js +5 -1
  493. package/utilities/internal/deepFreeze.js.map +1 -1
  494. package/utilities/internal/filterMap.d.ts +4 -0
  495. package/utilities/internal/filterMap.js +28 -0
  496. package/utilities/internal/filterMap.js.map +1 -0
  497. package/utilities/internal/getDefaultValues.d.ts +5 -1
  498. package/utilities/internal/getDefaultValues.js +5 -1
  499. package/utilities/internal/getDefaultValues.js.map +1 -1
  500. package/utilities/internal/getFragmentDefinition.d.ts +5 -1
  501. package/utilities/internal/getFragmentDefinition.js +5 -1
  502. package/utilities/internal/getFragmentDefinition.js.map +1 -1
  503. package/utilities/internal/getFragmentDefinitions.d.ts +5 -1
  504. package/utilities/internal/getFragmentDefinitions.js +5 -1
  505. package/utilities/internal/getFragmentDefinitions.js.map +1 -1
  506. package/utilities/internal/getFragmentFromSelection.d.ts +5 -1
  507. package/utilities/internal/getFragmentFromSelection.js +5 -1
  508. package/utilities/internal/getFragmentFromSelection.js.map +1 -1
  509. package/utilities/internal/getFragmentQueryDocument.d.ts +25 -23
  510. package/utilities/internal/getFragmentQueryDocument.js +25 -23
  511. package/utilities/internal/getFragmentQueryDocument.js.map +1 -1
  512. package/utilities/internal/getGraphQLErrorsFromResult.d.ts +5 -1
  513. package/utilities/internal/getGraphQLErrorsFromResult.js +5 -1
  514. package/utilities/internal/getGraphQLErrorsFromResult.js.map +1 -1
  515. package/utilities/internal/getMainDefinition.d.ts +8 -6
  516. package/utilities/internal/getMainDefinition.js +8 -6
  517. package/utilities/internal/getMainDefinition.js.map +1 -1
  518. package/utilities/internal/getMemoryInternals.d.ts +15 -9
  519. package/utilities/internal/getMemoryInternals.js +15 -9
  520. package/utilities/internal/getMemoryInternals.js.map +1 -1
  521. package/utilities/internal/getOperationDefinition.d.ts +5 -1
  522. package/utilities/internal/getOperationDefinition.js +5 -1
  523. package/utilities/internal/getOperationDefinition.js.map +1 -1
  524. package/utilities/internal/getOperationName.d.ts +6 -2
  525. package/utilities/internal/getOperationName.js +7 -5
  526. package/utilities/internal/getOperationName.js.map +1 -1
  527. package/utilities/internal/getQueryDefinition.d.ts +5 -1
  528. package/utilities/internal/getQueryDefinition.js +5 -1
  529. package/utilities/internal/getQueryDefinition.js.map +1 -1
  530. package/utilities/internal/getStoreKeyName.d.ts +5 -1
  531. package/utilities/internal/getStoreKeyName.js +5 -1
  532. package/utilities/internal/getStoreKeyName.js.map +1 -1
  533. package/utilities/internal/globals/global.js +2 -2
  534. package/utilities/internal/globals/global.js.map +1 -1
  535. package/utilities/internal/graphQLResultHasError.d.ts +5 -1
  536. package/utilities/internal/graphQLResultHasError.js +5 -1
  537. package/utilities/internal/graphQLResultHasError.js.map +1 -1
  538. package/utilities/internal/hasDirectives.d.ts +5 -1
  539. package/utilities/internal/hasDirectives.js +5 -1
  540. package/utilities/internal/hasDirectives.js.map +1 -1
  541. package/utilities/internal/hasForcedResolvers.d.ts +3 -0
  542. package/utilities/internal/hasForcedResolvers.js +20 -0
  543. package/utilities/internal/hasForcedResolvers.js.map +1 -0
  544. package/utilities/internal/index.d.ts +3 -1
  545. package/utilities/internal/index.js +3 -1
  546. package/utilities/internal/index.js.map +1 -1
  547. package/utilities/internal/isArray.d.ts +6 -4
  548. package/utilities/internal/isArray.js +6 -4
  549. package/utilities/internal/isArray.js.map +1 -1
  550. package/utilities/internal/isDocumentNode.d.ts +5 -1
  551. package/utilities/internal/isDocumentNode.js +5 -1
  552. package/utilities/internal/isDocumentNode.js.map +1 -1
  553. package/utilities/internal/isExecutionPatchIncrementalResult.d.ts +5 -1
  554. package/utilities/internal/isExecutionPatchIncrementalResult.js +5 -1
  555. package/utilities/internal/isExecutionPatchIncrementalResult.js.map +1 -1
  556. package/utilities/internal/isExecutionPatchIninitialResult.d.ts +5 -1
  557. package/utilities/internal/isExecutionPatchIninitialResult.js +5 -1
  558. package/utilities/internal/isExecutionPatchIninitialResult.js.map +1 -1
  559. package/utilities/internal/isExecutionPatchResult.d.ts +5 -1
  560. package/utilities/internal/isExecutionPatchResult.js +5 -1
  561. package/utilities/internal/isExecutionPatchResult.js.map +1 -1
  562. package/utilities/internal/isField.d.ts +5 -1
  563. package/utilities/internal/isField.js +5 -1
  564. package/utilities/internal/isField.js.map +1 -1
  565. package/utilities/internal/isNonEmptyArray.d.ts +5 -1
  566. package/utilities/internal/isNonEmptyArray.js +5 -1
  567. package/utilities/internal/isNonEmptyArray.js.map +1 -1
  568. package/utilities/internal/isNonNullObject.d.ts +5 -1
  569. package/utilities/internal/isNonNullObject.js +5 -1
  570. package/utilities/internal/isNonNullObject.js.map +1 -1
  571. package/utilities/internal/isPlainObject.d.ts +5 -1
  572. package/utilities/internal/isPlainObject.js +5 -1
  573. package/utilities/internal/isPlainObject.js.map +1 -1
  574. package/utilities/internal/makeReference.d.ts +5 -1
  575. package/utilities/internal/makeReference.js +5 -1
  576. package/utilities/internal/makeReference.js.map +1 -1
  577. package/utilities/internal/makeUniqueId.d.ts +7 -5
  578. package/utilities/internal/makeUniqueId.js +7 -5
  579. package/utilities/internal/makeUniqueId.js.map +1 -1
  580. package/utilities/internal/maybeDeepFreeze.d.ts +5 -1
  581. package/utilities/internal/maybeDeepFreeze.js +5 -1
  582. package/utilities/internal/maybeDeepFreeze.js.map +1 -1
  583. package/utilities/internal/mergeDeep.d.ts +5 -1
  584. package/utilities/internal/mergeDeep.js +5 -1
  585. package/utilities/internal/mergeDeep.js.map +1 -1
  586. package/utilities/internal/mergeDeepArray.d.ts +5 -1
  587. package/utilities/internal/mergeDeepArray.js +5 -1
  588. package/utilities/internal/mergeDeepArray.js.map +1 -1
  589. package/utilities/internal/mergeIncrementalData.d.ts +5 -1
  590. package/utilities/internal/mergeIncrementalData.js +5 -1
  591. package/utilities/internal/mergeIncrementalData.js.map +1 -1
  592. package/utilities/internal/mergeOptions.d.ts +5 -1
  593. package/utilities/internal/mergeOptions.js +5 -1
  594. package/utilities/internal/mergeOptions.js.map +1 -1
  595. package/utilities/internal/omitDeep.d.ts +5 -1
  596. package/utilities/internal/omitDeep.js +5 -1
  597. package/utilities/internal/omitDeep.js.map +1 -1
  598. package/utilities/internal/onAnyEvent.d.ts +5 -1
  599. package/utilities/internal/onAnyEvent.js +5 -1
  600. package/utilities/internal/onAnyEvent.js.map +1 -1
  601. package/utilities/internal/removeDirectivesFromDocument.d.ts +5 -1
  602. package/utilities/internal/removeDirectivesFromDocument.js +5 -1
  603. package/utilities/internal/removeDirectivesFromDocument.js.map +1 -1
  604. package/utilities/internal/resultKeyNameFromField.d.ts +5 -1
  605. package/utilities/internal/resultKeyNameFromField.js +5 -1
  606. package/utilities/internal/resultKeyNameFromField.js.map +1 -1
  607. package/utilities/internal/shouldInclude.d.ts +5 -1
  608. package/utilities/internal/shouldInclude.js +5 -1
  609. package/utilities/internal/shouldInclude.js.map +1 -1
  610. package/utilities/internal/storeKeyNameFromField.d.ts +5 -1
  611. package/utilities/internal/storeKeyNameFromField.js +5 -1
  612. package/utilities/internal/storeKeyNameFromField.js.map +1 -1
  613. package/utilities/internal/stringifyForDisplay.d.ts +5 -1
  614. package/utilities/internal/stringifyForDisplay.js +5 -1
  615. package/utilities/internal/stringifyForDisplay.js.map +1 -1
  616. package/utilities/internal/toQueryResult.d.ts +5 -1
  617. package/utilities/internal/toQueryResult.js +5 -1
  618. package/utilities/internal/toQueryResult.js.map +1 -1
  619. package/utilities/internal/types/DecoratedPromise.d.ts +5 -1
  620. package/utilities/internal/types/DeepOmit.d.ts +5 -1
  621. package/utilities/internal/types/DeepPartial.d.ts +5 -1
  622. package/utilities/internal/types/FragmentMap.d.ts +6 -4
  623. package/utilities/internal/types/FragmentMapFunction.d.ts +5 -1
  624. package/utilities/internal/types/FulfilledPromise.d.ts +5 -1
  625. package/utilities/internal/types/IsAny.d.ts +5 -1
  626. package/utilities/internal/types/PendingPromise.d.ts +5 -1
  627. package/utilities/internal/types/Prettify.d.ts +5 -1
  628. package/utilities/internal/types/Primitive.d.ts +5 -1
  629. package/utilities/internal/types/RejectedPromise.d.ts +5 -1
  630. package/utilities/internal/types/RemoveIndexSignature.d.ts +5 -1
  631. package/utilities/internal/types/VariablesOption.d.ts +5 -1
  632. package/utilities/internal/valueToObjectRepresentation.d.ts +5 -1
  633. package/utilities/internal/valueToObjectRepresentation.js +5 -1
  634. package/utilities/internal/valueToObjectRepresentation.js.map +1 -1
  635. package/version.js +1 -1
  636. package/__cjs/core/LocalState.cjs +0 -355
  637. package/__cjs/core/LocalState.cjs.map +0 -1
  638. package/__cjs/core/LocalState.d.cts +0 -53
  639. package/__cjs/testing/core/index.cjs +0 -20
  640. package/__cjs/testing/core/index.cjs.map +0 -1
  641. package/__cjs/testing/core/index.d.cts +0 -7
  642. package/__cjs/testing/core/mocking/mockClient.cjs +0 -17
  643. package/__cjs/testing/core/mocking/mockClient.cjs.map +0 -1
  644. package/__cjs/testing/core/mocking/mockClient.d.cts +0 -4
  645. package/__cjs/testing/core/wait.cjs.map +0 -1
  646. package/__cjs/testing/core/withConsoleSpy.cjs +0 -33
  647. package/__cjs/testing/core/withConsoleSpy.cjs.map +0 -1
  648. package/__cjs/testing/core/withConsoleSpy.d.cts +0 -7
  649. package/__cjs/utilities/internal/removeClientSetsFromDocument.cjs +0 -21
  650. package/__cjs/utilities/internal/removeClientSetsFromDocument.cjs.map +0 -1
  651. package/__cjs/utilities/internal/removeClientSetsFromDocument.d.cts +0 -8
  652. package/core/LocalState.d.ts +0 -53
  653. package/core/LocalState.js +0 -351
  654. package/core/LocalState.js.map +0 -1
  655. package/legacyEntryPoints/testing/core/core.cjs +0 -1
  656. package/legacyEntryPoints/testing/core/core.d.cts +0 -1
  657. package/legacyEntryPoints/testing/core/index.d.ts +0 -1
  658. package/legacyEntryPoints/testing/core/index.js +0 -1
  659. package/testing/core/index.d.ts +0 -7
  660. package/testing/core/index.js +0 -6
  661. package/testing/core/index.js.map +0 -1
  662. package/testing/core/mocking/mockClient.d.ts +0 -4
  663. package/testing/core/mocking/mockClient.js +0 -14
  664. package/testing/core/mocking/mockClient.js.map +0 -1
  665. package/testing/core/wait.js.map +0 -1
  666. package/testing/core/withConsoleSpy.d.ts +0 -7
  667. package/testing/core/withConsoleSpy.js +0 -28
  668. package/testing/core/withConsoleSpy.js.map +0 -1
  669. package/utilities/internal/removeClientSetsFromDocument.d.ts +0 -8
  670. package/utilities/internal/removeClientSetsFromDocument.js +0 -18
  671. package/utilities/internal/removeClientSetsFromDocument.js.map +0 -1
@@ -0,0 +1,5 @@
1
+ ---
2
+ "@apollo/client": patch
3
+ ---
4
+
5
+ When updating `skip` from `false` to `true` in `useQuery`, retain `data` if it is available rather than setting it to `undefined`.
@@ -0,0 +1,5 @@
1
+ ---
2
+ "@apollo/client": major
3
+ ---
4
+
5
+ The `getCacheKey` function is no longer available from `operation.getContext()` in the link chain. Use `operation.client.cache.identify(obj)` in the link chain instead.
@@ -0,0 +1,6 @@
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.
@@ -0,0 +1,35 @@
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
+ ```
@@ -0,0 +1,5 @@
1
+ ---
2
+ "@apollo/client": major
3
+ ---
4
+
5
+ Removed `getLastResult`, `getLastError` and `resetLastResults` from `ObservableQuery`
@@ -0,0 +1,14 @@
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
+ ```
@@ -0,0 +1,9 @@
1
+ ---
2
+ "@apollo/client": major
3
+ ---
4
+
5
+ Remove local resolvers APIs from `ApolloClient` in favor of `localState`. Methods removed are:
6
+ - `addResolvers`
7
+ - `getResolvers`
8
+ - `setResolvers`
9
+ - `setLocalStateFragmentMatcher`
@@ -0,0 +1,23 @@
1
+ ---
2
+ "@apollo/client": minor
3
+ ---
4
+
5
+ Move `MockLink` types to `MockLink` namespace. This affects the `MockedResponse`, `MockLinkOptions`, and `ResultFunction` types. These types are still exported but are deprecated in favor of the namespace. To migrate, use the types on the `MockLink` namespace instead.
6
+
7
+ ```diff
8
+ import {
9
+ - MockedResponse,
10
+ - MockLinkOptions,
11
+ - ResultFunction,
12
+ + MockLink
13
+ } from "@apollo/client/testing";
14
+
15
+ - const mocks: MockedResponse = [];
16
+ + const mocks: MockLink.MockedResponse = [];
17
+
18
+ - const result: ResultFunction = () => {/* ... */ }
19
+ + const result: MockLink.ResultFunction = () => {/* ... */ }
20
+
21
+ - const options: MockLinkOptions = {}
22
+ + const options: MockLink.Options = {}
23
+ ```
@@ -8,6 +8,7 @@
8
8
  "afraid-grapes-call",
9
9
  "afraid-moons-arrive",
10
10
  "beige-mirrors-talk",
11
+ "beige-spiders-hope",
11
12
  "brave-moons-juggle",
12
13
  "brave-radios-wait",
13
14
  "bright-ads-share",
@@ -19,6 +20,7 @@
19
20
  "cool-bikes-shake",
20
21
  "cool-kiwis-hunt",
21
22
  "cuddly-spiders-tie",
23
+ "curvy-flies-accept",
22
24
  "curvy-pianos-count",
23
25
  "dirty-cobras-change",
24
26
  "dirty-eagles-poke",
@@ -27,6 +29,7 @@
27
29
  "eighty-squids-fix",
28
30
  "eleven-kangaroos-jump",
29
31
  "empty-rabbits-move",
32
+ "few-crabs-move",
30
33
  "fluffy-shoes-applaud",
31
34
  "forty-hairs-occur",
32
35
  "forty-shrimps-fry",
@@ -35,6 +38,7 @@
35
38
  "four-ghosts-watch",
36
39
  "fresh-moose-hope",
37
40
  "friendly-olives-refuse",
41
+ "funny-boats-wink",
38
42
  "funny-jeans-invent",
39
43
  "funny-terms-deny",
40
44
  "fuzzy-seahorses-hunt",
@@ -43,6 +47,7 @@
43
47
  "gentle-waves-cough",
44
48
  "giant-apes-thank",
45
49
  "giant-bags-share",
50
+ "gold-oranges-double",
46
51
  "good-dolphins-peel",
47
52
  "gorgeous-chefs-tap",
48
53
  "great-roses-jog",
@@ -62,6 +67,7 @@
62
67
  "light-apes-rescue",
63
68
  "light-dolphins-taste",
64
69
  "light-sloths-end",
70
+ "little-parrots-bow",
65
71
  "little-spoons-kick",
66
72
  "loud-cows-raise",
67
73
  "lucky-hats-push",
@@ -81,11 +87,13 @@
81
87
  "ninety-bags-bake",
82
88
  "odd-chicken-hide",
83
89
  "odd-lemons-relax",
90
+ "olive-cougars-ring",
84
91
  "orange-suits-laugh",
85
92
  "perfect-ducks-reflect",
86
93
  "perfect-vans-give",
87
94
  "polite-bees-care",
88
95
  "poor-eels-punch",
96
+ "poor-spiders-hunt",
89
97
  "popular-games-sleep",
90
98
  "purple-bears-flash",
91
99
  "purple-lions-cough",
@@ -95,6 +103,8 @@
95
103
  "rich-eagles-cross",
96
104
  "rich-kids-carry",
97
105
  "rude-fans-study",
106
+ "selfish-spoons-approve",
107
+ "serious-items-develop",
98
108
  "serious-moons-juggle",
99
109
  "seven-dragons-repair",
100
110
  "seven-foxes-melt",
@@ -106,6 +116,8 @@
106
116
  "short-tomatoes-attend",
107
117
  "silly-knives-exist",
108
118
  "silly-seas-confess",
119
+ "sixty-bats-cry",
120
+ "slimy-ants-bake",
109
121
  "slimy-chicken-melt",
110
122
  "slimy-maps-press",
111
123
  "slow-ravens-explain",
@@ -117,9 +129,15 @@
117
129
  "smooth-coins-collect",
118
130
  "smooth-pens-reply",
119
131
  "soft-mails-clean",
132
+ "sour-colts-tell",
133
+ "sour-guests-poke",
120
134
  "sour-kids-deliver",
121
135
  "sour-pillows-guess",
136
+ "spotty-mugs-poke",
122
137
  "strange-seahorses-impress",
138
+ "strange-walls-march",
139
+ "strong-rivers-fry",
140
+ "stupid-pumpkins-travel",
123
141
  "swift-rivers-share",
124
142
  "tall-bikes-develop",
125
143
  "tall-cups-suffer",
@@ -128,6 +146,7 @@
128
146
  "tender-swans-flash",
129
147
  "thick-books-grin",
130
148
  "thin-peas-hear",
149
+ "thirty-pens-jump",
131
150
  "tidy-pandas-punch",
132
151
  "tidy-squids-poke",
133
152
  "tough-rockets-allow",
@@ -139,6 +158,7 @@
139
158
  "unlucky-sheep-change",
140
159
  "warm-ties-sit",
141
160
  "wicked-forks-double",
161
+ "wicked-kiwis-buy",
142
162
  "witty-paws-marry",
143
163
  "yellow-cats-judge",
144
164
  "young-phones-fold",
@@ -0,0 +1,44 @@
1
+ ---
2
+ "@apollo/client": major
3
+ ---
4
+
5
+ Move internal testing utilities in `@apollo/client/testing` to `@apollo/client/testing/internal` and remove deprecated testing utilities. Some of the testing utilities exported from the `@apollo/client/testing` endpoint were not considered stable. As a result of this change, testing utilities or types exported from `@apollo/client/testing` are now considered stable and will not undergo breaking changes.
6
+
7
+ The following APIs were removed. To migrate, update usages of the following APIs as such:
8
+
9
+ **`createMockClient`**
10
+
11
+ ```diff
12
+ - const client = createMockClient(data, query, variables);
13
+ + const client = new ApolloClient({
14
+ + cache: new InMemoryCache(),
15
+ + link: new MockLink([
16
+ + {
17
+ + request: { query, variables },
18
+ + result: { data },
19
+ + }
20
+ + ]),
21
+ + });
22
+ ```
23
+
24
+ **`mockObservableLink`**
25
+
26
+ ```diff
27
+ - const link = mockObservableLink();
28
+ + const link = new MockSubscriptionLink();
29
+ ```
30
+
31
+ **`mockSingleLink`**
32
+
33
+ ```diff
34
+ - const link = mockSingleLink({
35
+ - request: { query, variables },
36
+ - result: { data },
37
+ - });
38
+ + const link = new MockLink([
39
+ + {
40
+ + request: { query, variables },
41
+ + result: { data },
42
+ + }
43
+ + ]);
44
+ ```
@@ -0,0 +1,17 @@
1
+ ---
2
+ "@apollo/client": major
3
+ ---
4
+
5
+ Third-party caches must now implement the `fragmentMatches` API. Additionally `fragmentMatches` must be able to handle both `InlineFragmentNode` and `FragmentDefinitionNode` nodes.
6
+
7
+ ```ts
8
+ class MyCache extends ApolloCache {
9
+ // This is now required
10
+ public fragmentMatches(
11
+ fragment: InlineFragmentNode | FragmentDefinitionNode,
12
+ typename: string
13
+ ): boolean {
14
+ return // ... logic to determine if typename matches fragment
15
+ }
16
+ }
17
+ ```
@@ -0,0 +1,6 @@
1
+ ---
2
+ "@apollo/client": major
3
+ ---
4
+
5
+ Reworked the logic for then a loading state is triggered. If the link chain responds synchronously, a loading state will be omitted, otherwise it will be triggered.
6
+ If local resolvers are used, the time window for "sync vs async" starts as soon as `@exports` variables are resolved.
@@ -0,0 +1,5 @@
1
+ ---
2
+ "@apollo/client": major
3
+ ---
4
+
5
+ `useQuery`: only advance `previousData` if `data` actually changed
@@ -0,0 +1,5 @@
1
+ ---
2
+ "@apollo/client": major
3
+ ---
4
+
5
+ `ObservableQuery` will now return a `loading: false` state for `fetchPolicy` `standby`, even before subscription
@@ -0,0 +1,5 @@
1
+ ---
2
+ "@apollo/client": major
3
+ ---
4
+
5
+ Remove the `@apollo/client/testing/core` entrypoint in favor of `@apollo/client/testing`.
@@ -0,0 +1,5 @@
1
+ ---
2
+ "@apollo/client": major
3
+ ---
4
+
5
+ Dropped the `saveAsLastResult` argument from `ObservableQuery.getCurrentResult`
@@ -0,0 +1,5 @@
1
+ ---
2
+ "@apollo/client": patch
3
+ ---
4
+
5
+ The `error` property is no longer present when `skip` is `true` in `useQuery`.
@@ -0,0 +1,34 @@
1
+ ---
2
+ "@apollo/client": major
3
+ ---
4
+
5
+ The resolver function's `context` argument (the 3rd argument) has changed to provide additional information without the possibility of name clashes. Previously the `context` argument would spread request context and override the `client` and `cache` properties to give access to both inside of a resolver. The `context` argument takes now takes the following shape:
6
+
7
+ ```ts
8
+ {
9
+ // the request context. By default `TContextValue` is of type `DefaultContext`,
10
+ // but can be changed if a `context` function is provided.
11
+ requestContext: TContextValue,
12
+ // The client instance making the request
13
+ client: ApolloClient,
14
+ // Whether the resolver is run as a result of gathering exported variables
15
+ // or resolving the value as part of the result
16
+ phase: "exports" | "resolve"
17
+ }
18
+ ```
19
+
20
+ To migrate, pull any request context from `requestContext` and the `cache` from the `client` property:
21
+
22
+ ```diff
23
+ new LocalState({
24
+ resolvers: {
25
+ Query: {
26
+ - myResolver: (parent, args, { someValue, cache }) => {
27
+ + myResolver: (parent, args, { requestContext, client }) => {
28
+ + const someValue = requestContext.someValue;
29
+ + const cache = client.cache;
30
+ }
31
+ }
32
+ }
33
+ });
34
+ ```
@@ -0,0 +1,13 @@
1
+ ---
2
+ "@apollo/client": major
3
+ ---
4
+
5
+ Apollo Client no longer ships with support for `@client` fields out-of-the-box and now must be opt-in. To opt in to use `@client` fields, pass an instantiated `LocalState` instance to the `localState` option. If a query contains `@client` and local state hasn't been configured, an error will be thrown.
6
+
7
+ ```ts
8
+ import { LocalState } from "@apollo/client/local-state";
9
+
10
+ new ApolloClient({
11
+ localState: new LocalState(),
12
+ });
13
+ ```
@@ -0,0 +1,5 @@
1
+ ---
2
+ "@apollo/client": major
3
+ ---
4
+
5
+ Remove the `fragmentMatcher` option from `ApolloClient`. Custom fragment matchers used with local state are no longer supported. Fragment matching is now performed by the configured `cache` via the `cache.fragmentMatches` API.
@@ -0,0 +1,5 @@
1
+ ---
2
+ "@apollo/client": major
3
+ ---
4
+
5
+ A call to `ObservableQuery.setVariables` with different variables or a `ObservableQuery.refetch` call will always now guarantee that a value will be emitted from the observable, even if it is deep equal to the previous value.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,212 @@
1
1
  # @apollo/client
2
2
 
3
+ ## 4.0.0-alpha.15
4
+
5
+ ### Major Changes
6
+
7
+ - [#12639](https://github.com/apollographql/apollo-client/pull/12639) [`1bdf489`](https://github.com/apollographql/apollo-client/commit/1bdf4893abb173c97877c71012afa15f9d3da8e6) Thanks [@jerelmiller](https://github.com/jerelmiller)! - Move internal testing utilities in `@apollo/client/testing` to `@apollo/client/testing/internal` and remove deprecated testing utilities. Some of the testing utilities exported from the `@apollo/client/testing` endpoint were not considered stable. As a result of this change, testing utilities or types exported from `@apollo/client/testing` are now considered stable and will not undergo breaking changes.
8
+
9
+ The following APIs were removed. To migrate, update usages of the following APIs as such:
10
+
11
+ **`createMockClient`**
12
+
13
+ ```diff
14
+ - const client = createMockClient(data, query, variables);
15
+ + const client = new ApolloClient({
16
+ + cache: new InMemoryCache(),
17
+ + link: new MockLink([
18
+ + {
19
+ + request: { query, variables },
20
+ + result: { data },
21
+ + }
22
+ + ]),
23
+ + });
24
+ ```
25
+
26
+ **`mockObservableLink`**
27
+
28
+ ```diff
29
+ - const link = mockObservableLink();
30
+ + const link = new MockSubscriptionLink();
31
+ ```
32
+
33
+ **`mockSingleLink`**
34
+
35
+ ```diff
36
+ - const link = mockSingleLink({
37
+ - request: { query, variables },
38
+ - result: { data },
39
+ - });
40
+ + const link = new MockLink([
41
+ + {
42
+ + request: { query, variables },
43
+ + result: { data },
44
+ + }
45
+ + ]);
46
+ ```
47
+
48
+ - [#12637](https://github.com/apollographql/apollo-client/pull/12637) [`d2a60d4`](https://github.com/apollographql/apollo-client/commit/d2a60d45e734a2518dad2443f85d82553cd6456a) Thanks [@phryneas](https://github.com/phryneas)! - `useQuery`: only advance `previousData` if `data` actually changed
49
+
50
+ - [#12631](https://github.com/apollographql/apollo-client/pull/12631) [`b147cac`](https://github.com/apollographql/apollo-client/commit/b147cac5c96c44bfc3deb72c12c7521981584c12) Thanks [@phryneas](https://github.com/phryneas)! - `ObservableQuery` will now return a `loading: false` state for `fetchPolicy` `standby`, even before subscription
51
+
52
+ - [#12639](https://github.com/apollographql/apollo-client/pull/12639) [`1bdf489`](https://github.com/apollographql/apollo-client/commit/1bdf4893abb173c97877c71012afa15f9d3da8e6) Thanks [@jerelmiller](https://github.com/jerelmiller)! - Remove the `@apollo/client/testing/core` entrypoint in favor of `@apollo/client/testing`.
53
+
54
+ ### Minor Changes
55
+
56
+ - [#12639](https://github.com/apollographql/apollo-client/pull/12639) [`1bdf489`](https://github.com/apollographql/apollo-client/commit/1bdf4893abb173c97877c71012afa15f9d3da8e6) Thanks [@jerelmiller](https://github.com/jerelmiller)! - Move `MockLink` types to `MockLink` namespace. This affects the `MockedResponse`, `MockLinkOptions`, and `ResultFunction` types. These types are still exported but are deprecated in favor of the namespace. To migrate, use the types on the `MockLink` namespace instead.
57
+
58
+ ```diff
59
+ import {
60
+ - MockedResponse,
61
+ - MockLinkOptions,
62
+ - ResultFunction,
63
+ + MockLink
64
+ } from "@apollo/client/testing";
65
+
66
+ - const mocks: MockedResponse = [];
67
+ + const mocks: MockLink.MockedResponse = [];
68
+
69
+ - const result: ResultFunction = () => {/* ... */ }
70
+ + const result: MockLink.ResultFunction = () => {/* ... */ }
71
+
72
+ - const options: MockLinkOptions = {}
73
+ + const options: MockLink.Options = {}
74
+ ```
75
+
76
+ ### Patch Changes
77
+
78
+ - [#12631](https://github.com/apollographql/apollo-client/pull/12631) [`b147cac`](https://github.com/apollographql/apollo-client/commit/b147cac5c96c44bfc3deb72c12c7521981584c12) Thanks [@phryneas](https://github.com/phryneas)! - When updating `skip` from `false` to `true` in `useQuery`, retain `data` if it is available rather than setting it to `undefined`.
79
+
80
+ - [#12631](https://github.com/apollographql/apollo-client/pull/12631) [`b147cac`](https://github.com/apollographql/apollo-client/commit/b147cac5c96c44bfc3deb72c12c7521981584c12) Thanks [@phryneas](https://github.com/phryneas)! - The `error` property is no longer present when `skip` is `true` in `useQuery`.
81
+
82
+ ## 4.0.0-alpha.14
83
+
84
+ ### Major Changes
85
+
86
+ - [#12614](https://github.com/apollographql/apollo-client/pull/12614) [`d2851e2`](https://github.com/apollographql/apollo-client/commit/d2851e2c74541995760a86904b1e3ab4bd736e62) Thanks [@jerelmiller](https://github.com/jerelmiller)! - The `getCacheKey` function is no longer available from `operation.getContext()` in the link chain. Use `operation.client.cache.identify(obj)` in the link chain instead.
87
+
88
+ - [#12556](https://github.com/apollographql/apollo-client/pull/12556) [`c3fceda`](https://github.com/apollographql/apollo-client/commit/c3fceda86c5e0f499d0b5fa54ea7dc4c4391ae2c) Thanks [@phryneas](https://github.com/phryneas)! - `ObservableQuery` will now keep previous `data` around when emitting a `loading` state, unless `query` or `variables` changed.
89
+ Note that `@exports` variables are not taken into account for this, so `data` will stay around even if they change.
90
+
91
+ - [#12556](https://github.com/apollographql/apollo-client/pull/12556) [`c3fceda`](https://github.com/apollographql/apollo-client/commit/c3fceda86c5e0f499d0b5fa54ea7dc4c4391ae2c) Thanks [@phryneas](https://github.com/phryneas)! - Removed `getLastResult`, `getLastError` and `resetLastResults` from `ObservableQuery`
92
+
93
+ - [#12614](https://github.com/apollographql/apollo-client/pull/12614) [`d2851e2`](https://github.com/apollographql/apollo-client/commit/d2851e2c74541995760a86904b1e3ab4bd736e62) Thanks [@jerelmiller](https://github.com/jerelmiller)! - 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`.
94
+
95
+ ```diff
96
+ new ApolloClient({
97
+ - resolvers: { /* ... */ }
98
+ + localState: new LocalState({
99
+ + resolvers: { /* ... */ }
100
+ + }),
101
+ });
102
+ ```
103
+
104
+ - [#12614](https://github.com/apollographql/apollo-client/pull/12614) [`d2851e2`](https://github.com/apollographql/apollo-client/commit/d2851e2c74541995760a86904b1e3ab4bd736e62) Thanks [@jerelmiller](https://github.com/jerelmiller)! - Remove local resolvers APIs from `ApolloClient` in favor of `localState`. Methods removed are:
105
+
106
+ - `addResolvers`
107
+ - `getResolvers`
108
+ - `setResolvers`
109
+ - `setLocalStateFragmentMatcher`
110
+
111
+ - [#12614](https://github.com/apollographql/apollo-client/pull/12614) [`d2851e2`](https://github.com/apollographql/apollo-client/commit/d2851e2c74541995760a86904b1e3ab4bd736e62) Thanks [@jerelmiller](https://github.com/jerelmiller)! - Third-party caches must now implement the `fragmentMatches` API. Additionally `fragmentMatches` must be able to handle both `InlineFragmentNode` and `FragmentDefinitionNode` nodes.
112
+
113
+ ```ts
114
+ class MyCache extends ApolloCache {
115
+ // This is now required
116
+ public fragmentMatches(
117
+ fragment: InlineFragmentNode | FragmentDefinitionNode,
118
+ typename: string
119
+ ): boolean {
120
+ return; // ... logic to determine if typename matches fragment
121
+ }
122
+ }
123
+ ```
124
+
125
+ - [#12556](https://github.com/apollographql/apollo-client/pull/12556) [`c3fceda`](https://github.com/apollographql/apollo-client/commit/c3fceda86c5e0f499d0b5fa54ea7dc4c4391ae2c) Thanks [@phryneas](https://github.com/phryneas)! - Reworked the logic for then a loading state is triggered. If the link chain responds synchronously, a loading state will be omitted, otherwise it will be triggered.
126
+ If local resolvers are used, the time window for "sync vs async" starts as soon as `@exports` variables are resolved.
127
+
128
+ - [#12556](https://github.com/apollographql/apollo-client/pull/12556) [`c3fceda`](https://github.com/apollographql/apollo-client/commit/c3fceda86c5e0f499d0b5fa54ea7dc4c4391ae2c) Thanks [@phryneas](https://github.com/phryneas)! - Dropped the `saveAsLastResult` argument from `ObservableQuery.getCurrentResult`
129
+
130
+ - [#12614](https://github.com/apollographql/apollo-client/pull/12614) [`d2851e2`](https://github.com/apollographql/apollo-client/commit/d2851e2c74541995760a86904b1e3ab4bd736e62) Thanks [@jerelmiller](https://github.com/jerelmiller)! - The resolver function's `context` argument (the 3rd argument) has changed to provide additional information without the possibility of name clashes. Previously the `context` argument would spread request context and override the `client` and `cache` properties to give access to both inside of a resolver. The `context` argument takes now takes the following shape:
131
+
132
+ ```ts
133
+ {
134
+ // the request context. By default `TContextValue` is of type `DefaultContext`,
135
+ // but can be changed if a `context` function is provided.
136
+ requestContext: TContextValue,
137
+ // The client instance making the request
138
+ client: ApolloClient,
139
+ // Whether the resolver is run as a result of gathering exported variables
140
+ // or resolving the value as part of the result
141
+ phase: "exports" | "resolve"
142
+ }
143
+ ```
144
+
145
+ To migrate, pull any request context from `requestContext` and the `cache` from the `client` property:
146
+
147
+ ```diff
148
+ new LocalState({
149
+ resolvers: {
150
+ Query: {
151
+ - myResolver: (parent, args, { someValue, cache }) => {
152
+ + myResolver: (parent, args, { requestContext, client }) => {
153
+ + const someValue = requestContext.someValue;
154
+ + const cache = client.cache;
155
+ }
156
+ }
157
+ }
158
+ });
159
+ ```
160
+
161
+ - [#12614](https://github.com/apollographql/apollo-client/pull/12614) [`d2851e2`](https://github.com/apollographql/apollo-client/commit/d2851e2c74541995760a86904b1e3ab4bd736e62) Thanks [@jerelmiller](https://github.com/jerelmiller)! - Apollo Client no longer ships with support for `@client` fields out-of-the-box and now must be opt-in. To opt in to use `@client` fields, pass an instantiated `LocalState` instance to the `localState` option. If a query contains `@client` and local state hasn't been configured, an error will be thrown.
162
+
163
+ ```ts
164
+ import { LocalState } from "@apollo/client/local-state";
165
+
166
+ new ApolloClient({
167
+ localState: new LocalState(),
168
+ });
169
+ ```
170
+
171
+ - [#12614](https://github.com/apollographql/apollo-client/pull/12614) [`d2851e2`](https://github.com/apollographql/apollo-client/commit/d2851e2c74541995760a86904b1e3ab4bd736e62) Thanks [@jerelmiller](https://github.com/jerelmiller)! - Remove the `fragmentMatcher` option from `ApolloClient`. Custom fragment matchers used with local state are no longer supported. Fragment matching is now performed by the configured `cache` via the `cache.fragmentMatches` API.
172
+
173
+ - [#12556](https://github.com/apollographql/apollo-client/pull/12556) [`c3fceda`](https://github.com/apollographql/apollo-client/commit/c3fceda86c5e0f499d0b5fa54ea7dc4c4391ae2c) Thanks [@phryneas](https://github.com/phryneas)! - A call to `ObservableQuery.setVariables` with different variables or a `ObservableQuery.refetch` call will always now guarantee that a value will be emitted from the observable, even if it is deep equal to the previous value.
174
+
175
+ ### Minor Changes
176
+
177
+ - [#12614](https://github.com/apollographql/apollo-client/pull/12614) [`d2851e2`](https://github.com/apollographql/apollo-client/commit/d2851e2c74541995760a86904b1e3ab4bd736e62) Thanks [@jerelmiller](https://github.com/jerelmiller)! - Revamp local resolvers and fix several issues from the existing `resolvers` option.
178
+
179
+ - Throwing errors in a resolver will set the field value as `null` and add an error to the response's `errors` array.
180
+ - 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.
181
+ - You can now specify a `context` function that you can use to customize the `requestContext` given to resolvers.
182
+ - The `LocalState` class accepts a `Resolvers` generic that provides autocompletion and type checking against your resolver types to ensure your resolvers are type-safe.
183
+ - `data: null` is now handled correctly and does not call your local resolvers when the server does not provide a result.
184
+ - Additional warnings have been added to provide hints when resolvers behave unexpectedly.
185
+
186
+ ```ts
187
+ import { LocalState } from "@apollo/client/local-state";
188
+
189
+ import { Resolvers } from "./path/to/local-resolvers-types.ts";
190
+
191
+ // LocalState now accepts a `Resolvers` generic.
192
+ const localState = new LocalState<Resolvers>({
193
+ // The return value of this funciton
194
+ context: (options) => ({
195
+ // ...
196
+ }),
197
+ resolvers: {
198
+ // ...
199
+ },
200
+ });
201
+
202
+ // You may also pass a `ContextValue` generic used to ensure the `context`
203
+ // function returns the correct type. This type is inferred from your resolvers
204
+ // if not provided.
205
+ new LocalState<Resolvers, ContextValue>({
206
+ // ...
207
+ });
208
+ ```
209
+
3
210
  ## 4.0.0-alpha.13
4
211
 
5
212
  ### Major Changes
@@ -1015,6 +1222,12 @@
1015
1222
 
1016
1223
  - [#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`.
1017
1224
 
1225
+ ## 3.13.8
1226
+
1227
+ ### Patch Changes
1228
+
1229
+ - [#12567](https://github.com/apollographql/apollo-client/pull/12567) [`c19d415`](https://github.com/apollographql/apollo-client/commit/c19d41513cac0cc143aa7358f26c89c9408da102) Thanks [@thearchitector](https://github.com/thearchitector)! - Fix in-flight multipart urql subscription cancellation
1230
+
1018
1231
  ## 3.13.7
1019
1232
 
1020
1233
  ### Patch Changes
@@ -94,7 +94,7 @@ class ApolloCache {
94
94
  if (environment_1.__DEV__) {
95
95
  const actualFragmentName = fragmentName || (0, internal_1.getFragmentDefinition)(fragment).name.value;
96
96
  if (!id) {
97
- __DEV__ && invariant_1.invariant.warn(96, actualFragmentName);
97
+ __DEV__ && invariant_1.invariant.warn(109, actualFragmentName);
98
98
  }
99
99
  }
100
100
  const diffOptions = {
@@ -193,12 +193,14 @@ class ApolloCache {
193
193
  });
194
194
  }
195
195
  /**
196
- * @experimental
197
- * @internal
198
- * This is not a stable API - it is used in development builds to expose
199
- * information to the DevTools.
200
- * Use at your own risk!
201
- */
196
+ * @experimental
197
+ * @internal
198
+ * This is not a stable API - it is used in development builds to expose
199
+ * information to the DevTools.
200
+ * Use at your own risk!
201
+ *
202
+ * @deprecated This is an internal API and should not be used directly. This can be removed or changed at any time.
203
+ */
202
204
  getMemoryInternals;
203
205
  }
204
206
  exports.ApolloCache = ApolloCache;