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

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