@apollo/client 3.8.0-alpha.5 → 3.8.0-alpha.7

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 (307) hide show
  1. package/README.md +1 -0
  2. package/apollo-client.cjs +151 -72
  3. package/apollo-client.cjs.map +1 -1
  4. package/apollo-client.min.cjs +1 -1
  5. package/cache/cache.cjs +20 -20
  6. package/cache/cache.cjs.map +1 -1
  7. package/cache/cache.cjs.native.js +20 -20
  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/common.d.ts +7 -7
  12. package/cache/core/types/common.d.ts.map +1 -1
  13. package/cache/inmemory/entityStore.d.ts +1 -1
  14. package/cache/inmemory/entityStore.d.ts.map +1 -1
  15. package/cache/inmemory/entityStore.js +1 -1
  16. package/cache/inmemory/helpers.js.map +1 -1
  17. package/cache/inmemory/inMemoryCache.d.ts +3 -2
  18. package/cache/inmemory/inMemoryCache.d.ts.map +1 -1
  19. package/cache/inmemory/inMemoryCache.js +1 -1
  20. package/cache/inmemory/inMemoryCache.js.map +1 -1
  21. package/cache/inmemory/key-extractor.js +1 -1
  22. package/cache/inmemory/object-canon.d.ts +0 -1
  23. package/cache/inmemory/object-canon.d.ts.map +1 -1
  24. package/cache/inmemory/object-canon.js +1 -1
  25. package/cache/inmemory/object-canon.js.map +1 -1
  26. package/cache/inmemory/policies.d.ts +12 -12
  27. package/cache/inmemory/policies.d.ts.map +1 -1
  28. package/cache/inmemory/policies.js +1 -1
  29. package/cache/inmemory/policies.js.map +1 -1
  30. package/cache/inmemory/reactiveVars.d.ts +1 -1
  31. package/cache/inmemory/reactiveVars.d.ts.map +1 -1
  32. package/cache/inmemory/readFromStore.d.ts +2 -2
  33. package/cache/inmemory/readFromStore.d.ts.map +1 -1
  34. package/cache/inmemory/readFromStore.js +1 -1
  35. package/cache/inmemory/readFromStore.js.map +1 -1
  36. package/cache/inmemory/types.d.ts +4 -4
  37. package/cache/inmemory/types.d.ts.map +1 -1
  38. package/cache/inmemory/writeToStore.d.ts +1 -1
  39. package/cache/inmemory/writeToStore.d.ts.map +1 -1
  40. package/cache/inmemory/writeToStore.js +1 -1
  41. package/cache/inmemory/writeToStore.js.map +1 -1
  42. package/core/ApolloClient.d.ts +5 -5
  43. package/core/ApolloClient.d.ts.map +1 -1
  44. package/core/ApolloClient.js +1 -1
  45. package/core/ApolloClient.js.map +1 -1
  46. package/core/LocalState.d.ts +9 -6
  47. package/core/LocalState.d.ts.map +1 -1
  48. package/core/LocalState.js +65 -15
  49. package/core/LocalState.js.map +1 -1
  50. package/core/ObservableQuery.d.ts +5 -5
  51. package/core/ObservableQuery.d.ts.map +1 -1
  52. package/core/ObservableQuery.js +2 -2
  53. package/core/ObservableQuery.js.map +1 -1
  54. package/core/QueryInfo.d.ts +1 -1
  55. package/core/QueryInfo.d.ts.map +1 -1
  56. package/core/QueryInfo.js +1 -1
  57. package/core/QueryInfo.js.map +1 -1
  58. package/core/QueryManager.d.ts +7 -7
  59. package/core/QueryManager.d.ts.map +1 -1
  60. package/core/QueryManager.js +19 -11
  61. package/core/QueryManager.js.map +1 -1
  62. package/core/core.cjs +113 -62
  63. package/core/core.cjs.map +1 -1
  64. package/core/core.cjs.native.js +113 -62
  65. package/core/index.js +2 -2
  66. package/core/index.js.map +1 -1
  67. package/core/types.d.ts +18 -17
  68. package/core/types.d.ts.map +1 -1
  69. package/core/types.js +1 -0
  70. package/core/types.js.map +1 -1
  71. package/core/watchQueryOptions.d.ts +11 -11
  72. package/core/watchQueryOptions.d.ts.map +1 -1
  73. package/core/watchQueryOptions.js.map +1 -1
  74. package/errors/index.d.ts +2 -2
  75. package/errors/index.d.ts.map +1 -1
  76. package/invariantErrorCodes.js +33 -33
  77. package/link/batch/batch.cjs +5 -3
  78. package/link/batch/batch.cjs.map +1 -1
  79. package/link/batch/batch.cjs.native.js +5 -3
  80. package/link/batch/batching.d.ts +2 -2
  81. package/link/batch/batching.d.ts.map +1 -1
  82. package/link/batch/batching.js +5 -3
  83. package/link/batch/batching.js.map +1 -1
  84. package/link/context/index.d.ts +2 -1
  85. package/link/context/index.d.ts.map +1 -1
  86. package/link/context/index.js.map +1 -1
  87. package/link/core/ApolloLink.js +2 -2
  88. package/link/core/core.cjs +2 -2
  89. package/link/core/core.cjs.map +1 -1
  90. package/link/core/core.cjs.native.js +2 -2
  91. package/link/core/types.d.ts +13 -12
  92. package/link/core/types.d.ts.map +1 -1
  93. package/link/core/types.js.map +1 -1
  94. package/link/http/checkFetcher.js +2 -2
  95. package/link/http/createHttpLink.d.ts +0 -1
  96. package/link/http/createHttpLink.d.ts.map +1 -1
  97. package/link/http/createHttpLink.js +2 -1
  98. package/link/http/createHttpLink.js.map +1 -1
  99. package/link/http/http.cjs +13 -38
  100. package/link/http/http.cjs.map +1 -1
  101. package/link/http/http.cjs.native.js +13 -38
  102. package/link/http/iterators/async.js.map +1 -1
  103. package/link/http/iterators/nodeStream.js.map +1 -1
  104. package/link/http/iterators/promise.js.map +1 -1
  105. package/link/http/iterators/reader.js.map +1 -1
  106. package/link/http/parseAndCheckHttpResponse.d.ts +2 -2
  107. package/link/http/parseAndCheckHttpResponse.d.ts.map +1 -1
  108. package/link/http/parseAndCheckHttpResponse.js.map +1 -1
  109. package/link/http/responseIterator.js +1 -1
  110. package/link/http/responseIterator.js.map +1 -1
  111. package/link/http/selectHttpOptionsAndBody.d.ts +2 -2
  112. package/link/http/selectHttpOptionsAndBody.d.ts.map +1 -1
  113. package/link/http/selectHttpOptionsAndBody.js +3 -1
  114. package/link/http/selectHttpOptionsAndBody.js.map +1 -1
  115. package/link/http/serializeFetchParameter.d.ts +1 -1
  116. package/link/http/serializeFetchParameter.d.ts.map +1 -1
  117. package/link/http/serializeFetchParameter.js +2 -2
  118. package/link/persisted-queries/index.d.ts +2 -2
  119. package/link/persisted-queries/index.d.ts.map +1 -1
  120. package/link/persisted-queries/index.js +3 -3
  121. package/link/persisted-queries/persisted-queries.cjs +3 -3
  122. package/link/persisted-queries/persisted-queries.cjs.map +1 -1
  123. package/link/persisted-queries/persisted-queries.cjs.native.js +3 -3
  124. package/link/utils/throwServerError.d.ts +1 -1
  125. package/link/utils/throwServerError.d.ts.map +1 -1
  126. package/link/utils/toPromise.js +1 -1
  127. package/link/utils/utils.cjs +2 -2
  128. package/link/utils/utils.cjs.map +1 -1
  129. package/link/utils/utils.cjs.native.js +2 -2
  130. package/link/utils/validateOperation.js +2 -2
  131. package/package.json +15 -15
  132. package/react/cache/SuspenseCache.d.ts +1 -1
  133. package/react/cache/SuspenseCache.d.ts.map +1 -1
  134. package/react/cache/SuspenseCache.js.map +1 -1
  135. package/react/components/Query.d.ts +2 -2
  136. package/react/components/Query.d.ts.map +1 -1
  137. package/react/components/Query.js.map +1 -1
  138. package/react/components/Subscription.d.ts +2 -2
  139. package/react/components/Subscription.d.ts.map +1 -1
  140. package/react/components/Subscription.js.map +1 -1
  141. package/react/components/types.d.ts +2 -2
  142. package/react/components/types.d.ts.map +1 -1
  143. package/react/components/types.js.map +1 -1
  144. package/react/context/ApolloConsumer.js +2 -2
  145. package/react/context/ApolloProvider.js +2 -2
  146. package/react/context/context.cjs +4 -4
  147. package/react/context/context.cjs.map +1 -1
  148. package/react/context/context.cjs.native.js +4 -4
  149. package/react/hoc/graphql.d.ts +2 -1
  150. package/react/hoc/graphql.d.ts.map +1 -1
  151. package/react/hoc/graphql.js.map +1 -1
  152. package/react/hoc/hoc-utils.d.ts +1 -1
  153. package/react/hoc/hoc-utils.d.ts.map +1 -1
  154. package/react/hoc/hoc-utils.js +2 -2
  155. package/react/hoc/hoc.cjs +4 -4
  156. package/react/hoc/hoc.cjs.map +1 -1
  157. package/react/hoc/hoc.cjs.native.js +4 -4
  158. package/react/hoc/mutation-hoc.d.ts +2 -2
  159. package/react/hoc/mutation-hoc.d.ts.map +1 -1
  160. package/react/hoc/mutation-hoc.js.map +1 -1
  161. package/react/hoc/query-hoc.d.ts +1 -1
  162. package/react/hoc/query-hoc.d.ts.map +1 -1
  163. package/react/hoc/query-hoc.js.map +1 -1
  164. package/react/hoc/subscription-hoc.d.ts +1 -1
  165. package/react/hoc/subscription-hoc.d.ts.map +1 -1
  166. package/react/hoc/subscription-hoc.js.map +1 -1
  167. package/react/hoc/types.d.ts +6 -6
  168. package/react/hoc/types.d.ts.map +1 -1
  169. package/react/hoc/types.js.map +1 -1
  170. package/react/hoc/withApollo.js +2 -2
  171. package/react/hooks/hooks.cjs +26 -32
  172. package/react/hooks/hooks.cjs.map +1 -1
  173. package/react/hooks/hooks.cjs.native.js +26 -32
  174. package/react/hooks/internal/useIsomorphicLayoutEffect.js +1 -1
  175. package/react/hooks/internal/useIsomorphicLayoutEffect.js.map +1 -1
  176. package/react/hooks/useApolloClient.js +2 -2
  177. package/react/hooks/useFragment.d.ts +4 -2
  178. package/react/hooks/useFragment.d.ts.map +1 -1
  179. package/react/hooks/useFragment.js +9 -8
  180. package/react/hooks/useFragment.js.map +1 -1
  181. package/react/hooks/useLazyQuery.d.ts +2 -2
  182. package/react/hooks/useLazyQuery.d.ts.map +1 -1
  183. package/react/hooks/useLazyQuery.js +3 -4
  184. package/react/hooks/useLazyQuery.js.map +1 -1
  185. package/react/hooks/useMutation.d.ts +2 -2
  186. package/react/hooks/useMutation.d.ts.map +1 -1
  187. package/react/hooks/useMutation.js.map +1 -1
  188. package/react/hooks/useQuery.d.ts +4 -4
  189. package/react/hooks/useQuery.d.ts.map +1 -1
  190. package/react/hooks/useQuery.js +1 -1
  191. package/react/hooks/useQuery.js.map +1 -1
  192. package/react/hooks/useSubscription.d.ts +2 -3
  193. package/react/hooks/useSubscription.d.ts.map +1 -1
  194. package/react/hooks/useSubscription.js +1 -2
  195. package/react/hooks/useSubscription.js.map +1 -1
  196. package/react/hooks/useSuspenseCache.js +2 -2
  197. package/react/hooks/useSuspenseQuery.d.ts +1 -1
  198. package/react/hooks/useSuspenseQuery.d.ts.map +1 -1
  199. package/react/hooks/useSuspenseQuery.js +2 -2
  200. package/react/hooks/useSuspenseQuery.js.map +1 -1
  201. package/react/hooks/useSyncExternalStore.d.ts +1 -1
  202. package/react/hooks/useSyncExternalStore.d.ts.map +1 -1
  203. package/react/hooks/useSyncExternalStore.js +1 -1
  204. package/react/hooks/useSyncExternalStore.js.map +1 -1
  205. package/react/parser/index.js +6 -6
  206. package/react/parser/parser.cjs +10 -10
  207. package/react/parser/parser.cjs.map +1 -1
  208. package/react/parser/parser.cjs.native.js +10 -10
  209. package/react/ssr/RenderPromises.d.ts +4 -4
  210. package/react/ssr/RenderPromises.d.ts.map +1 -1
  211. package/react/ssr/RenderPromises.js.map +1 -1
  212. package/react/ssr/getDataFromTree.d.ts +1 -1
  213. package/react/ssr/getDataFromTree.d.ts.map +1 -1
  214. package/react/types/types.d.ts +24 -23
  215. package/react/types/types.d.ts.map +1 -1
  216. package/react/types/types.js.map +1 -1
  217. package/testing/core/core.cjs +13 -3
  218. package/testing/core/core.cjs.map +1 -1
  219. package/testing/core/core.cjs.native.js +13 -3
  220. package/testing/core/index.d.ts +1 -1
  221. package/testing/core/index.d.ts.map +1 -1
  222. package/testing/core/index.js.map +1 -1
  223. package/testing/core/mocking/mockFetch.js.map +1 -1
  224. package/testing/core/mocking/mockLink.d.ts +8 -4
  225. package/testing/core/mocking/mockLink.d.ts.map +1 -1
  226. package/testing/core/mocking/mockLink.js +14 -4
  227. package/testing/core/mocking/mockLink.js.map +1 -1
  228. package/testing/core/mocking/mockQueryManager.d.ts +1 -1
  229. package/testing/core/mocking/mockQueryManager.d.ts.map +1 -1
  230. package/testing/core/mocking/mockQueryManager.js +3 -3
  231. package/testing/core/mocking/mockQueryManager.js.map +1 -1
  232. package/testing/core/mocking/mockWatchQuery.d.ts +1 -1
  233. package/testing/core/mocking/mockWatchQuery.d.ts.map +1 -1
  234. package/testing/core/mocking/mockWatchQuery.js +4 -5
  235. package/testing/core/mocking/mockWatchQuery.js.map +1 -1
  236. package/testing/core/observableToPromise.d.ts +2 -2
  237. package/testing/core/observableToPromise.d.ts.map +1 -1
  238. package/testing/core/observableToPromise.js.map +1 -1
  239. package/testing/react/MockedProvider.d.ts +1 -0
  240. package/testing/react/MockedProvider.d.ts.map +1 -1
  241. package/testing/react/MockedProvider.js +2 -2
  242. package/testing/react/MockedProvider.js.map +1 -1
  243. package/testing/testing.cjs +2 -2
  244. package/testing/testing.cjs.map +1 -1
  245. package/testing/testing.cjs.native.js +2 -2
  246. package/utilities/common/cloneDeep.js.map +1 -1
  247. package/utilities/common/errorHandling.d.ts +2 -2
  248. package/utilities/common/errorHandling.d.ts.map +1 -1
  249. package/utilities/common/errorHandling.js.map +1 -1
  250. package/utilities/common/incrementalResult.d.ts +4 -4
  251. package/utilities/common/incrementalResult.d.ts.map +1 -1
  252. package/utilities/common/incrementalResult.js.map +1 -1
  253. package/utilities/common/maybeDeepFreeze.d.ts +0 -1
  254. package/utilities/common/maybeDeepFreeze.d.ts.map +1 -1
  255. package/utilities/common/maybeDeepFreeze.js +1 -1
  256. package/utilities/common/maybeDeepFreeze.js.map +1 -1
  257. package/utilities/common/mergeDeep.d.ts +2 -2
  258. package/utilities/common/mergeDeep.d.ts.map +1 -1
  259. package/utilities/common/mergeOptions.d.ts +3 -3
  260. package/utilities/common/mergeOptions.d.ts.map +1 -1
  261. package/utilities/common/mergeOptions.js.map +1 -1
  262. package/utilities/globals/DEV.d.ts +1 -1
  263. package/utilities/globals/DEV.d.ts.map +1 -1
  264. package/utilities/globals/DEV.js +1 -17
  265. package/utilities/globals/DEV.js.map +1 -1
  266. package/utilities/globals/global.d.ts +5 -2
  267. package/utilities/globals/global.d.ts.map +1 -1
  268. package/utilities/globals/global.js.map +1 -1
  269. package/utilities/globals/globals.cjs +5 -22
  270. package/utilities/globals/globals.cjs.map +1 -1
  271. package/utilities/globals/globals.cjs.native.js +5 -22
  272. package/utilities/globals/index.d.ts +1 -1
  273. package/utilities/globals/index.d.ts.map +1 -1
  274. package/utilities/globals/index.js +1 -4
  275. package/utilities/globals/index.js.map +1 -1
  276. package/utilities/graphql/directives.d.ts +2 -2
  277. package/utilities/graphql/directives.d.ts.map +1 -1
  278. package/utilities/graphql/directives.js +1 -1
  279. package/utilities/graphql/directives.js.map +1 -1
  280. package/utilities/graphql/fragments.d.ts +1 -1
  281. package/utilities/graphql/fragments.d.ts.map +1 -1
  282. package/utilities/graphql/fragments.js +1 -1
  283. package/utilities/graphql/getFromAST.js +1 -1
  284. package/utilities/graphql/storeUtils.d.ts +3 -3
  285. package/utilities/graphql/storeUtils.d.ts.map +1 -1
  286. package/utilities/graphql/storeUtils.js +1 -1
  287. package/utilities/graphql/storeUtils.js.map +1 -1
  288. package/utilities/graphql/transform.d.ts +9 -9
  289. package/utilities/graphql/transform.d.ts.map +1 -1
  290. package/utilities/graphql/transform.js +1 -1
  291. package/utilities/graphql/transform.js.map +1 -1
  292. package/utilities/index.d.ts +2 -0
  293. package/utilities/index.d.ts.map +1 -1
  294. package/utilities/index.js +2 -0
  295. package/utilities/index.js.map +1 -1
  296. package/utilities/observables/Concast.d.ts +5 -5
  297. package/utilities/observables/Concast.d.ts.map +1 -1
  298. package/utilities/observables/asyncMap.js.map +1 -1
  299. package/utilities/policies/pagination.d.ts +7 -7
  300. package/utilities/policies/pagination.d.ts.map +1 -1
  301. package/utilities/policies/pagination.js.map +1 -1
  302. package/utilities/types/IsStrictlyAny.d.ts +3 -3
  303. package/utilities/types/IsStrictlyAny.d.ts.map +1 -1
  304. package/utilities/utilities.cjs +75 -19
  305. package/utilities/utilities.cjs.map +1 -1
  306. package/utilities/utilities.cjs.native.js +75 -19
  307. package/version.js +1 -1
package/cache/cache.cjs CHANGED
@@ -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) {
@@ -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
  }
@@ -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);
@@ -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));
@@ -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;
@@ -1425,7 +1425,7 @@ var Policies = (function () {
1425
1425
  if (supertypeSet.has(supertype)) {
1426
1426
  if (!typenameSupertypeSet.has(supertype)) {
1427
1427
  if (checkingFuzzySubtypes) {
1428
- __DEV__ && globals.invariant.warn("Inferring subtype ".concat(typename, " of supertype ").concat(supertype));
1428
+ globals.__DEV__ && globals.invariant.warn("Inferring subtype ".concat(typename, " of supertype ").concat(supertype));
1429
1429
  }
1430
1430
  typenameSupertypeSet.add(supertype);
1431
1431
  }
@@ -1578,8 +1578,8 @@ function normalizeReadFieldOptions(readFieldArgs, objectOrReference, variables)
1578
1578
  options.from = objectOrReference;
1579
1579
  }
1580
1580
  }
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))));
1581
+ if (globals.__DEV__ && options.from === void 0) {
1582
+ globals.__DEV__ && globals.invariant.warn("Undefined 'from' passed to readField with arguments ".concat(utilities.stringifyForDisplay(Array.from(readFieldArgs))));
1583
1583
  }
1584
1584
  if (void 0 === options.variables) {
1585
1585
  options.variables = variables;
@@ -1589,7 +1589,7 @@ function normalizeReadFieldOptions(readFieldArgs, objectOrReference, variables)
1589
1589
  function makeMergeObjectsFunction(store) {
1590
1590
  return function mergeObjects(existing, incoming) {
1591
1591
  if (isArray(existing) || isArray(incoming)) {
1592
- throw __DEV__ ? new globals.InvariantError("Cannot automatically merge arrays") : new globals.InvariantError(4);
1592
+ throw globals.__DEV__ ? new globals.InvariantError("Cannot automatically merge arrays") : new globals.InvariantError(4);
1593
1593
  }
1594
1594
  if (utilities.isNonNullObject(existing) &&
1595
1595
  utilities.isNonNullObject(incoming)) {
@@ -1650,7 +1650,7 @@ var StoreWriter = (function () {
1650
1650
  context: context,
1651
1651
  });
1652
1652
  if (!utilities.isReference(ref)) {
1653
- throw __DEV__ ? new globals.InvariantError("Could not identify object ".concat(JSON.stringify(result))) : new globals.InvariantError(7);
1653
+ throw globals.__DEV__ ? new globals.InvariantError("Could not identify object ".concat(JSON.stringify(result))) : new globals.InvariantError(7);
1654
1654
  }
1655
1655
  context.incomingById.forEach(function (_a, dataId) {
1656
1656
  var storeObject = _a.storeObject, mergeTree = _a.mergeTree, fieldNodeSet = _a.fieldNodeSet;
@@ -1662,7 +1662,7 @@ var StoreWriter = (function () {
1662
1662
  }
1663
1663
  storeObject = applied;
1664
1664
  }
1665
- if (__DEV__ && !context.overwrite) {
1665
+ if (globals.__DEV__ && !context.overwrite) {
1666
1666
  var fieldsWithSelectionSets_1 = Object.create(null);
1667
1667
  fieldNodeSet.forEach(function (field) {
1668
1668
  if (field.selectionSet) {
@@ -1750,12 +1750,12 @@ var StoreWriter = (function () {
1750
1750
  _a[storeFieldName] = incomingValue,
1751
1751
  _a));
1752
1752
  }
1753
- else if (__DEV__ &&
1753
+ else if (globals.__DEV__ &&
1754
1754
  !context.clientOnly &&
1755
1755
  !context.deferred &&
1756
1756
  !utilities.addTypenameToDocument.added(field) &&
1757
1757
  !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));
1758
+ globals.__DEV__ && globals.invariant.error("Missing field '".concat(utilities.resultKeyNameFromField(field), "' while writing result ").concat(JSON.stringify(result, null, 2)).substring(0, 1000));
1759
1759
  }
1760
1760
  });
1761
1761
  try {
@@ -1804,7 +1804,7 @@ var StoreWriter = (function () {
1804
1804
  StoreWriter.prototype.processFieldValue = function (value, field, context, mergeTree) {
1805
1805
  var _this = this;
1806
1806
  if (!field.selectionSet || value === null) {
1807
- return __DEV__ ? utilities.cloneDeep(value) : value;
1807
+ return globals.__DEV__ ? utilities.cloneDeep(value) : value;
1808
1808
  }
1809
1809
  if (isArray(value)) {
1810
1810
  return value.map(function (item, i) {
@@ -1859,7 +1859,7 @@ var StoreWriter = (function () {
1859
1859
  else {
1860
1860
  var fragment = utilities.getFragmentFromSelection(selection, context.lookupFragment);
1861
1861
  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);
1862
+ throw globals.__DEV__ ? new globals.InvariantError("No fragment named ".concat(selection.name.value)) : new globals.InvariantError(8);
1863
1863
  }
1864
1864
  if (fragment &&
1865
1865
  policies.fragmentMatches(fragment, typename, result, context.variables)) {
@@ -1995,7 +1995,7 @@ function warnAboutDataLoss(existingRef, incomingObj, storeFieldName, store) {
1995
1995
  }
1996
1996
  });
1997
1997
  }
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
1998
+ 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
1999
  ? "either ensure all objects of type " +
2000
2000
  childTypenames.join(" and ") + " have an ID or a custom merge function, or "
2001
2001
  : "", "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 +2155,7 @@ var InMemoryCache = (function (_super) {
2155
2155
  return this.policies.identify(object)[0];
2156
2156
  }
2157
2157
  catch (e) {
2158
- __DEV__ && globals.invariant.warn(e);
2158
+ globals.__DEV__ && globals.invariant.warn(e);
2159
2159
  }
2160
2160
  };
2161
2161
  InMemoryCache.prototype.evict = function (options) {