@apollo/client 3.8.0-alpha.1 → 3.8.0-alpha.11

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 (373) hide show
  1. package/README.md +3 -1
  2. package/apollo-client.cjs +661 -468
  3. package/apollo-client.cjs.map +1 -1
  4. package/apollo-client.min.cjs +1 -1
  5. package/cache/cache.cjs +56 -44
  6. package/cache/cache.cjs.map +1 -1
  7. package/cache/cache.cjs.native.js +56 -44
  8. package/cache/core/cache.d.ts +2 -1
  9. package/cache/core/cache.d.ts.map +1 -1
  10. package/cache/core/cache.js +1 -0
  11. package/cache/core/cache.js.map +1 -1
  12. package/cache/core/types/DataProxy.d.ts +3 -2
  13. package/cache/core/types/DataProxy.d.ts.map +1 -1
  14. package/cache/core/types/DataProxy.js.map +1 -1
  15. package/cache/core/types/common.d.ts +7 -7
  16. package/cache/core/types/common.d.ts.map +1 -1
  17. package/cache/inmemory/entityStore.d.ts +1 -1
  18. package/cache/inmemory/entityStore.d.ts.map +1 -1
  19. package/cache/inmemory/entityStore.js +1 -1
  20. package/cache/inmemory/helpers.d.ts +2 -2
  21. package/cache/inmemory/helpers.d.ts.map +1 -1
  22. package/cache/inmemory/helpers.js +2 -2
  23. package/cache/inmemory/helpers.js.map +1 -1
  24. package/cache/inmemory/inMemoryCache.d.ts +4 -2
  25. package/cache/inmemory/inMemoryCache.d.ts.map +1 -1
  26. package/cache/inmemory/inMemoryCache.js +2 -1
  27. package/cache/inmemory/inMemoryCache.js.map +1 -1
  28. package/cache/inmemory/key-extractor.js +1 -1
  29. package/cache/inmemory/object-canon.d.ts +0 -1
  30. package/cache/inmemory/object-canon.d.ts.map +1 -1
  31. package/cache/inmemory/object-canon.js +1 -1
  32. package/cache/inmemory/object-canon.js.map +1 -1
  33. package/cache/inmemory/policies.d.ts +12 -12
  34. package/cache/inmemory/policies.d.ts.map +1 -1
  35. package/cache/inmemory/policies.js +15 -4
  36. package/cache/inmemory/policies.js.map +1 -1
  37. package/cache/inmemory/reactiveVars.d.ts +1 -1
  38. package/cache/inmemory/reactiveVars.d.ts.map +1 -1
  39. package/cache/inmemory/readFromStore.d.ts +2 -2
  40. package/cache/inmemory/readFromStore.d.ts.map +1 -1
  41. package/cache/inmemory/readFromStore.js +1 -1
  42. package/cache/inmemory/readFromStore.js.map +1 -1
  43. package/cache/inmemory/types.d.ts +4 -4
  44. package/cache/inmemory/types.d.ts.map +1 -1
  45. package/cache/inmemory/writeToStore.d.ts +1 -1
  46. package/cache/inmemory/writeToStore.d.ts.map +1 -1
  47. package/cache/inmemory/writeToStore.js +1 -1
  48. package/cache/inmemory/writeToStore.js.map +1 -1
  49. package/core/ApolloClient.d.ts +10 -9
  50. package/core/ApolloClient.d.ts.map +1 -1
  51. package/core/ApolloClient.js +17 -11
  52. package/core/ApolloClient.js.map +1 -1
  53. package/core/LocalState.d.ts +12 -7
  54. package/core/LocalState.d.ts.map +1 -1
  55. package/core/LocalState.js +71 -17
  56. package/core/LocalState.js.map +1 -1
  57. package/core/ObservableQuery.d.ts +6 -7
  58. package/core/ObservableQuery.d.ts.map +1 -1
  59. package/core/ObservableQuery.js +6 -10
  60. package/core/ObservableQuery.js.map +1 -1
  61. package/core/QueryInfo.d.ts +1 -1
  62. package/core/QueryInfo.d.ts.map +1 -1
  63. package/core/QueryInfo.js +1 -1
  64. package/core/QueryInfo.js.map +1 -1
  65. package/core/QueryManager.d.ts +7 -7
  66. package/core/QueryManager.d.ts.map +1 -1
  67. package/core/QueryManager.js +24 -14
  68. package/core/QueryManager.js.map +1 -1
  69. package/core/core.cjs +142 -83
  70. package/core/core.cjs.map +1 -1
  71. package/core/core.cjs.native.js +142 -83
  72. package/core/index.js +2 -2
  73. package/core/index.js.map +1 -1
  74. package/core/networkStatus.d.ts +1 -0
  75. package/core/networkStatus.d.ts.map +1 -1
  76. package/core/networkStatus.js +3 -0
  77. package/core/networkStatus.js.map +1 -1
  78. package/core/types.d.ts +24 -17
  79. package/core/types.d.ts.map +1 -1
  80. package/core/types.js +1 -0
  81. package/core/types.js.map +1 -1
  82. package/core/watchQueryOptions.d.ts +11 -12
  83. package/core/watchQueryOptions.d.ts.map +1 -1
  84. package/core/watchQueryOptions.js.map +1 -1
  85. package/errors/index.d.ts +2 -2
  86. package/errors/index.d.ts.map +1 -1
  87. package/invariantErrorCodes.js +58 -52
  88. package/link/batch/batch.cjs +5 -3
  89. package/link/batch/batch.cjs.map +1 -1
  90. package/link/batch/batch.cjs.native.js +5 -3
  91. package/link/batch/batching.d.ts +2 -2
  92. package/link/batch/batching.d.ts.map +1 -1
  93. package/link/batch/batching.js +5 -3
  94. package/link/batch/batching.js.map +1 -1
  95. package/link/batch-http/batch-http.cjs +12 -2
  96. package/link/batch-http/batch-http.cjs.map +1 -1
  97. package/link/batch-http/batch-http.cjs.native.js +12 -2
  98. package/link/batch-http/batchHttpLink.d.ts.map +1 -1
  99. package/link/batch-http/batchHttpLink.js +13 -3
  100. package/link/batch-http/batchHttpLink.js.map +1 -1
  101. package/link/context/index.d.ts +2 -1
  102. package/link/context/index.d.ts.map +1 -1
  103. package/link/context/index.js.map +1 -1
  104. package/link/core/ApolloLink.js +2 -2
  105. package/link/core/core.cjs +2 -2
  106. package/link/core/core.cjs.map +1 -1
  107. package/link/core/core.cjs.native.js +2 -2
  108. package/link/core/types.d.ts +15 -15
  109. package/link/core/types.d.ts.map +1 -1
  110. package/link/core/types.js.map +1 -1
  111. package/link/http/checkFetcher.js +2 -2
  112. package/link/http/createHttpLink.d.ts +0 -1
  113. package/link/http/createHttpLink.d.ts.map +1 -1
  114. package/link/http/createHttpLink.js +10 -2
  115. package/link/http/createHttpLink.js.map +1 -1
  116. package/link/http/http.cjs +20 -38
  117. package/link/http/http.cjs.map +1 -1
  118. package/link/http/http.cjs.native.js +20 -38
  119. package/link/http/iterators/async.js.map +1 -1
  120. package/link/http/iterators/nodeStream.js.map +1 -1
  121. package/link/http/iterators/promise.js.map +1 -1
  122. package/link/http/iterators/reader.js.map +1 -1
  123. package/link/http/parseAndCheckHttpResponse.d.ts +2 -2
  124. package/link/http/parseAndCheckHttpResponse.d.ts.map +1 -1
  125. package/link/http/parseAndCheckHttpResponse.js.map +1 -1
  126. package/link/http/responseIterator.js +1 -1
  127. package/link/http/responseIterator.js.map +1 -1
  128. package/link/http/selectHttpOptionsAndBody.d.ts +2 -2
  129. package/link/http/selectHttpOptionsAndBody.d.ts.map +1 -1
  130. package/link/http/selectHttpOptionsAndBody.js +3 -1
  131. package/link/http/selectHttpOptionsAndBody.js.map +1 -1
  132. package/link/http/serializeFetchParameter.d.ts +1 -1
  133. package/link/http/serializeFetchParameter.d.ts.map +1 -1
  134. package/link/http/serializeFetchParameter.js +2 -2
  135. package/link/persisted-queries/index.d.ts +2 -2
  136. package/link/persisted-queries/index.d.ts.map +1 -1
  137. package/link/persisted-queries/index.js +3 -3
  138. package/link/persisted-queries/persisted-queries.cjs +3 -3
  139. package/link/persisted-queries/persisted-queries.cjs.map +1 -1
  140. package/link/persisted-queries/persisted-queries.cjs.native.js +3 -3
  141. package/link/utils/throwServerError.d.ts +1 -1
  142. package/link/utils/throwServerError.d.ts.map +1 -1
  143. package/link/utils/toPromise.js +1 -1
  144. package/link/utils/utils.cjs +2 -2
  145. package/link/utils/utils.cjs.map +1 -1
  146. package/link/utils/utils.cjs.native.js +2 -2
  147. package/link/utils/validateOperation.js +2 -2
  148. package/package.json +26 -24
  149. package/react/cache/QuerySubscription.d.ts +26 -0
  150. package/react/cache/QuerySubscription.d.ts.map +1 -0
  151. package/react/cache/QuerySubscription.js +88 -0
  152. package/react/cache/QuerySubscription.js.map +1 -0
  153. package/react/cache/SuspenseCache.d.ts +9 -13
  154. package/react/cache/SuspenseCache.d.ts.map +1 -1
  155. package/react/cache/SuspenseCache.js +17 -40
  156. package/react/cache/SuspenseCache.js.map +1 -1
  157. package/react/components/Query.d.ts +2 -2
  158. package/react/components/Query.d.ts.map +1 -1
  159. package/react/components/Query.js.map +1 -1
  160. package/react/components/Subscription.d.ts +2 -2
  161. package/react/components/Subscription.d.ts.map +1 -1
  162. package/react/components/Subscription.js.map +1 -1
  163. package/react/components/types.d.ts +2 -2
  164. package/react/components/types.d.ts.map +1 -1
  165. package/react/components/types.js.map +1 -1
  166. package/react/context/ApolloConsumer.js +2 -2
  167. package/react/context/ApolloProvider.js +2 -2
  168. package/react/context/context.cjs +4 -4
  169. package/react/context/context.cjs.map +1 -1
  170. package/react/context/context.cjs.native.js +4 -4
  171. package/react/hoc/graphql.d.ts +2 -1
  172. package/react/hoc/graphql.d.ts.map +1 -1
  173. package/react/hoc/graphql.js.map +1 -1
  174. package/react/hoc/hoc-utils.d.ts +1 -1
  175. package/react/hoc/hoc-utils.d.ts.map +1 -1
  176. package/react/hoc/hoc-utils.js +2 -2
  177. package/react/hoc/hoc.cjs +4 -4
  178. package/react/hoc/hoc.cjs.map +1 -1
  179. package/react/hoc/hoc.cjs.native.js +4 -4
  180. package/react/hoc/mutation-hoc.d.ts +2 -2
  181. package/react/hoc/mutation-hoc.d.ts.map +1 -1
  182. package/react/hoc/mutation-hoc.js.map +1 -1
  183. package/react/hoc/query-hoc.d.ts +1 -1
  184. package/react/hoc/query-hoc.d.ts.map +1 -1
  185. package/react/hoc/query-hoc.js.map +1 -1
  186. package/react/hoc/subscription-hoc.d.ts +1 -1
  187. package/react/hoc/subscription-hoc.d.ts.map +1 -1
  188. package/react/hoc/subscription-hoc.js.map +1 -1
  189. package/react/hoc/types.d.ts +6 -6
  190. package/react/hoc/types.d.ts.map +1 -1
  191. package/react/hoc/types.js.map +1 -1
  192. package/react/hoc/withApollo.js +2 -2
  193. package/react/hooks/hooks.cjs +190 -174
  194. package/react/hooks/hooks.cjs.map +1 -1
  195. package/react/hooks/hooks.cjs.native.js +190 -174
  196. package/react/hooks/internal/__use.d.ts +2 -0
  197. package/react/hooks/internal/__use.d.ts.map +1 -0
  198. package/react/hooks/internal/__use.js +13 -0
  199. package/react/hooks/internal/__use.js.map +1 -0
  200. package/react/hooks/internal/index.d.ts +3 -0
  201. package/react/hooks/internal/index.d.ts.map +1 -1
  202. package/react/hooks/internal/index.js +3 -0
  203. package/react/hooks/internal/index.js.map +1 -1
  204. package/react/hooks/internal/useIsomorphicLayoutEffect.d.ts +3 -0
  205. package/react/hooks/internal/useIsomorphicLayoutEffect.d.ts.map +1 -0
  206. package/react/hooks/internal/useIsomorphicLayoutEffect.js +6 -0
  207. package/react/hooks/internal/useIsomorphicLayoutEffect.js.map +1 -0
  208. package/react/hooks/internal/useStrictModeSafeCleanupEffect.d.ts +2 -0
  209. package/react/hooks/internal/useStrictModeSafeCleanupEffect.d.ts.map +1 -0
  210. package/react/hooks/internal/useStrictModeSafeCleanupEffect.js +11 -0
  211. package/react/hooks/internal/useStrictModeSafeCleanupEffect.js.map +1 -0
  212. package/react/hooks/useApolloClient.js +2 -2
  213. package/react/hooks/useFragment.d.ts +4 -2
  214. package/react/hooks/useFragment.d.ts.map +1 -1
  215. package/react/hooks/useFragment.js +9 -8
  216. package/react/hooks/useFragment.js.map +1 -1
  217. package/react/hooks/useLazyQuery.d.ts +2 -2
  218. package/react/hooks/useLazyQuery.d.ts.map +1 -1
  219. package/react/hooks/useLazyQuery.js +22 -8
  220. package/react/hooks/useLazyQuery.js.map +1 -1
  221. package/react/hooks/useMutation.d.ts +2 -2
  222. package/react/hooks/useMutation.d.ts.map +1 -1
  223. package/react/hooks/useMutation.js +9 -8
  224. package/react/hooks/useMutation.js.map +1 -1
  225. package/react/hooks/useQuery.d.ts +6 -5
  226. package/react/hooks/useQuery.d.ts.map +1 -1
  227. package/react/hooks/useQuery.js +21 -7
  228. package/react/hooks/useQuery.js.map +1 -1
  229. package/react/hooks/useSubscription.d.ts +2 -3
  230. package/react/hooks/useSubscription.d.ts.map +1 -1
  231. package/react/hooks/useSubscription.js +1 -2
  232. package/react/hooks/useSubscription.js.map +1 -1
  233. package/react/hooks/useSuspenseCache.d.ts +2 -1
  234. package/react/hooks/useSuspenseCache.d.ts.map +1 -1
  235. package/react/hooks/useSuspenseCache.js +7 -5
  236. package/react/hooks/useSuspenseCache.js.map +1 -1
  237. package/react/hooks/useSuspenseQuery.d.ts +16 -4
  238. package/react/hooks/useSuspenseQuery.d.ts.map +1 -1
  239. package/react/hooks/useSuspenseQuery.js +73 -136
  240. package/react/hooks/useSuspenseQuery.js.map +1 -1
  241. package/react/hooks/useSyncExternalStore.d.ts +1 -1
  242. package/react/hooks/useSyncExternalStore.d.ts.map +1 -1
  243. package/react/hooks/useSyncExternalStore.js +1 -1
  244. package/react/hooks/useSyncExternalStore.js.map +1 -1
  245. package/react/parser/index.js +6 -6
  246. package/react/parser/parser.cjs +10 -10
  247. package/react/parser/parser.cjs.map +1 -1
  248. package/react/parser/parser.cjs.native.js +10 -10
  249. package/react/react.cjs +112 -38
  250. package/react/react.cjs.map +1 -1
  251. package/react/react.cjs.native.js +112 -38
  252. package/react/ssr/RenderPromises.d.ts +4 -4
  253. package/react/ssr/RenderPromises.d.ts.map +1 -1
  254. package/react/ssr/RenderPromises.js.map +1 -1
  255. package/react/ssr/getDataFromTree.d.ts +1 -1
  256. package/react/ssr/getDataFromTree.d.ts.map +1 -1
  257. package/react/types/types.d.ts +26 -25
  258. package/react/types/types.d.ts.map +1 -1
  259. package/react/types/types.js.map +1 -1
  260. package/testing/core/core.cjs +30 -3
  261. package/testing/core/core.cjs.map +1 -1
  262. package/testing/core/core.cjs.native.js +30 -3
  263. package/testing/core/index.d.ts +2 -1
  264. package/testing/core/index.d.ts.map +1 -1
  265. package/testing/core/index.js +1 -0
  266. package/testing/core/index.js.map +1 -1
  267. package/testing/core/itAsync.js.map +1 -1
  268. package/testing/core/mocking/mockFetch.js.map +1 -1
  269. package/testing/core/mocking/mockLink.d.ts +8 -4
  270. package/testing/core/mocking/mockLink.d.ts.map +1 -1
  271. package/testing/core/mocking/mockLink.js +14 -4
  272. package/testing/core/mocking/mockLink.js.map +1 -1
  273. package/testing/core/mocking/mockQueryManager.d.ts +1 -1
  274. package/testing/core/mocking/mockQueryManager.d.ts.map +1 -1
  275. package/testing/core/mocking/mockQueryManager.js +3 -3
  276. package/testing/core/mocking/mockQueryManager.js.map +1 -1
  277. package/testing/core/mocking/mockWatchQuery.d.ts +1 -1
  278. package/testing/core/mocking/mockWatchQuery.d.ts.map +1 -1
  279. package/testing/core/mocking/mockWatchQuery.js +4 -5
  280. package/testing/core/mocking/mockWatchQuery.js.map +1 -1
  281. package/testing/core/observableToPromise.d.ts +2 -2
  282. package/testing/core/observableToPromise.d.ts.map +1 -1
  283. package/testing/core/observableToPromise.js.map +1 -1
  284. package/testing/core/wait.d.ts +3 -0
  285. package/testing/core/wait.d.ts.map +1 -0
  286. package/testing/core/wait.js +16 -0
  287. package/testing/core/wait.js.map +1 -0
  288. package/testing/react/MockedProvider.d.ts +1 -0
  289. package/testing/react/MockedProvider.d.ts.map +1 -1
  290. package/testing/react/MockedProvider.js +2 -2
  291. package/testing/react/MockedProvider.js.map +1 -1
  292. package/testing/testing.cjs +112 -40
  293. package/testing/testing.cjs.map +1 -1
  294. package/testing/testing.cjs.native.js +112 -40
  295. package/utilities/common/arrays.d.ts +1 -0
  296. package/utilities/common/arrays.d.ts.map +1 -1
  297. package/utilities/common/arrays.js +1 -0
  298. package/utilities/common/arrays.js.map +1 -1
  299. package/utilities/common/cloneDeep.js.map +1 -1
  300. package/utilities/common/errorHandling.d.ts +2 -2
  301. package/utilities/common/errorHandling.d.ts.map +1 -1
  302. package/utilities/common/errorHandling.js.map +1 -1
  303. package/utilities/common/incrementalResult.d.ts +4 -4
  304. package/utilities/common/incrementalResult.d.ts.map +1 -1
  305. package/utilities/common/incrementalResult.js.map +1 -1
  306. package/utilities/common/maybeDeepFreeze.d.ts +0 -1
  307. package/utilities/common/maybeDeepFreeze.d.ts.map +1 -1
  308. package/utilities/common/maybeDeepFreeze.js +1 -1
  309. package/utilities/common/maybeDeepFreeze.js.map +1 -1
  310. package/utilities/common/mergeDeep.d.ts +2 -2
  311. package/utilities/common/mergeDeep.d.ts.map +1 -1
  312. package/utilities/common/mergeOptions.d.ts +3 -3
  313. package/utilities/common/mergeOptions.d.ts.map +1 -1
  314. package/utilities/common/mergeOptions.js +1 -1
  315. package/utilities/common/mergeOptions.js.map +1 -1
  316. package/utilities/globals/DEV.d.ts +1 -1
  317. package/utilities/globals/DEV.d.ts.map +1 -1
  318. package/utilities/globals/DEV.js +1 -17
  319. package/utilities/globals/DEV.js.map +1 -1
  320. package/utilities/globals/global.d.ts +5 -2
  321. package/utilities/globals/global.d.ts.map +1 -1
  322. package/utilities/globals/global.js.map +1 -1
  323. package/utilities/globals/globals.cjs +5 -22
  324. package/utilities/globals/globals.cjs.map +1 -1
  325. package/utilities/globals/globals.cjs.native.js +5 -22
  326. package/utilities/globals/index.d.ts +1 -1
  327. package/utilities/globals/index.d.ts.map +1 -1
  328. package/utilities/globals/index.js +1 -4
  329. package/utilities/globals/index.js.map +1 -1
  330. package/utilities/graphql/directives.d.ts +2 -2
  331. package/utilities/graphql/directives.d.ts.map +1 -1
  332. package/utilities/graphql/directives.js +5 -5
  333. package/utilities/graphql/directives.js.map +1 -1
  334. package/utilities/graphql/fragments.d.ts +1 -1
  335. package/utilities/graphql/fragments.d.ts.map +1 -1
  336. package/utilities/graphql/fragments.js +4 -4
  337. package/utilities/graphql/getFromAST.d.ts.map +1 -1
  338. package/utilities/graphql/getFromAST.js +16 -12
  339. package/utilities/graphql/getFromAST.js.map +1 -1
  340. package/utilities/graphql/storeUtils.d.ts +3 -3
  341. package/utilities/graphql/storeUtils.d.ts.map +1 -1
  342. package/utilities/graphql/storeUtils.js +2 -2
  343. package/utilities/graphql/storeUtils.js.map +1 -1
  344. package/utilities/graphql/transform.d.ts +9 -9
  345. package/utilities/graphql/transform.d.ts.map +1 -1
  346. package/utilities/graphql/transform.js +168 -91
  347. package/utilities/graphql/transform.js.map +1 -1
  348. package/utilities/index.d.ts +2 -0
  349. package/utilities/index.d.ts.map +1 -1
  350. package/utilities/index.js +2 -0
  351. package/utilities/index.js.map +1 -1
  352. package/utilities/observables/Concast.d.ts +5 -5
  353. package/utilities/observables/Concast.d.ts.map +1 -1
  354. package/utilities/observables/Concast.js +2 -2
  355. package/utilities/observables/Concast.js.map +1 -1
  356. package/utilities/observables/asyncMap.js.map +1 -1
  357. package/utilities/policies/pagination.d.ts +7 -7
  358. package/utilities/policies/pagination.d.ts.map +1 -1
  359. package/utilities/policies/pagination.js.map +1 -1
  360. package/utilities/promises/decoration.d.ts +15 -0
  361. package/utilities/promises/decoration.d.ts.map +1 -0
  362. package/utilities/promises/decoration.js +25 -0
  363. package/utilities/promises/decoration.js.map +1 -0
  364. package/utilities/types/IsStrictlyAny.d.ts +3 -3
  365. package/utilities/types/IsStrictlyAny.d.ts.map +1 -1
  366. package/utilities/utilities.cjs +256 -128
  367. package/utilities/utilities.cjs.map +1 -1
  368. package/utilities/utilities.cjs.native.js +256 -128
  369. package/version.js +1 -1
  370. package/cache/inmemory/__mocks__/optimism.d.ts +0 -2
  371. package/cache/inmemory/__mocks__/optimism.d.ts.map +0 -1
  372. package/cache/inmemory/__mocks__/optimism.js +0 -14
  373. package/cache/inmemory/__mocks__/optimism.js.map +0 -1
package/cache/cache.cjs CHANGED
@@ -13,6 +13,7 @@ var context = require('@wry/context');
13
13
 
14
14
  var ApolloCache = (function () {
15
15
  function ApolloCache() {
16
+ this.assumeImmutableResults = false;
16
17
  this.getFragmentDoc = optimism.wrap(utilities.getFragmentQueryDocument);
17
18
  }
18
19
  ApolloCache.prototype.batch = function (options) {
@@ -123,7 +124,6 @@ var hasOwn = Object.prototype.hasOwnProperty;
123
124
  function isNullish(value) {
124
125
  return value === null || value === void 0;
125
126
  }
126
- var isArray = Array.isArray;
127
127
  function defaultDataIdFromObject(_a, context) {
128
128
  var __typename = _a.__typename, id = _a.id, _id = _a._id;
129
129
  if (typeof __typename === "string") {
@@ -167,7 +167,7 @@ function fieldNameFromStoreName(storeFieldName) {
167
167
  }
168
168
  function selectionSetMatchesResult(selectionSet, result, variables) {
169
169
  if (utilities.isNonNullObject(result)) {
170
- return isArray(result)
170
+ return utilities.isArray(result)
171
171
  ? result.every(function (item) { return selectionSetMatchesResult(selectionSet, item, variables); })
172
172
  : selectionSet.selections.every(function (field) {
173
173
  if (utilities.isField(field) && utilities.shouldInclude(field, variables)) {
@@ -184,7 +184,7 @@ function selectionSetMatchesResult(selectionSet, result, variables) {
184
184
  function storeValueIsStoreObject(value) {
185
185
  return utilities.isNonNullObject(value) &&
186
186
  !utilities.isReference(value) &&
187
- !isArray(value);
187
+ !utilities.isArray(value);
188
188
  }
189
189
  function makeProcessedFieldsMerger() {
190
190
  return new utilities.DeepMerger;
@@ -289,7 +289,7 @@ exports.EntityStore = (function () {
289
289
  : newer;
290
290
  if (!incoming)
291
291
  return;
292
- __DEV__ ? globals.invariant(typeof dataId === "string", "store.merge expects a string ID") : globals.invariant(typeof dataId === "string", 1);
292
+ globals.__DEV__ ? globals.invariant(typeof dataId === "string", "store.merge expects a string ID") : globals.invariant(typeof dataId === "string", 1);
293
293
  var merged = new utilities.DeepMerger(storeObjectReconciler).merge(existing, incoming);
294
294
  this.data[dataId] = merged;
295
295
  if (merged !== existing) {
@@ -664,7 +664,7 @@ function supportsResultCaching(store) {
664
664
 
665
665
  function shallowCopy(value) {
666
666
  if (utilities.isNonNullObject(value)) {
667
- return isArray(value)
667
+ return utilities.isArray(value)
668
668
  ? value.slice(0)
669
669
  : tslib.__assign({ __proto__: Object.getPrototypeOf(value) }, value);
670
670
  }
@@ -704,7 +704,7 @@ var ObjectCanon = (function () {
704
704
  var node = this.pool.lookupArray(array);
705
705
  if (!node.array) {
706
706
  this.known.add(node.array = array);
707
- if (__DEV__) {
707
+ if (globals.__DEV__) {
708
708
  Object.freeze(array);
709
709
  }
710
710
  }
@@ -729,7 +729,7 @@ var ObjectCanon = (function () {
729
729
  keys.sorted.forEach(function (key, i) {
730
730
  obj_1[key] = array_1[firstValueIndex_1 + i];
731
731
  });
732
- if (__DEV__) {
732
+ if (globals.__DEV__) {
733
733
  Object.freeze(obj_1);
734
734
  }
735
735
  }
@@ -916,7 +916,7 @@ var StoreReader = (function () {
916
916
  _a));
917
917
  }
918
918
  }
919
- else if (isArray(fieldValue)) {
919
+ else if (utilities.isArray(fieldValue)) {
920
920
  fieldValue = handleMissing(_this.executeSubSelectedArray({
921
921
  field: selection,
922
922
  array: fieldValue,
@@ -944,7 +944,7 @@ var StoreReader = (function () {
944
944
  else {
945
945
  var fragment = utilities.getFragmentFromSelection(selection, context.lookupFragment);
946
946
  if (!fragment && selection.kind === graphql.Kind.FRAGMENT_SPREAD) {
947
- throw __DEV__ ? new globals.InvariantError("No fragment named ".concat(selection.name.value)) : new globals.InvariantError(5);
947
+ throw globals.__DEV__ ? new globals.InvariantError("No fragment named ".concat(selection.name.value)) : new globals.InvariantError(5);
948
948
  }
949
949
  if (fragment && policies.fragmentMatches(fragment, typename)) {
950
950
  fragment.selectionSet.selections.forEach(workSet.add, workSet);
@@ -980,7 +980,7 @@ var StoreReader = (function () {
980
980
  if (item === null) {
981
981
  return null;
982
982
  }
983
- if (isArray(item)) {
983
+ if (utilities.isArray(item)) {
984
984
  return handleMissing(_this.executeSubSelectedArray({
985
985
  field: field,
986
986
  array: item,
@@ -996,7 +996,7 @@ var StoreReader = (function () {
996
996
  context: context,
997
997
  }), i);
998
998
  }
999
- if (__DEV__) {
999
+ if (globals.__DEV__) {
1000
1000
  assertSelectionSetForIdValue(context.store, field, item);
1001
1001
  }
1002
1002
  return item;
@@ -1025,7 +1025,7 @@ function assertSelectionSetForIdValue(store, field, fieldValue) {
1025
1025
  var workSet_1 = new Set([fieldValue]);
1026
1026
  workSet_1.forEach(function (value) {
1027
1027
  if (utilities.isNonNullObject(value)) {
1028
- __DEV__ ? globals.invariant(!utilities.isReference(value), "Missing selection set for object of type ".concat(getTypenameFromStoreObject(store, value), " returned for query field ").concat(field.name.value)) : globals.invariant(!utilities.isReference(value), 6);
1028
+ globals.__DEV__ ? globals.invariant(!utilities.isReference(value), "Missing selection set for object of type ".concat(getTypenameFromStoreObject(store, value), " returned for query field ").concat(field.name.value)) : globals.invariant(!utilities.isReference(value), 6);
1029
1029
  Object.values(value).forEach(workSet_1.add, workSet_1);
1030
1030
  }
1031
1031
  });
@@ -1112,7 +1112,7 @@ function keyFieldsFnFromSpecifier(specifier) {
1112
1112
  hasOwn.call(object, schemaKeyPath[0])) {
1113
1113
  extracted = extractKeyPath(object, schemaKeyPath, extractKey);
1114
1114
  }
1115
- __DEV__ ? globals.invariant(extracted !== void 0, "Missing field '".concat(schemaKeyPath.join('.'), "' while extracting keyFields from ").concat(JSON.stringify(object))) : globals.invariant(extracted !== void 0, 2);
1115
+ globals.__DEV__ ? globals.invariant(extracted !== void 0, "Missing field '".concat(schemaKeyPath.join('.'), "' while extracting keyFields from ").concat(JSON.stringify(object))) : globals.invariant(extracted !== void 0, 2);
1116
1116
  return extracted;
1117
1117
  });
1118
1118
  return "".concat(context.typename, ":").concat(JSON.stringify(keyObject));
@@ -1174,13 +1174,13 @@ function getSpecifierPaths(spec) {
1174
1174
  var paths_1 = info.paths = [];
1175
1175
  var currentPath_1 = [];
1176
1176
  spec.forEach(function (s, i) {
1177
- if (isArray(s)) {
1177
+ if (utilities.isArray(s)) {
1178
1178
  getSpecifierPaths(s).forEach(function (p) { return paths_1.push(currentPath_1.concat(p)); });
1179
1179
  currentPath_1.length = 0;
1180
1180
  }
1181
1181
  else {
1182
1182
  currentPath_1.push(s);
1183
- if (!isArray(spec[i + 1])) {
1183
+ if (!utilities.isArray(spec[i + 1])) {
1184
1184
  paths_1.push(currentPath_1.slice(0));
1185
1185
  currentPath_1.length = 0;
1186
1186
  }
@@ -1195,14 +1195,14 @@ function extractKey(object, key) {
1195
1195
  function extractKeyPath(object, path, extract) {
1196
1196
  extract = extract || extractKey;
1197
1197
  return normalize(path.reduce(function reducer(obj, key) {
1198
- return isArray(obj)
1198
+ return utilities.isArray(obj)
1199
1199
  ? obj.map(function (child) { return reducer(child, key); })
1200
1200
  : obj && extract(obj, key);
1201
1201
  }, object));
1202
1202
  }
1203
1203
  function normalize(value) {
1204
1204
  if (utilities.isNonNullObject(value)) {
1205
- if (isArray(value)) {
1205
+ if (utilities.isArray(value)) {
1206
1206
  return value.map(normalize);
1207
1207
  }
1208
1208
  return collectSpecifierPaths(Object.keys(value).sort(), function (path) { return extractKeyPath(value, path); });
@@ -1265,7 +1265,7 @@ var Policies = (function () {
1265
1265
  var keyFn = policy && policy.keyFn || this.config.dataIdFromObject;
1266
1266
  while (keyFn) {
1267
1267
  var specifierOrId = keyFn(object, context);
1268
- if (isArray(specifierOrId)) {
1268
+ if (utilities.isArray(specifierOrId)) {
1269
1269
  keyFn = keyFieldsFnFromSpecifier(specifierOrId);
1270
1270
  }
1271
1271
  else {
@@ -1308,7 +1308,7 @@ var Policies = (function () {
1308
1308
  setMerge(existing, incoming.merge);
1309
1309
  existing.keyFn =
1310
1310
  keyFields === false ? nullKeyFieldsFn :
1311
- isArray(keyFields) ? keyFieldsFnFromSpecifier(keyFields) :
1311
+ utilities.isArray(keyFields) ? keyFieldsFnFromSpecifier(keyFields) :
1312
1312
  typeof keyFields === "function" ? keyFields :
1313
1313
  existing.keyFn;
1314
1314
  if (fields) {
@@ -1322,7 +1322,7 @@ var Policies = (function () {
1322
1322
  var keyArgs = incoming.keyArgs, read = incoming.read, merge = incoming.merge;
1323
1323
  existing.keyFn =
1324
1324
  keyArgs === false ? simpleKeyArgsFn :
1325
- isArray(keyArgs) ? keyArgsFnFromSpecifier(keyArgs) :
1325
+ utilities.isArray(keyArgs) ? keyArgsFnFromSpecifier(keyArgs) :
1326
1326
  typeof keyArgs === "function" ? keyArgs :
1327
1327
  existing.keyFn;
1328
1328
  if (typeof read === "function") {
@@ -1341,7 +1341,7 @@ var Policies = (function () {
1341
1341
  var rootId = "ROOT_" + which.toUpperCase();
1342
1342
  var old = this.rootTypenamesById[rootId];
1343
1343
  if (typename !== old) {
1344
- __DEV__ ? globals.invariant(!old || old === which, "Cannot change root ".concat(which, " __typename more than once")) : globals.invariant(!old || old === which, 3);
1344
+ globals.__DEV__ ? globals.invariant(!old || old === which, "Cannot change root ".concat(which, " __typename more than once")) : globals.invariant(!old || old === which, 3);
1345
1345
  if (old)
1346
1346
  delete this.rootIdsByTypename[old];
1347
1347
  this.rootIdsByTypename[typename] = rootId;
@@ -1367,9 +1367,20 @@ var Policies = (function () {
1367
1367
  if (!hasOwn.call(this.typePolicies, typename)) {
1368
1368
  var policy_1 = this.typePolicies[typename] = Object.create(null);
1369
1369
  policy_1.fields = Object.create(null);
1370
- var supertypes = this.supertypeMap.get(typename);
1371
- if (supertypes && supertypes.size) {
1372
- supertypes.forEach(function (supertype) {
1370
+ var supertypes_1 = this.supertypeMap.get(typename);
1371
+ if (!supertypes_1 && this.fuzzySubtypes.size) {
1372
+ supertypes_1 = this.getSupertypeSet(typename, true);
1373
+ this.fuzzySubtypes.forEach(function (regExp, fuzzy) {
1374
+ if (regExp.test(typename)) {
1375
+ var fuzzySupertypes = _this.supertypeMap.get(fuzzy);
1376
+ if (fuzzySupertypes) {
1377
+ fuzzySupertypes.forEach(function (supertype) { return supertypes_1.add(supertype); });
1378
+ }
1379
+ }
1380
+ });
1381
+ }
1382
+ if (supertypes_1 && supertypes_1.size) {
1383
+ supertypes_1.forEach(function (supertype) {
1373
1384
  var _a = _this.getTypePolicy(supertype), fields = _a.fields, rest = tslib.__rest(_a, ["fields"]);
1374
1385
  Object.assign(policy_1, rest);
1375
1386
  Object.assign(policy_1.fields, fields);
@@ -1425,7 +1436,7 @@ var Policies = (function () {
1425
1436
  if (supertypeSet.has(supertype)) {
1426
1437
  if (!typenameSupertypeSet.has(supertype)) {
1427
1438
  if (checkingFuzzySubtypes) {
1428
- __DEV__ && globals.invariant.warn("Inferring subtype ".concat(typename, " of supertype ").concat(supertype));
1439
+ globals.__DEV__ && globals.invariant.warn("Inferring subtype ".concat(typename, " of supertype ").concat(supertype));
1429
1440
  }
1430
1441
  typenameSupertypeSet.add(supertype);
1431
1442
  }
@@ -1467,7 +1478,7 @@ var Policies = (function () {
1467
1478
  var args = argsFromFieldSpecifier(fieldSpec);
1468
1479
  while (keyFn) {
1469
1480
  var specifierOrString = keyFn(args, context);
1470
- if (isArray(specifierOrString)) {
1481
+ if (utilities.isArray(specifierOrString)) {
1471
1482
  keyFn = keyArgsFnFromSpecifier(specifierOrString);
1472
1483
  }
1473
1484
  else {
@@ -1578,8 +1589,8 @@ function normalizeReadFieldOptions(readFieldArgs, objectOrReference, variables)
1578
1589
  options.from = objectOrReference;
1579
1590
  }
1580
1591
  }
1581
- if (__DEV__ && options.from === void 0) {
1582
- __DEV__ && globals.invariant.warn("Undefined 'from' passed to readField with arguments ".concat(utilities.stringifyForDisplay(Array.from(readFieldArgs))));
1592
+ if (globals.__DEV__ && options.from === void 0) {
1593
+ globals.__DEV__ && globals.invariant.warn("Undefined 'from' passed to readField with arguments ".concat(utilities.stringifyForDisplay(Array.from(readFieldArgs))));
1583
1594
  }
1584
1595
  if (void 0 === options.variables) {
1585
1596
  options.variables = variables;
@@ -1588,8 +1599,8 @@ function normalizeReadFieldOptions(readFieldArgs, objectOrReference, variables)
1588
1599
  }
1589
1600
  function makeMergeObjectsFunction(store) {
1590
1601
  return function mergeObjects(existing, incoming) {
1591
- if (isArray(existing) || isArray(incoming)) {
1592
- throw __DEV__ ? new globals.InvariantError("Cannot automatically merge arrays") : new globals.InvariantError(4);
1602
+ if (utilities.isArray(existing) || utilities.isArray(incoming)) {
1603
+ throw globals.__DEV__ ? new globals.InvariantError("Cannot automatically merge arrays") : new globals.InvariantError(4);
1593
1604
  }
1594
1605
  if (utilities.isNonNullObject(existing) &&
1595
1606
  utilities.isNonNullObject(incoming)) {
@@ -1650,7 +1661,7 @@ var StoreWriter = (function () {
1650
1661
  context: context,
1651
1662
  });
1652
1663
  if (!utilities.isReference(ref)) {
1653
- throw __DEV__ ? new globals.InvariantError("Could not identify object ".concat(JSON.stringify(result))) : new globals.InvariantError(7);
1664
+ throw globals.__DEV__ ? new globals.InvariantError("Could not identify object ".concat(JSON.stringify(result))) : new globals.InvariantError(7);
1654
1665
  }
1655
1666
  context.incomingById.forEach(function (_a, dataId) {
1656
1667
  var storeObject = _a.storeObject, mergeTree = _a.mergeTree, fieldNodeSet = _a.fieldNodeSet;
@@ -1662,7 +1673,7 @@ var StoreWriter = (function () {
1662
1673
  }
1663
1674
  storeObject = applied;
1664
1675
  }
1665
- if (__DEV__ && !context.overwrite) {
1676
+ if (globals.__DEV__ && !context.overwrite) {
1666
1677
  var fieldsWithSelectionSets_1 = Object.create(null);
1667
1678
  fieldNodeSet.forEach(function (field) {
1668
1679
  if (field.selectionSet) {
@@ -1750,12 +1761,12 @@ var StoreWriter = (function () {
1750
1761
  _a[storeFieldName] = incomingValue,
1751
1762
  _a));
1752
1763
  }
1753
- else if (__DEV__ &&
1764
+ else if (globals.__DEV__ &&
1754
1765
  !context.clientOnly &&
1755
1766
  !context.deferred &&
1756
1767
  !utilities.addTypenameToDocument.added(field) &&
1757
1768
  !policies.getReadFunction(typename, field.name.value)) {
1758
- __DEV__ && globals.invariant.error("Missing field '".concat(utilities.resultKeyNameFromField(field), "' while writing result ").concat(JSON.stringify(result, null, 2)).substring(0, 1000));
1769
+ globals.__DEV__ && globals.invariant.error("Missing field '".concat(utilities.resultKeyNameFromField(field), "' while writing result ").concat(JSON.stringify(result, null, 2)).substring(0, 1000));
1759
1770
  }
1760
1771
  });
1761
1772
  try {
@@ -1804,9 +1815,9 @@ var StoreWriter = (function () {
1804
1815
  StoreWriter.prototype.processFieldValue = function (value, field, context, mergeTree) {
1805
1816
  var _this = this;
1806
1817
  if (!field.selectionSet || value === null) {
1807
- return __DEV__ ? utilities.cloneDeep(value) : value;
1818
+ return globals.__DEV__ ? utilities.cloneDeep(value) : value;
1808
1819
  }
1809
- if (isArray(value)) {
1820
+ if (utilities.isArray(value)) {
1810
1821
  return value.map(function (item, i) {
1811
1822
  var value = _this.processFieldValue(item, field, context, getChildMergeTree(mergeTree, i));
1812
1823
  maybeRecycleChildMergeTree(mergeTree, i);
@@ -1859,7 +1870,7 @@ var StoreWriter = (function () {
1859
1870
  else {
1860
1871
  var fragment = utilities.getFragmentFromSelection(selection, context.lookupFragment);
1861
1872
  if (!fragment && selection.kind === graphql.Kind.FRAGMENT_SPREAD) {
1862
- throw __DEV__ ? new globals.InvariantError("No fragment named ".concat(selection.name.value)) : new globals.InvariantError(8);
1873
+ throw globals.__DEV__ ? new globals.InvariantError("No fragment named ".concat(selection.name.value)) : new globals.InvariantError(8);
1863
1874
  }
1864
1875
  if (fragment &&
1865
1876
  policies.fragmentMatches(fragment, typename, result, context.variables)) {
@@ -1874,7 +1885,7 @@ var StoreWriter = (function () {
1874
1885
  var _a;
1875
1886
  var _this = this;
1876
1887
  if (mergeTree.map.size && !utilities.isReference(incoming)) {
1877
- var e_1 = (!isArray(incoming) &&
1888
+ var e_1 = (!utilities.isArray(incoming) &&
1878
1889
  (utilities.isReference(existing) || storeValueIsStoreObject(existing))) ? existing : void 0;
1879
1890
  var i_1 = incoming;
1880
1891
  if (e_1 && !getStorageArgs) {
@@ -1882,7 +1893,7 @@ var StoreWriter = (function () {
1882
1893
  }
1883
1894
  var changedFields_1;
1884
1895
  var getValue_1 = function (from, name) {
1885
- return isArray(from)
1896
+ return utilities.isArray(from)
1886
1897
  ? (typeof name === "number" ? from[name] : void 0)
1887
1898
  : context.store.getFieldValue(from, String(name));
1888
1899
  };
@@ -1904,7 +1915,7 @@ var StoreWriter = (function () {
1904
1915
  }
1905
1916
  });
1906
1917
  if (changedFields_1) {
1907
- incoming = (isArray(i_1) ? i_1.slice(0) : tslib.__assign({}, i_1));
1918
+ incoming = (utilities.isArray(i_1) ? i_1.slice(0) : tslib.__assign({}, i_1));
1908
1919
  changedFields_1.forEach(function (value, name) {
1909
1920
  incoming[name] = value;
1910
1921
  });
@@ -1985,8 +1996,8 @@ function warnAboutDataLoss(existingRef, incomingObj, storeFieldName, store) {
1985
1996
  return;
1986
1997
  warnings.add(typeDotName);
1987
1998
  var childTypenames = [];
1988
- if (!isArray(existing) &&
1989
- !isArray(incoming)) {
1999
+ if (!utilities.isArray(existing) &&
2000
+ !utilities.isArray(incoming)) {
1990
2001
  [existing, incoming].forEach(function (child) {
1991
2002
  var typename = store.getFieldValue(child, "__typename");
1992
2003
  if (typeof typename === "string" &&
@@ -1995,7 +2006,7 @@ function warnAboutDataLoss(existingRef, incomingObj, storeFieldName, store) {
1995
2006
  }
1996
2007
  });
1997
2008
  }
1998
- __DEV__ && globals.invariant.warn("Cache data may be lost when replacing the ".concat(fieldName, " field of a ").concat(parentType, " object.\n\nTo address this problem (which is not a bug in Apollo Client), ").concat(childTypenames.length
2009
+ globals.__DEV__ && globals.invariant.warn("Cache data may be lost when replacing the ".concat(fieldName, " field of a ").concat(parentType, " object.\n\nTo address this problem (which is not a bug in Apollo Client), ").concat(childTypenames.length
1999
2010
  ? "either ensure all objects of type " +
2000
2011
  childTypenames.join(" and ") + " have an ID or a custom merge function, or "
2001
2012
  : "", "define a custom merge function for the ").concat(typeDotName, " field, so InMemoryCache can safely merge these objects:\n\n existing: ").concat(JSON.stringify(existing).slice(0, 1000), "\n incoming: ").concat(JSON.stringify(incoming).slice(0, 1000), "\n\nFor more information about these options, please refer to the documentation:\n\n * Ensuring entity objects have IDs: https://go.apollo.dev/c/generating-unique-identifiers\n * Defining custom merge functions: https://go.apollo.dev/c/merging-non-normalized-objects\n"));
@@ -2008,6 +2019,7 @@ var InMemoryCache = (function (_super) {
2008
2019
  var _this = _super.call(this) || this;
2009
2020
  _this.watches = new Set();
2010
2021
  _this.typenameDocumentCache = new Map();
2022
+ _this.assumeImmutableResults = true;
2011
2023
  _this.makeVar = makeVar;
2012
2024
  _this.txCount = 0;
2013
2025
  _this.config = normalizeConfig(config);
@@ -2155,7 +2167,7 @@ var InMemoryCache = (function (_super) {
2155
2167
  return this.policies.identify(object)[0];
2156
2168
  }
2157
2169
  catch (e) {
2158
- __DEV__ && globals.invariant.warn(e);
2170
+ globals.__DEV__ && globals.invariant.warn(e);
2159
2171
  }
2160
2172
  };
2161
2173
  InMemoryCache.prototype.evict = function (options) {