@apollo/client 3.8.0-beta.6 → 3.8.0-beta.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 (634) hide show
  1. package/apollo-client.cjs +201 -189
  2. package/apollo-client.cjs.map +1 -1
  3. package/apollo-client.min.cjs +1 -1
  4. package/cache/cache.cjs +12 -12
  5. package/cache/cache.cjs.map +1 -1
  6. package/cache/cache.cjs.native.js +12 -12
  7. package/cache/core/cache.d.ts +3 -3
  8. package/cache/core/cache.d.ts.map +1 -1
  9. package/cache/core/cache.js +1 -1
  10. package/cache/core/cache.js.map +1 -1
  11. package/cache/core/types/Cache.d.ts +3 -3
  12. package/cache/core/types/Cache.d.ts.map +1 -1
  13. package/cache/core/types/Cache.js.map +1 -1
  14. package/cache/core/types/DataProxy.d.ts +2 -2
  15. package/cache/core/types/DataProxy.d.ts.map +1 -1
  16. package/cache/core/types/DataProxy.js.map +1 -1
  17. package/cache/core/types/common.d.ts +2 -2
  18. package/cache/core/types/common.d.ts.map +1 -1
  19. package/cache/core/types/common.js.map +1 -1
  20. package/cache/index.d.ts +14 -14
  21. package/cache/index.d.ts.map +1 -1
  22. package/cache/index.js +13 -13
  23. package/cache/index.js.map +1 -1
  24. package/cache/inmemory/entityStore.d.ts +5 -5
  25. package/cache/inmemory/entityStore.d.ts.map +1 -1
  26. package/cache/inmemory/entityStore.js +3 -3
  27. package/cache/inmemory/entityStore.js.map +1 -1
  28. package/cache/inmemory/fragmentRegistry.js.map +1 -1
  29. package/cache/inmemory/helpers.d.ts +5 -5
  30. package/cache/inmemory/helpers.d.ts.map +1 -1
  31. package/cache/inmemory/helpers.js +1 -1
  32. package/cache/inmemory/helpers.js.map +1 -1
  33. package/cache/inmemory/inMemoryCache.d.ts +8 -8
  34. package/cache/inmemory/inMemoryCache.d.ts.map +1 -1
  35. package/cache/inmemory/inMemoryCache.js +13 -13
  36. package/cache/inmemory/inMemoryCache.js.map +1 -1
  37. package/cache/inmemory/key-extractor.d.ts +1 -1
  38. package/cache/inmemory/key-extractor.d.ts.map +1 -1
  39. package/cache/inmemory/key-extractor.js.map +1 -1
  40. package/cache/inmemory/object-canon.d.ts.map +1 -1
  41. package/cache/inmemory/object-canon.js +2 -3
  42. package/cache/inmemory/object-canon.js.map +1 -1
  43. package/cache/inmemory/policies.d.ts +6 -6
  44. package/cache/inmemory/policies.d.ts.map +1 -1
  45. package/cache/inmemory/policies.js +9 -9
  46. package/cache/inmemory/policies.js.map +1 -1
  47. package/cache/inmemory/reactiveVars.d.ts +1 -1
  48. package/cache/inmemory/reactiveVars.d.ts.map +1 -1
  49. package/cache/inmemory/reactiveVars.js.map +1 -1
  50. package/cache/inmemory/readFromStore.d.ts +6 -6
  51. package/cache/inmemory/readFromStore.d.ts.map +1 -1
  52. package/cache/inmemory/readFromStore.js +7 -7
  53. package/cache/inmemory/readFromStore.js.map +1 -1
  54. package/cache/inmemory/types.d.ts +6 -6
  55. package/cache/inmemory/types.d.ts.map +1 -1
  56. package/cache/inmemory/types.js.map +1 -1
  57. package/cache/inmemory/writeToStore.d.ts +6 -6
  58. package/cache/inmemory/writeToStore.d.ts.map +1 -1
  59. package/cache/inmemory/writeToStore.js +10 -10
  60. package/cache/inmemory/writeToStore.js.map +1 -1
  61. package/config/jest/setup.d.ts +1 -1
  62. package/config/jest/setup.d.ts.map +1 -1
  63. package/config/jest/setup.js +2 -2
  64. package/config/jest/setup.js.map +1 -1
  65. package/core/ApolloClient.d.ts +10 -10
  66. package/core/ApolloClient.d.ts.map +1 -1
  67. package/core/ApolloClient.js +10 -10
  68. package/core/ApolloClient.js.map +1 -1
  69. package/core/LocalState.d.ts +5 -5
  70. package/core/LocalState.d.ts.map +1 -1
  71. package/core/LocalState.js +3 -3
  72. package/core/LocalState.js.map +1 -1
  73. package/core/ObservableQuery.d.ts +10 -10
  74. package/core/ObservableQuery.d.ts.map +1 -1
  75. package/core/ObservableQuery.js +11 -11
  76. package/core/ObservableQuery.js.map +1 -1
  77. package/core/QueryInfo.d.ts +9 -9
  78. package/core/QueryInfo.d.ts.map +1 -1
  79. package/core/QueryInfo.js +4 -4
  80. package/core/QueryInfo.js.map +1 -1
  81. package/core/QueryManager.d.ts +10 -10
  82. package/core/QueryManager.d.ts.map +1 -1
  83. package/core/QueryManager.js +17 -17
  84. package/core/QueryManager.js.map +1 -1
  85. package/core/core.cjs +25 -24
  86. package/core/core.cjs.map +1 -1
  87. package/core/core.cjs.native.js +25 -24
  88. package/core/equalByQuery.d.ts +2 -2
  89. package/core/equalByQuery.d.ts.map +1 -1
  90. package/core/equalByQuery.js +9 -8
  91. package/core/equalByQuery.js.map +1 -1
  92. package/core/index.d.ts +13 -13
  93. package/core/index.d.ts.map +1 -1
  94. package/core/index.js +12 -13
  95. package/core/index.js.map +1 -1
  96. package/core/types.d.ts +10 -10
  97. package/core/types.d.ts.map +1 -1
  98. package/core/types.js.map +1 -1
  99. package/core/watchQueryOptions.d.ts +4 -4
  100. package/core/watchQueryOptions.d.ts.map +1 -1
  101. package/core/watchQueryOptions.js.map +1 -1
  102. package/dev/dev.cjs +2 -3
  103. package/dev/dev.cjs.map +1 -1
  104. package/dev/dev.cjs.native.js +2 -3
  105. package/dev/index.d.ts +3 -3
  106. package/dev/index.d.ts.map +1 -1
  107. package/dev/index.js +3 -3
  108. package/dev/index.js.map +1 -1
  109. package/dev/loadDevMessages.js +2 -2
  110. package/dev/loadDevMessages.js.map +1 -1
  111. package/dev/loadErrorMessageHandler.d.ts +1 -1
  112. package/dev/loadErrorMessageHandler.d.ts.map +1 -1
  113. package/dev/loadErrorMessageHandler.js +2 -2
  114. package/dev/loadErrorMessageHandler.js.map +1 -1
  115. package/dev/loadErrorMessages.js +2 -2
  116. package/dev/loadErrorMessages.js.map +1 -1
  117. package/errors/errors.cjs.map +1 -1
  118. package/errors/index.d.ts +4 -4
  119. package/errors/index.d.ts.map +1 -1
  120. package/errors/index.js +2 -2
  121. package/errors/index.js.map +1 -1
  122. package/index.d.ts +2 -2
  123. package/index.d.ts.map +1 -1
  124. package/index.js +2 -2
  125. package/index.js.map +1 -1
  126. package/link/batch/batch.cjs.map +1 -1
  127. package/link/batch/batchLink.d.ts +5 -5
  128. package/link/batch/batchLink.d.ts.map +1 -1
  129. package/link/batch/batchLink.js +3 -3
  130. package/link/batch/batchLink.js.map +1 -1
  131. package/link/batch/batching.d.ts +2 -2
  132. package/link/batch/batching.d.ts.map +1 -1
  133. package/link/batch/batching.js +1 -1
  134. package/link/batch/batching.js.map +1 -1
  135. package/link/batch/index.d.ts +1 -1
  136. package/link/batch/index.d.ts.map +1 -1
  137. package/link/batch/index.js +1 -1
  138. package/link/batch/index.js.map +1 -1
  139. package/link/batch-http/batch-http.cjs.map +1 -1
  140. package/link/batch-http/batchHttpLink.d.ts +5 -5
  141. package/link/batch-http/batchHttpLink.d.ts.map +1 -1
  142. package/link/batch-http/batchHttpLink.js +5 -5
  143. package/link/batch-http/batchHttpLink.js.map +1 -1
  144. package/link/batch-http/index.d.ts +1 -1
  145. package/link/batch-http/index.d.ts.map +1 -1
  146. package/link/batch-http/index.js +1 -1
  147. package/link/batch-http/index.js.map +1 -1
  148. package/link/context/context.cjs.map +1 -1
  149. package/link/context/index.d.ts +3 -3
  150. package/link/context/index.d.ts.map +1 -1
  151. package/link/context/index.js +2 -2
  152. package/link/context/index.js.map +1 -1
  153. package/link/core/ApolloLink.d.ts +3 -3
  154. package/link/core/ApolloLink.d.ts.map +1 -1
  155. package/link/core/ApolloLink.js +4 -4
  156. package/link/core/ApolloLink.js.map +1 -1
  157. package/link/core/concat.d.ts +1 -1
  158. package/link/core/concat.d.ts.map +1 -1
  159. package/link/core/concat.js +1 -1
  160. package/link/core/concat.js.map +1 -1
  161. package/link/core/core.cjs +1 -1
  162. package/link/core/core.cjs.map +1 -1
  163. package/link/core/core.cjs.native.js +1 -1
  164. package/link/core/empty.d.ts +1 -1
  165. package/link/core/empty.d.ts.map +1 -1
  166. package/link/core/empty.js +1 -1
  167. package/link/core/empty.js.map +1 -1
  168. package/link/core/execute.d.ts +1 -1
  169. package/link/core/execute.d.ts.map +1 -1
  170. package/link/core/execute.js +1 -1
  171. package/link/core/execute.js.map +1 -1
  172. package/link/core/from.d.ts +1 -1
  173. package/link/core/from.d.ts.map +1 -1
  174. package/link/core/from.js +1 -1
  175. package/link/core/from.js.map +1 -1
  176. package/link/core/index.d.ts +8 -8
  177. package/link/core/index.d.ts.map +1 -1
  178. package/link/core/index.js +8 -8
  179. package/link/core/index.js.map +1 -1
  180. package/link/core/split.d.ts +1 -1
  181. package/link/core/split.d.ts.map +1 -1
  182. package/link/core/split.js +1 -1
  183. package/link/core/split.js.map +1 -1
  184. package/link/core/types.d.ts +2 -2
  185. package/link/core/types.d.ts.map +1 -1
  186. package/link/core/types.js.map +1 -1
  187. package/link/error/error.cjs.map +1 -1
  188. package/link/error/index.d.ts +4 -4
  189. package/link/error/index.d.ts.map +1 -1
  190. package/link/error/index.js +2 -2
  191. package/link/error/index.js.map +1 -1
  192. package/link/http/HttpLink.d.ts +3 -3
  193. package/link/http/HttpLink.d.ts.map +1 -1
  194. package/link/http/HttpLink.js +2 -2
  195. package/link/http/HttpLink.js.map +1 -1
  196. package/link/http/checkFetcher.js +1 -1
  197. package/link/http/checkFetcher.js.map +1 -1
  198. package/link/http/createHttpLink.d.ts +2 -2
  199. package/link/http/createHttpLink.d.ts.map +1 -1
  200. package/link/http/createHttpLink.js +14 -14
  201. package/link/http/createHttpLink.js.map +1 -1
  202. package/link/http/http.cjs +2 -2
  203. package/link/http/http.cjs.map +1 -1
  204. package/link/http/http.cjs.native.js +2 -2
  205. package/link/http/index.d.ts +10 -10
  206. package/link/http/index.d.ts.map +1 -1
  207. package/link/http/index.js +10 -10
  208. package/link/http/index.js.map +1 -1
  209. package/link/http/iterators/nodeStream.js.map +1 -1
  210. package/link/http/iterators/promise.js.map +1 -1
  211. package/link/http/iterators/reader.js.map +1 -1
  212. package/link/http/parseAndCheckHttpResponse.d.ts +2 -2
  213. package/link/http/parseAndCheckHttpResponse.d.ts.map +1 -1
  214. package/link/http/parseAndCheckHttpResponse.js +2 -2
  215. package/link/http/parseAndCheckHttpResponse.js.map +1 -1
  216. package/link/http/responseIterator.js.map +1 -1
  217. package/link/http/rewriteURIForGET.d.ts +1 -1
  218. package/link/http/rewriteURIForGET.d.ts.map +1 -1
  219. package/link/http/rewriteURIForGET.js +1 -1
  220. package/link/http/rewriteURIForGET.js.map +1 -1
  221. package/link/http/selectHttpOptionsAndBody.d.ts +2 -2
  222. package/link/http/selectHttpOptionsAndBody.d.ts.map +1 -1
  223. package/link/http/selectHttpOptionsAndBody.js +1 -1
  224. package/link/http/selectHttpOptionsAndBody.js.map +1 -1
  225. package/link/http/selectURI.d.ts +1 -1
  226. package/link/http/selectURI.d.ts.map +1 -1
  227. package/link/http/selectURI.js.map +1 -1
  228. package/link/http/serializeFetchParameter.d.ts +1 -1
  229. package/link/http/serializeFetchParameter.d.ts.map +1 -1
  230. package/link/http/serializeFetchParameter.js +1 -1
  231. package/link/http/serializeFetchParameter.js.map +1 -1
  232. package/link/persisted-queries/index.d.ts +3 -3
  233. package/link/persisted-queries/index.d.ts.map +1 -1
  234. package/link/persisted-queries/index.js +4 -4
  235. package/link/persisted-queries/index.js.map +1 -1
  236. package/link/persisted-queries/persisted-queries.cjs.map +1 -1
  237. package/link/remove-typename/index.d.ts +1 -1
  238. package/link/remove-typename/index.d.ts.map +1 -1
  239. package/link/remove-typename/index.js +1 -1
  240. package/link/remove-typename/index.js.map +1 -1
  241. package/link/remove-typename/remove-typename.cjs.map +1 -1
  242. package/link/remove-typename/removeTypenameFromVariables.d.ts +1 -1
  243. package/link/remove-typename/removeTypenameFromVariables.d.ts.map +1 -1
  244. package/link/remove-typename/removeTypenameFromVariables.js +2 -2
  245. package/link/remove-typename/removeTypenameFromVariables.js.map +1 -1
  246. package/link/retry/delayFunction.d.ts +1 -1
  247. package/link/retry/delayFunction.d.ts.map +1 -1
  248. package/link/retry/delayFunction.js.map +1 -1
  249. package/link/retry/index.d.ts +1 -1
  250. package/link/retry/index.d.ts.map +1 -1
  251. package/link/retry/index.js +1 -1
  252. package/link/retry/index.js.map +1 -1
  253. package/link/retry/retry.cjs.map +1 -1
  254. package/link/retry/retryFunction.d.ts +1 -1
  255. package/link/retry/retryFunction.d.ts.map +1 -1
  256. package/link/retry/retryFunction.js.map +1 -1
  257. package/link/retry/retryLink.d.ts +5 -5
  258. package/link/retry/retryLink.d.ts.map +1 -1
  259. package/link/retry/retryLink.js +4 -4
  260. package/link/retry/retryLink.js.map +1 -1
  261. package/link/schema/index.d.ts +3 -3
  262. package/link/schema/index.d.ts.map +1 -1
  263. package/link/schema/index.js +2 -2
  264. package/link/schema/index.js.map +1 -1
  265. package/link/schema/schema.cjs.map +1 -1
  266. package/link/subscriptions/index.d.ts +3 -3
  267. package/link/subscriptions/index.d.ts.map +1 -1
  268. package/link/subscriptions/index.js +1 -1
  269. package/link/subscriptions/index.js.map +1 -1
  270. package/link/subscriptions/subscriptions.cjs.map +1 -1
  271. package/link/utils/createOperation.d.ts +1 -1
  272. package/link/utils/createOperation.d.ts.map +1 -1
  273. package/link/utils/createOperation.js.map +1 -1
  274. package/link/utils/fromError.d.ts +1 -1
  275. package/link/utils/fromError.d.ts.map +1 -1
  276. package/link/utils/fromError.js +1 -1
  277. package/link/utils/fromError.js.map +1 -1
  278. package/link/utils/fromPromise.d.ts +1 -1
  279. package/link/utils/fromPromise.d.ts.map +1 -1
  280. package/link/utils/fromPromise.js +1 -1
  281. package/link/utils/fromPromise.js.map +1 -1
  282. package/link/utils/index.d.ts +9 -9
  283. package/link/utils/index.d.ts.map +1 -1
  284. package/link/utils/index.js +9 -9
  285. package/link/utils/index.js.map +1 -1
  286. package/link/utils/toPromise.d.ts +1 -1
  287. package/link/utils/toPromise.d.ts.map +1 -1
  288. package/link/utils/toPromise.js +2 -2
  289. package/link/utils/toPromise.js.map +1 -1
  290. package/link/utils/transformOperation.d.ts +1 -1
  291. package/link/utils/transformOperation.d.ts.map +1 -1
  292. package/link/utils/transformOperation.js +1 -1
  293. package/link/utils/transformOperation.js.map +1 -1
  294. package/link/utils/utils.cjs +1 -1
  295. package/link/utils/utils.cjs.map +1 -1
  296. package/link/utils/utils.cjs.native.js +1 -1
  297. package/link/utils/validateOperation.d.ts +1 -1
  298. package/link/utils/validateOperation.d.ts.map +1 -1
  299. package/link/utils/validateOperation.js +1 -1
  300. package/link/utils/validateOperation.js.map +1 -1
  301. package/link/ws/index.d.ts +3 -3
  302. package/link/ws/index.d.ts.map +1 -1
  303. package/link/ws/index.js +1 -1
  304. package/link/ws/index.js.map +1 -1
  305. package/link/ws/ws.cjs.map +1 -1
  306. package/package.json +14 -10
  307. package/react/cache/QueryReference.d.ts +7 -6
  308. package/react/cache/QueryReference.d.ts.map +1 -1
  309. package/react/cache/QueryReference.js +84 -53
  310. package/react/cache/QueryReference.js.map +1 -1
  311. package/react/cache/SuspenseCache.d.ts +3 -3
  312. package/react/cache/SuspenseCache.d.ts.map +1 -1
  313. package/react/cache/SuspenseCache.js +2 -2
  314. package/react/cache/SuspenseCache.js.map +1 -1
  315. package/react/cache/index.d.ts +1 -1
  316. package/react/cache/index.d.ts.map +1 -1
  317. package/react/cache/index.js +1 -1
  318. package/react/cache/index.js.map +1 -1
  319. package/react/components/Mutation.d.ts +3 -3
  320. package/react/components/Mutation.d.ts.map +1 -1
  321. package/react/components/Mutation.js +1 -1
  322. package/react/components/Mutation.js.map +1 -1
  323. package/react/components/Query.d.ts +2 -2
  324. package/react/components/Query.d.ts.map +1 -1
  325. package/react/components/Query.js +1 -1
  326. package/react/components/Query.js.map +1 -1
  327. package/react/components/Subscription.d.ts +2 -2
  328. package/react/components/Subscription.d.ts.map +1 -1
  329. package/react/components/Subscription.js +1 -1
  330. package/react/components/Subscription.js.map +1 -1
  331. package/react/components/components.cjs.map +1 -1
  332. package/react/components/index.d.ts +4 -4
  333. package/react/components/index.d.ts.map +1 -1
  334. package/react/components/index.js +4 -4
  335. package/react/components/index.js.map +1 -1
  336. package/react/components/types.d.ts +2 -2
  337. package/react/components/types.d.ts.map +1 -1
  338. package/react/components/types.js.map +1 -1
  339. package/react/context/ApolloConsumer.d.ts +1 -1
  340. package/react/context/ApolloConsumer.d.ts.map +1 -1
  341. package/react/context/ApolloConsumer.js +2 -2
  342. package/react/context/ApolloConsumer.js.map +1 -1
  343. package/react/context/ApolloContext.d.ts +4 -5
  344. package/react/context/ApolloContext.d.ts.map +1 -1
  345. package/react/context/ApolloContext.js +11 -4
  346. package/react/context/ApolloContext.js.map +1 -1
  347. package/react/context/ApolloProvider.d.ts +2 -2
  348. package/react/context/ApolloProvider.d.ts.map +1 -1
  349. package/react/context/ApolloProvider.js +2 -2
  350. package/react/context/ApolloProvider.js.map +1 -1
  351. package/react/context/context.cjs +9 -2
  352. package/react/context/context.cjs.map +1 -1
  353. package/react/context/context.cjs.native.js +9 -2
  354. package/react/context/index.d.ts +4 -4
  355. package/react/context/index.d.ts.map +1 -1
  356. package/react/context/index.js +4 -4
  357. package/react/context/index.js.map +1 -1
  358. package/react/hoc/graphql.d.ts +2 -2
  359. package/react/hoc/graphql.d.ts.map +1 -1
  360. package/react/hoc/graphql.js +4 -4
  361. package/react/hoc/graphql.js.map +1 -1
  362. package/react/hoc/hoc-utils.d.ts +2 -2
  363. package/react/hoc/hoc-utils.d.ts.map +1 -1
  364. package/react/hoc/hoc-utils.js +1 -1
  365. package/react/hoc/hoc-utils.js.map +1 -1
  366. package/react/hoc/hoc.cjs.map +1 -1
  367. package/react/hoc/index.d.ts +7 -7
  368. package/react/hoc/index.d.ts.map +1 -1
  369. package/react/hoc/index.js +7 -7
  370. package/react/hoc/index.js.map +1 -1
  371. package/react/hoc/mutation-hoc.d.ts +3 -3
  372. package/react/hoc/mutation-hoc.d.ts.map +1 -1
  373. package/react/hoc/mutation-hoc.js +3 -3
  374. package/react/hoc/mutation-hoc.js.map +1 -1
  375. package/react/hoc/query-hoc.d.ts +1 -1
  376. package/react/hoc/query-hoc.d.ts.map +1 -1
  377. package/react/hoc/query-hoc.js +3 -3
  378. package/react/hoc/query-hoc.js.map +1 -1
  379. package/react/hoc/subscription-hoc.d.ts +1 -1
  380. package/react/hoc/subscription-hoc.d.ts.map +1 -1
  381. package/react/hoc/subscription-hoc.js +3 -3
  382. package/react/hoc/subscription-hoc.js.map +1 -1
  383. package/react/hoc/types.d.ts +4 -4
  384. package/react/hoc/types.d.ts.map +1 -1
  385. package/react/hoc/types.js.map +1 -1
  386. package/react/hoc/withApollo.d.ts +1 -1
  387. package/react/hoc/withApollo.d.ts.map +1 -1
  388. package/react/hoc/withApollo.js +2 -2
  389. package/react/hoc/withApollo.js.map +1 -1
  390. package/react/hooks/hooks.cjs +146 -129
  391. package/react/hooks/hooks.cjs.map +1 -1
  392. package/react/hooks/hooks.cjs.native.js +146 -129
  393. package/react/hooks/index.d.ts +11 -11
  394. package/react/hooks/index.d.ts.map +1 -1
  395. package/react/hooks/index.js +11 -11
  396. package/react/hooks/index.js.map +1 -1
  397. package/react/hooks/internal/__use.js +2 -2
  398. package/react/hooks/internal/__use.js.map +1 -1
  399. package/react/hooks/internal/index.d.ts +3 -4
  400. package/react/hooks/internal/index.d.ts.map +1 -1
  401. package/react/hooks/internal/index.js +3 -4
  402. package/react/hooks/internal/index.js.map +1 -1
  403. package/react/hooks/internal/useDeepMemo.js +2 -2
  404. package/react/hooks/internal/useDeepMemo.js.map +1 -1
  405. package/react/hooks/internal/useIsomorphicLayoutEffect.d.ts +2 -2
  406. package/react/hooks/internal/useIsomorphicLayoutEffect.d.ts.map +1 -1
  407. package/react/hooks/internal/useIsomorphicLayoutEffect.js +4 -4
  408. package/react/hooks/internal/useIsomorphicLayoutEffect.js.map +1 -1
  409. package/react/hooks/useApolloClient.d.ts +1 -1
  410. package/react/hooks/useApolloClient.d.ts.map +1 -1
  411. package/react/hooks/useApolloClient.js +4 -4
  412. package/react/hooks/useApolloClient.js.map +1 -1
  413. package/react/hooks/useBackgroundQuery.d.ts +5 -5
  414. package/react/hooks/useBackgroundQuery.d.ts.map +1 -1
  415. package/react/hooks/useBackgroundQuery.js +13 -13
  416. package/react/hooks/useBackgroundQuery.js.map +1 -1
  417. package/react/hooks/useFragment.d.ts +4 -4
  418. package/react/hooks/useFragment.d.ts.map +1 -1
  419. package/react/hooks/useFragment.js +2 -2
  420. package/react/hooks/useFragment.js.map +1 -1
  421. package/react/hooks/useLazyQuery.d.ts +2 -2
  422. package/react/hooks/useLazyQuery.d.ts.map +1 -1
  423. package/react/hooks/useLazyQuery.js +9 -9
  424. package/react/hooks/useLazyQuery.js.map +1 -1
  425. package/react/hooks/useMutation.d.ts +2 -2
  426. package/react/hooks/useMutation.d.ts.map +1 -1
  427. package/react/hooks/useMutation.js +10 -10
  428. package/react/hooks/useMutation.js.map +1 -1
  429. package/react/hooks/useQuery.d.ts +4 -4
  430. package/react/hooks/useQuery.d.ts.map +1 -1
  431. package/react/hooks/useQuery.js +17 -17
  432. package/react/hooks/useQuery.js.map +1 -1
  433. package/react/hooks/useReactiveVar.d.ts +1 -1
  434. package/react/hooks/useReactiveVar.d.ts.map +1 -1
  435. package/react/hooks/useReactiveVar.js +3 -3
  436. package/react/hooks/useReactiveVar.js.map +1 -1
  437. package/react/hooks/useReadQuery.d.ts +3 -3
  438. package/react/hooks/useReadQuery.d.ts.map +1 -1
  439. package/react/hooks/useReadQuery.js +5 -5
  440. package/react/hooks/useReadQuery.js.map +1 -1
  441. package/react/hooks/useSubscription.d.ts +2 -2
  442. package/react/hooks/useSubscription.d.ts.map +1 -1
  443. package/react/hooks/useSubscription.js +14 -14
  444. package/react/hooks/useSubscription.js.map +1 -1
  445. package/react/hooks/useSuspenseCache.d.ts +1 -1
  446. package/react/hooks/useSuspenseCache.d.ts.map +1 -1
  447. package/react/hooks/useSuspenseCache.js +4 -4
  448. package/react/hooks/useSuspenseCache.js.map +1 -1
  449. package/react/hooks/useSuspenseQuery.d.ts +4 -6
  450. package/react/hooks/useSuspenseQuery.d.ts.map +1 -1
  451. package/react/hooks/useSuspenseQuery.js +26 -29
  452. package/react/hooks/useSuspenseQuery.js.map +1 -1
  453. package/react/hooks/useSyncExternalStore.js +4 -4
  454. package/react/hooks/useSyncExternalStore.js.map +1 -1
  455. package/react/index.d.ts +6 -6
  456. package/react/index.d.ts.map +1 -1
  457. package/react/index.js +6 -6
  458. package/react/index.js.map +1 -1
  459. package/react/parser/index.js +1 -1
  460. package/react/parser/index.js.map +1 -1
  461. package/react/parser/parser.cjs.map +1 -1
  462. package/react/react.cjs +82 -51
  463. package/react/react.cjs.map +1 -1
  464. package/react/react.cjs.native.js +82 -51
  465. package/react/ssr/RenderPromises.d.ts +2 -2
  466. package/react/ssr/RenderPromises.d.ts.map +1 -1
  467. package/react/ssr/RenderPromises.js.map +1 -1
  468. package/react/ssr/getDataFromTree.js +2 -2
  469. package/react/ssr/getDataFromTree.js.map +1 -1
  470. package/react/ssr/index.d.ts +3 -3
  471. package/react/ssr/index.d.ts.map +1 -1
  472. package/react/ssr/index.js +3 -3
  473. package/react/ssr/index.js.map +1 -1
  474. package/react/ssr/renderToStringWithData.js +1 -1
  475. package/react/ssr/renderToStringWithData.js.map +1 -1
  476. package/react/ssr/ssr.cjs.map +1 -1
  477. package/react/types/types.d.ts +7 -7
  478. package/react/types/types.d.ts.map +1 -1
  479. package/react/types/types.js.map +1 -1
  480. package/testing/core/core.cjs.map +1 -1
  481. package/testing/core/index.d.ts +7 -7
  482. package/testing/core/index.d.ts.map +1 -1
  483. package/testing/core/index.js +7 -7
  484. package/testing/core/index.js.map +1 -1
  485. package/testing/core/mocking/mockClient.d.ts +2 -2
  486. package/testing/core/mocking/mockClient.d.ts.map +1 -1
  487. package/testing/core/mocking/mockClient.js +3 -3
  488. package/testing/core/mocking/mockClient.js.map +1 -1
  489. package/testing/core/mocking/mockLink.d.ts +3 -3
  490. package/testing/core/mocking/mockLink.d.ts.map +1 -1
  491. package/testing/core/mocking/mockLink.js +3 -3
  492. package/testing/core/mocking/mockLink.js.map +1 -1
  493. package/testing/core/mocking/mockQueryManager.d.ts +3 -3
  494. package/testing/core/mocking/mockQueryManager.d.ts.map +1 -1
  495. package/testing/core/mocking/mockQueryManager.js +3 -3
  496. package/testing/core/mocking/mockQueryManager.js.map +1 -1
  497. package/testing/core/mocking/mockSubscriptionLink.d.ts +3 -3
  498. package/testing/core/mocking/mockSubscriptionLink.d.ts.map +1 -1
  499. package/testing/core/mocking/mockSubscriptionLink.js +2 -2
  500. package/testing/core/mocking/mockSubscriptionLink.js.map +1 -1
  501. package/testing/core/mocking/mockWatchQuery.d.ts +2 -2
  502. package/testing/core/mocking/mockWatchQuery.d.ts.map +1 -1
  503. package/testing/core/mocking/mockWatchQuery.js +1 -1
  504. package/testing/core/mocking/mockWatchQuery.js.map +1 -1
  505. package/testing/core/observableToPromise.d.ts +2 -2
  506. package/testing/core/observableToPromise.d.ts.map +1 -1
  507. package/testing/core/observableToPromise.js.map +1 -1
  508. package/testing/core/subscribeAndCount.d.ts +1 -1
  509. package/testing/core/subscribeAndCount.d.ts.map +1 -1
  510. package/testing/core/subscribeAndCount.js +1 -1
  511. package/testing/core/subscribeAndCount.js.map +1 -1
  512. package/testing/index.d.ts +3 -3
  513. package/testing/index.d.ts.map +1 -1
  514. package/testing/index.js +3 -3
  515. package/testing/index.js.map +1 -1
  516. package/testing/matchers/index.js +2 -2
  517. package/testing/matchers/index.js.map +1 -1
  518. package/testing/matchers/toHaveSuspenseCacheEntryUsing.d.ts +1 -1
  519. package/testing/matchers/toHaveSuspenseCacheEntryUsing.d.ts.map +1 -1
  520. package/testing/matchers/toHaveSuspenseCacheEntryUsing.js +2 -2
  521. package/testing/matchers/toHaveSuspenseCacheEntryUsing.js.map +1 -1
  522. package/testing/matchers/toMatchDocument.d.ts +1 -1
  523. package/testing/matchers/toMatchDocument.d.ts.map +1 -1
  524. package/testing/matchers/toMatchDocument.js +1 -1
  525. package/testing/matchers/toMatchDocument.js.map +1 -1
  526. package/testing/react/MockedProvider.d.ts +7 -7
  527. package/testing/react/MockedProvider.d.ts.map +1 -1
  528. package/testing/react/MockedProvider.js +5 -5
  529. package/testing/react/MockedProvider.js.map +1 -1
  530. package/testing/testing.cjs.map +1 -1
  531. package/utilities/common/canUse.js.map +1 -1
  532. package/utilities/common/compact.d.ts +1 -1
  533. package/utilities/common/compact.d.ts.map +1 -1
  534. package/utilities/common/compact.js.map +1 -1
  535. package/utilities/common/errorHandling.d.ts +1 -1
  536. package/utilities/common/errorHandling.d.ts.map +1 -1
  537. package/utilities/common/errorHandling.js.map +1 -1
  538. package/utilities/common/incrementalResult.d.ts +1 -1
  539. package/utilities/common/incrementalResult.d.ts.map +1 -1
  540. package/utilities/common/incrementalResult.js.map +1 -1
  541. package/utilities/common/maybeDeepFreeze.d.ts.map +1 -1
  542. package/utilities/common/maybeDeepFreeze.js +3 -4
  543. package/utilities/common/maybeDeepFreeze.js.map +1 -1
  544. package/utilities/common/mergeDeep.d.ts +1 -1
  545. package/utilities/common/mergeDeep.d.ts.map +1 -1
  546. package/utilities/common/mergeDeep.js.map +1 -1
  547. package/utilities/common/mergeOptions.d.ts +1 -1
  548. package/utilities/common/mergeOptions.d.ts.map +1 -1
  549. package/utilities/common/mergeOptions.js.map +1 -1
  550. package/utilities/common/omitDeep.d.ts +1 -1
  551. package/utilities/common/omitDeep.d.ts.map +1 -1
  552. package/utilities/common/omitDeep.js +1 -1
  553. package/utilities/common/omitDeep.js.map +1 -1
  554. package/utilities/common/responseIterator.js.map +1 -1
  555. package/utilities/common/stringifyForDisplay.js.map +1 -1
  556. package/utilities/common/stripTypename.d.ts +1 -1
  557. package/utilities/common/stripTypename.d.ts.map +1 -1
  558. package/utilities/common/stripTypename.js +1 -1
  559. package/utilities/common/stripTypename.js.map +1 -1
  560. package/utilities/globals/global.d.ts.map +1 -1
  561. package/utilities/globals/global.js.map +1 -1
  562. package/utilities/globals/globals.cjs +4 -16
  563. package/utilities/globals/globals.cjs.map +1 -1
  564. package/utilities/globals/globals.cjs.native.js +4 -16
  565. package/utilities/globals/index.d.ts +5 -6
  566. package/utilities/globals/index.d.ts.map +1 -1
  567. package/utilities/globals/index.js +2 -5
  568. package/utilities/globals/index.js.map +1 -1
  569. package/utilities/globals/invariantWrappers.d.ts +1 -1
  570. package/utilities/globals/invariantWrappers.d.ts.map +1 -1
  571. package/utilities/globals/invariantWrappers.js +3 -3
  572. package/utilities/globals/invariantWrappers.js.map +1 -1
  573. package/utilities/graphql/DocumentTransform.js +3 -3
  574. package/utilities/graphql/DocumentTransform.js.map +1 -1
  575. package/utilities/graphql/directives.js +1 -1
  576. package/utilities/graphql/directives.js.map +1 -1
  577. package/utilities/graphql/fragments.js +1 -1
  578. package/utilities/graphql/fragments.js.map +1 -1
  579. package/utilities/graphql/getFromAST.js +2 -2
  580. package/utilities/graphql/getFromAST.js.map +1 -1
  581. package/utilities/graphql/operations.d.ts +1 -1
  582. package/utilities/graphql/operations.d.ts.map +1 -1
  583. package/utilities/graphql/operations.js +1 -1
  584. package/utilities/graphql/operations.js.map +1 -1
  585. package/utilities/graphql/print.js +1 -1
  586. package/utilities/graphql/print.js.map +1 -1
  587. package/utilities/graphql/storeUtils.d.ts +1 -1
  588. package/utilities/graphql/storeUtils.d.ts.map +1 -1
  589. package/utilities/graphql/storeUtils.js +3 -3
  590. package/utilities/graphql/storeUtils.js.map +1 -1
  591. package/utilities/graphql/transform.js +7 -7
  592. package/utilities/graphql/transform.js.map +1 -1
  593. package/utilities/index.d.ts +34 -34
  594. package/utilities/index.d.ts.map +1 -1
  595. package/utilities/index.js +32 -32
  596. package/utilities/index.js.map +1 -1
  597. package/utilities/observables/Concast.d.ts +2 -2
  598. package/utilities/observables/Concast.d.ts.map +1 -1
  599. package/utilities/observables/Concast.js.map +1 -1
  600. package/utilities/observables/asyncMap.d.ts +1 -1
  601. package/utilities/observables/asyncMap.d.ts.map +1 -1
  602. package/utilities/observables/asyncMap.js.map +1 -1
  603. package/utilities/observables/iteration.d.ts +1 -1
  604. package/utilities/observables/iteration.d.ts.map +1 -1
  605. package/utilities/observables/iteration.js.map +1 -1
  606. package/utilities/observables/subclassing.d.ts +1 -1
  607. package/utilities/observables/subclassing.d.ts.map +1 -1
  608. package/utilities/observables/subclassing.js.map +1 -1
  609. package/utilities/policies/pagination.d.ts +1 -1
  610. package/utilities/policies/pagination.d.ts.map +1 -1
  611. package/utilities/policies/pagination.js +1 -1
  612. package/utilities/policies/pagination.js.map +1 -1
  613. package/utilities/types/DeepOmit.d.ts +1 -1
  614. package/utilities/types/DeepOmit.d.ts.map +1 -1
  615. package/utilities/types/DeepOmit.js.map +1 -1
  616. package/utilities/types/DeepPartial.d.ts +1 -1
  617. package/utilities/types/DeepPartial.d.ts.map +1 -1
  618. package/utilities/types/DeepPartial.js.map +1 -1
  619. package/utilities/utilities.cjs +4 -4
  620. package/utilities/utilities.cjs.map +1 -1
  621. package/utilities/utilities.cjs.native.js +4 -4
  622. package/version.js +1 -1
  623. package/react/hooks/internal/useStrictModeSafeCleanupEffect.d.ts +0 -2
  624. package/react/hooks/internal/useStrictModeSafeCleanupEffect.d.ts.map +0 -1
  625. package/react/hooks/internal/useStrictModeSafeCleanupEffect.js +0 -11
  626. package/react/hooks/internal/useStrictModeSafeCleanupEffect.js.map +0 -1
  627. package/utilities/globals/DEV.d.ts +0 -3
  628. package/utilities/globals/DEV.d.ts.map +0 -1
  629. package/utilities/globals/DEV.js +0 -4
  630. package/utilities/globals/DEV.js.map +0 -1
  631. package/utilities/globals/fix-graphql.d.ts +0 -2
  632. package/utilities/globals/fix-graphql.d.ts.map +0 -1
  633. package/utilities/globals/fix-graphql.js +0 -6
  634. package/utilities/globals/fix-graphql.js.map +0 -1
package/apollo-client.cjs CHANGED
@@ -3,10 +3,9 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var tslib = require('tslib');
6
- var process$1 = require('ts-invariant/process');
7
- var graphql = require('graphql');
8
- var equal = require('@wry/equality');
9
6
  var invariant$1 = require('ts-invariant');
7
+ var equal = require('@wry/equality');
8
+ var graphql = require('graphql');
10
9
  var zenObservableTs = require('zen-observable-ts');
11
10
  require('symbol-observable');
12
11
  var optimism = require('optimism');
@@ -29,12 +28,11 @@ function _interopNamespace(e) {
29
28
  return Object.freeze(n);
30
29
  }
31
30
 
32
- var equal__default = /*#__PURE__*/_interopDefaultLegacy(equal);
33
31
  var invariant__default = /*#__PURE__*/_interopDefaultLegacy(invariant$1);
32
+ var equal__default = /*#__PURE__*/_interopDefaultLegacy(equal);
34
33
  var React__namespace = /*#__PURE__*/_interopNamespace(React);
35
- var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
36
34
 
37
- var version = '3.8.0-beta.6';
35
+ var version = '3.8.0-beta.7';
38
36
 
39
37
  function maybe(thunk) {
40
38
  try {
@@ -46,8 +44,7 @@ function maybe(thunk) {
46
44
  var global$1 = (maybe(function () { return globalThis; }) ||
47
45
  maybe(function () { return window; }) ||
48
46
  maybe(function () { return self; }) ||
49
- maybe(function () { return global; }) ||
50
- maybe(function () { return maybe.constructor("return this")(); }));
47
+ maybe(function () { return global; }) || maybe(function () { return maybe.constructor("return this")(); }));
51
48
 
52
49
  var prefixCounts = new Map();
53
50
  function makeUniqueId(prefix) {
@@ -111,17 +108,6 @@ function getErrorMsg(message, messageArgs) {
111
108
  }))));
112
109
  }
113
110
 
114
- var DEV = ("__DEV__" in global$1
115
- ? Boolean(global$1.__DEV__)
116
- : maybe(function () { return process.env.NODE_ENV; }) !== "production");
117
-
118
- function removeTemporaryGlobals() {
119
- return typeof graphql.Source === "function" ? process$1.remove() : process$1.remove();
120
- }
121
-
122
- var __DEV__ = DEV;
123
- removeTemporaryGlobals();
124
-
125
111
  function shouldInclude(_a, variables) {
126
112
  var directives = _a.directives;
127
113
  if (!directives || !directives.length) {
@@ -701,7 +687,7 @@ function removeDirectivesFromDocument(directives, doc) {
701
687
  return getInUseByFragmentName(ancestor.name.value);
702
688
  }
703
689
  }
704
- __DEV__ && invariant.error(81);
690
+ globalThis.__DEV__ !== false && invariant.error(81);
705
691
  return null;
706
692
  };
707
693
  var operationCount = 0;
@@ -1054,7 +1040,7 @@ function deepFreeze(value) {
1054
1040
  return value;
1055
1041
  }
1056
1042
  function shallowFreeze(obj) {
1057
- if (__DEV__ && !Object.isFrozen(obj)) {
1043
+ if (globalThis.__DEV__ !== false && !Object.isFrozen(obj)) {
1058
1044
  try {
1059
1045
  Object.freeze(obj);
1060
1046
  }
@@ -1067,7 +1053,7 @@ function shallowFreeze(obj) {
1067
1053
  return obj;
1068
1054
  }
1069
1055
  function maybeDeepFreeze(obj) {
1070
- if (__DEV__) {
1056
+ if (globalThis.__DEV__ !== false) {
1071
1057
  deepFreeze(obj);
1072
1058
  }
1073
1059
  return obj;
@@ -1379,7 +1365,7 @@ function toPromise(observable) {
1379
1365
  observable.subscribe({
1380
1366
  next: function (data) {
1381
1367
  if (completed) {
1382
- __DEV__ && invariant.warn(40);
1368
+ globalThis.__DEV__ !== false && invariant.warn(40);
1383
1369
  }
1384
1370
  else {
1385
1371
  completed = true;
@@ -1529,7 +1515,7 @@ var ApolloLink = (function () {
1529
1515
  ApolloLink.concat = function (first, second) {
1530
1516
  var firstLink = toLink(first);
1531
1517
  if (isTerminating(firstLink)) {
1532
- __DEV__ && invariant.warn(33, firstLink);
1518
+ globalThis.__DEV__ !== false && invariant.warn(33, firstLink);
1533
1519
  return firstLink;
1534
1520
  }
1535
1521
  var nextLink = toLink(second);
@@ -2083,7 +2069,7 @@ var backupFetch = maybe(function () { return fetch; });
2083
2069
  var createHttpLink = function (linkOptions) {
2084
2070
  if (linkOptions === void 0) { linkOptions = {}; }
2085
2071
  var _a = linkOptions.uri, uri = _a === void 0 ? '/graphql' : _a, preferredFetch = linkOptions.fetch, _b = linkOptions.print, print = _b === void 0 ? defaultPrinter : _b, includeExtensions = linkOptions.includeExtensions, preserveHeaderCase = linkOptions.preserveHeaderCase, useGETForQueries = linkOptions.useGETForQueries, _c = linkOptions.includeUnusedVariables, includeUnusedVariables = _c === void 0 ? false : _c, requestOptions = tslib.__rest(linkOptions, ["uri", "fetch", "print", "includeExtensions", "preserveHeaderCase", "useGETForQueries", "includeUnusedVariables"]);
2086
- if (__DEV__) {
2072
+ if (globalThis.__DEV__ !== false) {
2087
2073
  checkFetcher(preferredFetch || backupFetch);
2088
2074
  }
2089
2075
  var linkConfig = {
@@ -2146,7 +2132,7 @@ var createHttpLink = function (linkOptions) {
2146
2132
  options.headers = options.headers || {};
2147
2133
  var acceptHeader = "multipart/mixed;";
2148
2134
  if (isSubscription && hasDefer) {
2149
- __DEV__ && invariant.warn(36);
2135
+ globalThis.__DEV__ !== false && invariant.warn(36);
2150
2136
  }
2151
2137
  if (isSubscription) {
2152
2138
  acceptHeader += 'boundary=graphql;subscriptionSpec=1.0,application/json';
@@ -2898,7 +2884,7 @@ var ObjectCanon = (function () {
2898
2884
  var node = this.pool.lookupArray(array);
2899
2885
  if (!node.array) {
2900
2886
  this.known.add(node.array = array);
2901
- if (__DEV__) {
2887
+ if (globalThis.__DEV__ !== false) {
2902
2888
  Object.freeze(array);
2903
2889
  }
2904
2890
  }
@@ -2923,7 +2909,7 @@ var ObjectCanon = (function () {
2923
2909
  keys.sorted.forEach(function (key, i) {
2924
2910
  obj_1[key] = array_1[firstValueIndex_1 + i];
2925
2911
  });
2926
- if (__DEV__) {
2912
+ if (globalThis.__DEV__ !== false) {
2927
2913
  Object.freeze(obj_1);
2928
2914
  }
2929
2915
  }
@@ -3190,7 +3176,7 @@ var StoreReader = (function () {
3190
3176
  context: context,
3191
3177
  }), i);
3192
3178
  }
3193
- if (__DEV__) {
3179
+ if (globalThis.__DEV__ !== false) {
3194
3180
  assertSelectionSetForIdValue(context.store, field, item);
3195
3181
  }
3196
3182
  return item;
@@ -3635,7 +3621,7 @@ var Policies = (function () {
3635
3621
  if (supertypeSet.has(supertype)) {
3636
3622
  if (!typenameSupertypeSet.has(supertype)) {
3637
3623
  if (checkingFuzzySubtypes) {
3638
- __DEV__ && invariant.warn(4, typename, supertype);
3624
+ globalThis.__DEV__ !== false && invariant.warn(4, typename, supertype);
3639
3625
  }
3640
3626
  typenameSupertypeSet.add(supertype);
3641
3627
  }
@@ -3788,8 +3774,8 @@ function normalizeReadFieldOptions(readFieldArgs, objectOrReference, variables)
3788
3774
  options.from = objectOrReference;
3789
3775
  }
3790
3776
  }
3791
- if (__DEV__ && options.from === void 0) {
3792
- __DEV__ && invariant.warn(5, stringifyForDisplay(Array.from(readFieldArgs)));
3777
+ if (globalThis.__DEV__ !== false && options.from === void 0) {
3778
+ globalThis.__DEV__ !== false && invariant.warn(5, stringifyForDisplay(Array.from(readFieldArgs)));
3793
3779
  }
3794
3780
  if (void 0 === options.variables) {
3795
3781
  options.variables = variables;
@@ -3872,7 +3858,7 @@ var StoreWriter = (function () {
3872
3858
  }
3873
3859
  storeObject = applied;
3874
3860
  }
3875
- if (__DEV__ && !context.overwrite) {
3861
+ if (globalThis.__DEV__ !== false && !context.overwrite) {
3876
3862
  var fieldsWithSelectionSets_1 = Object.create(null);
3877
3863
  fieldNodeSet.forEach(function (field) {
3878
3864
  if (field.selectionSet) {
@@ -3960,12 +3946,12 @@ var StoreWriter = (function () {
3960
3946
  _a[storeFieldName] = incomingValue,
3961
3947
  _a));
3962
3948
  }
3963
- else if (__DEV__ &&
3949
+ else if (globalThis.__DEV__ !== false &&
3964
3950
  !context.clientOnly &&
3965
3951
  !context.deferred &&
3966
3952
  !addTypenameToDocument.added(field) &&
3967
3953
  !policies.getReadFunction(typename, field.name.value)) {
3968
- __DEV__ && invariant.error(10, resultKeyNameFromField(field), result);
3954
+ globalThis.__DEV__ !== false && invariant.error(10, resultKeyNameFromField(field), result);
3969
3955
  }
3970
3956
  });
3971
3957
  try {
@@ -4014,7 +4000,7 @@ var StoreWriter = (function () {
4014
4000
  StoreWriter.prototype.processFieldValue = function (value, field, context, mergeTree) {
4015
4001
  var _this = this;
4016
4002
  if (!field.selectionSet || value === null) {
4017
- return __DEV__ ? cloneDeep(value) : value;
4003
+ return globalThis.__DEV__ !== false ? cloneDeep(value) : value;
4018
4004
  }
4019
4005
  if (isArray(value)) {
4020
4006
  return value.map(function (item, i) {
@@ -4205,7 +4191,7 @@ function warnAboutDataLoss(existingRef, incomingObj, storeFieldName, store) {
4205
4191
  }
4206
4192
  });
4207
4193
  }
4208
- __DEV__ && invariant.warn(12, fieldName, parentType, childTypenames.length
4194
+ globalThis.__DEV__ !== false && invariant.warn(12, fieldName, parentType, childTypenames.length
4209
4195
  ? "either ensure all objects of type " + childTypenames.join(" and ") + " have an ID or a custom merge function, or "
4210
4196
  : "", typeDotName, existing, incoming);
4211
4197
  }
@@ -4365,7 +4351,7 @@ var InMemoryCache = (function (_super) {
4365
4351
  return this.policies.identify(object)[0];
4366
4352
  }
4367
4353
  catch (e) {
4368
- __DEV__ && invariant.warn(e);
4354
+ globalThis.__DEV__ !== false && invariant.warn(e);
4369
4355
  }
4370
4356
  };
4371
4357
  InMemoryCache.prototype.evict = function (options) {
@@ -4528,10 +4514,11 @@ function isNetworkRequestSettled(networkStatus) {
4528
4514
  function equalByQuery(query, _a, _b, variables) {
4529
4515
  var aData = _a.data, aRest = tslib.__rest(_a, ["data"]);
4530
4516
  var bData = _b.data, bRest = tslib.__rest(_b, ["data"]);
4531
- return equal__default(aRest, bRest) && equalBySelectionSet(getMainDefinition(query).selectionSet, aData, bData, {
4532
- fragmentMap: createFragmentMap(getFragmentDefinitions(query)),
4533
- variables: variables,
4534
- });
4517
+ return (equal__default(aRest, bRest) &&
4518
+ equalBySelectionSet(getMainDefinition(query).selectionSet, aData, bData, {
4519
+ fragmentMap: createFragmentMap(getFragmentDefinitions(query)),
4520
+ variables: variables,
4521
+ }));
4535
4522
  }
4536
4523
  function equalBySelectionSet(selectionSet, aResult, bResult, context) {
4537
4524
  if (aResult === bResult) {
@@ -4583,10 +4570,10 @@ function equalBySelectionSet(selectionSet, aResult, bResult, context) {
4583
4570
  });
4584
4571
  }
4585
4572
  function selectionHasNonreactiveDirective(selection) {
4586
- return !!selection.directives && selection.directives.some(directiveIsNonreactive);
4573
+ return (!!selection.directives && selection.directives.some(directiveIsNonreactive));
4587
4574
  }
4588
4575
  function directiveIsNonreactive(dir) {
4589
- return dir.name.value === "nonreactive";
4576
+ return dir.name.value === 'nonreactive';
4590
4577
  }
4591
4578
 
4592
4579
  var assign = Object.assign, hasOwnProperty$2 = Object.hasOwnProperty;
@@ -4701,7 +4688,7 @@ var ObservableQuery = (function (_super) {
4701
4688
  else {
4702
4689
  result.partial = true;
4703
4690
  }
4704
- if (__DEV__ &&
4691
+ if (globalThis.__DEV__ !== false &&
4705
4692
  !diff.complete &&
4706
4693
  !this.options.partialRefetch &&
4707
4694
  !result.loading &&
@@ -4761,11 +4748,11 @@ var ObservableQuery = (function (_super) {
4761
4748
  else {
4762
4749
  reobserveOptions.fetchPolicy = 'network-only';
4763
4750
  }
4764
- if (__DEV__ && variables && hasOwnProperty$2.call(variables, "variables")) {
4751
+ if (globalThis.__DEV__ !== false && variables && hasOwnProperty$2.call(variables, "variables")) {
4765
4752
  var queryDef = getQueryDefinition(this.query);
4766
4753
  var vars = queryDef.variableDefinitions;
4767
4754
  if (!vars || !vars.some(function (v) { return v.variable.name.value === "variables"; })) {
4768
- __DEV__ && invariant.warn(
4755
+ globalThis.__DEV__ !== false && invariant.warn(
4769
4756
  18,
4770
4757
  variables,
4771
4758
  ((_a = queryDef.name) === null || _a === void 0 ? void 0 : _a.value) || queryDef
@@ -4857,7 +4844,7 @@ var ObservableQuery = (function (_super) {
4857
4844
  options.onError(err);
4858
4845
  return;
4859
4846
  }
4860
- __DEV__ && invariant.error(19, err);
4847
+ globalThis.__DEV__ !== false && invariant.error(19, err);
4861
4848
  },
4862
4849
  });
4863
4850
  this.subscriptions.add(subscription);
@@ -5112,11 +5099,11 @@ function reobserveCacheFirst(obsQuery) {
5112
5099
  return obsQuery.reobserve();
5113
5100
  }
5114
5101
  function defaultSubscriptionObserverErrorCallback(error) {
5115
- __DEV__ && invariant.error(21, error.message, error.stack);
5102
+ globalThis.__DEV__ !== false && invariant.error(21, error.message, error.stack);
5116
5103
  }
5117
5104
  function logMissingFieldErrors(missing) {
5118
- if (__DEV__ && missing) {
5119
- __DEV__ && invariant.debug(22, missing);
5105
+ if (globalThis.__DEV__ !== false && missing) {
5106
+ globalThis.__DEV__ !== false && invariant.debug(22, missing);
5120
5107
  }
5121
5108
  }
5122
5109
  function skipCacheDataFor(fetchPolicy) {
@@ -6000,7 +5987,7 @@ var QueryManager = (function () {
6000
5987
  _this.markMutationResult(tslib.__assign(tslib.__assign({}, mutation), { result: { data: data } }), cache);
6001
5988
  }
6002
5989
  catch (error) {
6003
- __DEV__ && invariant.error(error);
5990
+ globalThis.__DEV__ !== false && invariant.error(error);
6004
5991
  }
6005
5992
  }, mutation.mutationId);
6006
5993
  };
@@ -6183,10 +6170,10 @@ var QueryManager = (function () {
6183
6170
  queries.set(queryId, oq);
6184
6171
  });
6185
6172
  }
6186
- if (__DEV__ && queryNamesAndDocs.size) {
6173
+ if (globalThis.__DEV__ !== false && queryNamesAndDocs.size) {
6187
6174
  queryNamesAndDocs.forEach(function (included, nameOrDoc) {
6188
6175
  if (!included) {
6189
- __DEV__ && invariant.warn(typeof nameOrDoc === "string" ? 31 : 32, nameOrDoc);
6176
+ globalThis.__DEV__ !== false && invariant.warn(typeof nameOrDoc === "string" ? 31 : 32, nameOrDoc);
6190
6177
  }
6191
6178
  });
6192
6179
  }
@@ -6502,7 +6489,7 @@ var QueryManager = (function () {
6502
6489
  var resultsFromCache = function (diff, networkStatus) {
6503
6490
  if (networkStatus === void 0) { networkStatus = queryInfo.networkStatus || exports.NetworkStatus.loading; }
6504
6491
  var data = diff.result;
6505
- if (__DEV__ &&
6492
+ if (globalThis.__DEV__ !== false &&
6506
6493
  !returnPartialData &&
6507
6494
  !equal.equal(data, {})) {
6508
6495
  logMissingFieldErrors(diff.missing);
@@ -6605,7 +6592,7 @@ var ApolloClient = (function () {
6605
6592
  }
6606
6593
  var uri = options.uri, credentials = options.credentials, headers = options.headers, cache = options.cache, documentTransform = options.documentTransform, _a = options.ssrMode, ssrMode = _a === void 0 ? false : _a, _b = options.ssrForceFetchDelay, ssrForceFetchDelay = _b === void 0 ? 0 : _b, _c = options.connectToDevTools, connectToDevTools = _c === void 0 ? typeof window === 'object' &&
6607
6594
  !window.__APOLLO_CLIENT__ &&
6608
- __DEV__ : _c, _d = options.queryDeduplication, queryDeduplication = _d === void 0 ? true : _d, defaultOptions = options.defaultOptions, _e = options.assumeImmutableResults, assumeImmutableResults = _e === void 0 ? cache.assumeImmutableResults : _e, resolvers = options.resolvers, typeDefs = options.typeDefs, fragmentMatcher = options.fragmentMatcher, clientAwarenessName = options.name, clientAwarenessVersion = options.version;
6595
+ globalThis.__DEV__ !== false : _c, _d = options.queryDeduplication, queryDeduplication = _d === void 0 ? true : _d, defaultOptions = options.defaultOptions, _e = options.assumeImmutableResults, assumeImmutableResults = _e === void 0 ? cache.assumeImmutableResults : _e, resolvers = options.resolvers, typeDefs = options.typeDefs, fragmentMatcher = options.fragmentMatcher, clientAwarenessName = options.name, clientAwarenessVersion = options.version;
6609
6596
  var link = options.link;
6610
6597
  if (!link) {
6611
6598
  link = uri
@@ -6629,7 +6616,7 @@ var ApolloClient = (function () {
6629
6616
  if (connectToDevTools && typeof window === 'object') {
6630
6617
  window.__APOLLO_CLIENT__ = this;
6631
6618
  }
6632
- if (!hasSuggestedDevtools && connectToDevTools && __DEV__) {
6619
+ if (!hasSuggestedDevtools && connectToDevTools && globalThis.__DEV__ !== false) {
6633
6620
  hasSuggestedDevtools = true;
6634
6621
  if (typeof window !== 'undefined' &&
6635
6622
  window.document &&
@@ -6648,7 +6635,7 @@ var ApolloClient = (function () {
6648
6635
  }
6649
6636
  }
6650
6637
  if (url) {
6651
- __DEV__ && invariant.log("Download the Apollo DevTools for a better development " +
6638
+ globalThis.__DEV__ !== false && invariant.log("Download the Apollo DevTools for a better development " +
6652
6639
  "experience: %s", url);
6653
6640
  }
6654
6641
  }
@@ -6801,7 +6788,7 @@ var ApolloClient = (function () {
6801
6788
  result.queries = queries;
6802
6789
  result.results = results;
6803
6790
  result.catch(function (error) {
6804
- __DEV__ && invariant.debug(15, error);
6791
+ globalThis.__DEV__ !== false && invariant.debug(15, error);
6805
6792
  });
6806
6793
  return result;
6807
6794
  };
@@ -6838,8 +6825,15 @@ var contextKey = canUseSymbol
6838
6825
  : '__APOLLO_CONTEXT__';
6839
6826
  function getApolloContext() {
6840
6827
  invariant('createContext' in React__namespace, 43);
6841
- var contextStorage = global$1[contextKey] || (global$1[contextKey] = Object.create(null));
6842
- return contextStorage[React__namespace.version] || (contextStorage[React__namespace.version] = Object.assign(React__namespace.createContext({}), { displayName: 'ApolloContext' }));
6828
+ var contextStorage = global$1[contextKey] || (global$1[contextKey] = new Map());
6829
+ var value = contextStorage.get(React__namespace.createContext);
6830
+ if (!value) {
6831
+ value = Object.assign(React__namespace.createContext({}), {
6832
+ displayName: 'ApolloContext',
6833
+ });
6834
+ contextStorage.set(React__namespace.createContext, value);
6835
+ }
6836
+ return value;
6843
6837
  }
6844
6838
  var resetApolloContext = getApolloContext;
6845
6839
 
@@ -6863,7 +6857,7 @@ var ApolloProvider = function (_a) {
6863
6857
  };
6864
6858
 
6865
6859
  function useApolloClient(override) {
6866
- var context = React.useContext(getApolloContext());
6860
+ var context = React__namespace.useContext(getApolloContext());
6867
6861
  var client = override || context.client;
6868
6862
  invariant(!!client, 47);
6869
6863
  return client;
@@ -6874,11 +6868,11 @@ var uSESKey = "useSyncExternalStore";
6874
6868
  var realHook$1 = React__namespace[uSESKey];
6875
6869
  var useSyncExternalStore = realHook$1 || (function (subscribe, getSnapshot, getServerSnapshot) {
6876
6870
  var value = getSnapshot();
6877
- if (__DEV__ &&
6871
+ if (globalThis.__DEV__ !== false &&
6878
6872
  !didWarnUncachedGetSnapshot &&
6879
6873
  value !== getSnapshot()) {
6880
6874
  didWarnUncachedGetSnapshot = true;
6881
- __DEV__ && invariant.error(57);
6875
+ globalThis.__DEV__ !== false && invariant.error(57);
6882
6876
  }
6883
6877
  var _a = React__namespace.useState({ inst: { value: value, getSnapshot: getSnapshot } }), inst = _a[0].inst, forceUpdate = _a[1];
6884
6878
  if (canUseLayoutEffect) {
@@ -7016,14 +7010,14 @@ function useQuery(query, options) {
7016
7010
  return useInternalState(useApolloClient(options.client), query).useQuery(options);
7017
7011
  }
7018
7012
  function useInternalState(client, query) {
7019
- var stateRef = React.useRef();
7013
+ var stateRef = React__namespace.useRef();
7020
7014
  if (!stateRef.current ||
7021
7015
  client !== stateRef.current.client ||
7022
7016
  query !== stateRef.current.query) {
7023
7017
  stateRef.current = new InternalState(client, query, stateRef.current);
7024
7018
  }
7025
7019
  var state = stateRef.current;
7026
- var _a = React.useState(0); _a[0]; var setTick = _a[1];
7020
+ var _a = React__namespace.useState(0); _a[0]; var setTick = _a[1];
7027
7021
  state.forceUpdate = function () {
7028
7022
  setTick(function (tick) { return tick + 1; });
7029
7023
  };
@@ -7054,7 +7048,7 @@ var InternalState = (function () {
7054
7048
  }
7055
7049
  }
7056
7050
  InternalState.prototype.forceUpdate = function () {
7057
- __DEV__ && invariant.warn(48);
7051
+ globalThis.__DEV__ !== false && invariant.warn(48);
7058
7052
  };
7059
7053
  InternalState.prototype.executeQuery = function (options) {
7060
7054
  var _this = this;
@@ -7084,10 +7078,10 @@ var InternalState = (function () {
7084
7078
  };
7085
7079
  InternalState.prototype.useQuery = function (options) {
7086
7080
  var _this = this;
7087
- this.renderPromises = React.useContext(getApolloContext()).renderPromises;
7081
+ this.renderPromises = React__namespace.useContext(getApolloContext()).renderPromises;
7088
7082
  this.useOptions(options);
7089
7083
  var obsQuery = this.useObservableQuery();
7090
- var result = useSyncExternalStore(React.useCallback(function () {
7084
+ var result = useSyncExternalStore(React__namespace.useCallback(function () {
7091
7085
  if (_this.renderPromises) {
7092
7086
  return function () { };
7093
7087
  }
@@ -7217,7 +7211,7 @@ var InternalState = (function () {
7217
7211
  && this.renderPromises.getSSRObservable(this.watchQueryOptions)
7218
7212
  || this.observable
7219
7213
  || this.client.watchQuery(this.getObsQueryOptions());
7220
- this.obsQueryFields = React.useMemo(function () { return ({
7214
+ this.obsQueryFields = React__namespace.useMemo(function () { return ({
7221
7215
  refetch: obsQuery.refetch.bind(obsQuery),
7222
7216
  reobserve: obsQuery.reobserve.bind(obsQuery),
7223
7217
  fetchMore: obsQuery.fetchMore.bind(obsQuery),
@@ -7259,7 +7253,7 @@ var InternalState = (function () {
7259
7253
  _this.onCompleted(result.data);
7260
7254
  }
7261
7255
  }).catch(function (error) {
7262
- __DEV__ && invariant.warn(error);
7256
+ globalThis.__DEV__ !== false && invariant.warn(error);
7263
7257
  });
7264
7258
  }
7265
7259
  };
@@ -7311,9 +7305,9 @@ var EAGER_METHODS = [
7311
7305
  ];
7312
7306
  function useLazyQuery(query, options) {
7313
7307
  var _a;
7314
- var execOptionsRef = React.useRef();
7315
- var optionsRef = React.useRef();
7316
- var queryRef = React.useRef();
7308
+ var execOptionsRef = React__namespace.useRef();
7309
+ var optionsRef = React__namespace.useRef();
7310
+ var queryRef = React__namespace.useRef();
7317
7311
  var merged = mergeOptions(options, execOptionsRef.current || {});
7318
7312
  var document = (_a = merged === null || merged === void 0 ? void 0 : merged.query) !== null && _a !== void 0 ? _a : query;
7319
7313
  optionsRef.current = merged;
@@ -7325,7 +7319,7 @@ function useLazyQuery(query, options) {
7325
7319
  var result = Object.assign(useQueryResult, {
7326
7320
  called: !!execOptionsRef.current,
7327
7321
  });
7328
- var eagerMethods = React.useMemo(function () {
7322
+ var eagerMethods = React__namespace.useMemo(function () {
7329
7323
  var eagerMethods = {};
7330
7324
  var _loop_1 = function (key) {
7331
7325
  var method = result[key];
@@ -7344,7 +7338,7 @@ function useLazyQuery(query, options) {
7344
7338
  return eagerMethods;
7345
7339
  }, []);
7346
7340
  Object.assign(result, eagerMethods);
7347
- var execute = React.useCallback(function (executeOptions) {
7341
+ var execute = React__namespace.useCallback(function (executeOptions) {
7348
7342
  execOptionsRef.current = executeOptions ? tslib.__assign(tslib.__assign({}, executeOptions), { fetchPolicy: executeOptions.fetchPolicy || initialFetchPolicy }) : {
7349
7343
  fetchPolicy: initialFetchPolicy,
7350
7344
  };
@@ -7361,12 +7355,12 @@ function useLazyQuery(query, options) {
7361
7355
  function useMutation(mutation, options) {
7362
7356
  var client = useApolloClient(options === null || options === void 0 ? void 0 : options.client);
7363
7357
  verifyDocumentType(mutation, exports.DocumentType.Mutation);
7364
- var _a = React.useState({
7358
+ var _a = React__namespace.useState({
7365
7359
  called: false,
7366
7360
  loading: false,
7367
7361
  client: client,
7368
7362
  }), result = _a[0], setResult = _a[1];
7369
- var ref = React.useRef({
7363
+ var ref = React__namespace.useRef({
7370
7364
  result: result,
7371
7365
  mutationId: 0,
7372
7366
  isMounted: true,
@@ -7377,7 +7371,7 @@ function useMutation(mutation, options) {
7377
7371
  {
7378
7372
  Object.assign(ref.current, { client: client, options: options, mutation: mutation });
7379
7373
  }
7380
- var execute = React.useCallback(function (executeOptions) {
7374
+ var execute = React__namespace.useCallback(function (executeOptions) {
7381
7375
  if (executeOptions === void 0) { executeOptions = {}; }
7382
7376
  var _a = ref.current, options = _a.options, mutation = _a.mutation;
7383
7377
  var baseOptions = tslib.__assign(tslib.__assign({}, options), { mutation: mutation });
@@ -7438,12 +7432,12 @@ function useMutation(mutation, options) {
7438
7432
  throw error;
7439
7433
  });
7440
7434
  }, []);
7441
- var reset = React.useCallback(function () {
7435
+ var reset = React__namespace.useCallback(function () {
7442
7436
  if (ref.current.isMounted) {
7443
7437
  setResult({ called: false, loading: false, client: client });
7444
7438
  }
7445
7439
  }, []);
7446
- React.useEffect(function () {
7440
+ React__namespace.useEffect(function () {
7447
7441
  ref.current.isMounted = true;
7448
7442
  return function () {
7449
7443
  ref.current.isMounted = false;
@@ -7453,10 +7447,10 @@ function useMutation(mutation, options) {
7453
7447
  }
7454
7448
 
7455
7449
  function useSubscription(subscription, options) {
7456
- var hasIssuedDeprecationWarningRef = React.useRef(false);
7450
+ var hasIssuedDeprecationWarningRef = React__namespace.useRef(false);
7457
7451
  var client = useApolloClient(options === null || options === void 0 ? void 0 : options.client);
7458
7452
  verifyDocumentType(subscription, exports.DocumentType.Subscription);
7459
- var _a = React.useState({
7453
+ var _a = React__namespace.useState({
7460
7454
  loading: !(options === null || options === void 0 ? void 0 : options.skip),
7461
7455
  error: void 0,
7462
7456
  data: void 0,
@@ -7465,13 +7459,13 @@ function useSubscription(subscription, options) {
7465
7459
  if (!hasIssuedDeprecationWarningRef.current) {
7466
7460
  hasIssuedDeprecationWarningRef.current = true;
7467
7461
  if (options === null || options === void 0 ? void 0 : options.onSubscriptionData) {
7468
- __DEV__ && invariant.warn(options.onData ? 50 : 51);
7462
+ globalThis.__DEV__ !== false && invariant.warn(options.onData ? 50 : 51);
7469
7463
  }
7470
7464
  if (options === null || options === void 0 ? void 0 : options.onSubscriptionComplete) {
7471
- __DEV__ && invariant.warn(options.onComplete ? 52 : 53);
7465
+ globalThis.__DEV__ !== false && invariant.warn(options.onComplete ? 52 : 53);
7472
7466
  }
7473
7467
  }
7474
- var _b = React.useState(function () {
7468
+ var _b = React__namespace.useState(function () {
7475
7469
  if (options === null || options === void 0 ? void 0 : options.skip) {
7476
7470
  return null;
7477
7471
  }
@@ -7482,14 +7476,14 @@ function useSubscription(subscription, options) {
7482
7476
  context: options === null || options === void 0 ? void 0 : options.context,
7483
7477
  });
7484
7478
  }), observable = _b[0], setObservable = _b[1];
7485
- var canResetObservableRef = React.useRef(false);
7486
- React.useEffect(function () {
7479
+ var canResetObservableRef = React__namespace.useRef(false);
7480
+ React__namespace.useEffect(function () {
7487
7481
  return function () {
7488
7482
  canResetObservableRef.current = true;
7489
7483
  };
7490
7484
  }, []);
7491
- var ref = React.useRef({ client: client, subscription: subscription, options: options });
7492
- React.useEffect(function () {
7485
+ var ref = React__namespace.useRef({ client: client, subscription: subscription, options: options });
7486
+ React__namespace.useEffect(function () {
7493
7487
  var _a, _b, _c, _d;
7494
7488
  var shouldResubscribe = options === null || options === void 0 ? void 0 : options.shouldResubscribe;
7495
7489
  if (typeof shouldResubscribe === 'function') {
@@ -7530,7 +7524,7 @@ function useSubscription(subscription, options) {
7530
7524
  }
7531
7525
  Object.assign(ref.current, { client: client, subscription: subscription, options: options });
7532
7526
  }, [client, subscription, options, canResetObservableRef.current]);
7533
- React.useEffect(function () {
7527
+ React__namespace.useEffect(function () {
7534
7528
  if (!observable) {
7535
7529
  return;
7536
7530
  }
@@ -7597,8 +7591,8 @@ function useSubscription(subscription, options) {
7597
7591
 
7598
7592
  function useReactiveVar(rv) {
7599
7593
  var value = rv();
7600
- var setValue = React.useState(value)[1];
7601
- React.useEffect(function () {
7594
+ var setValue = React__namespace.useState(value)[1];
7595
+ React__namespace.useEffect(function () {
7602
7596
  var probablySameValue = rv();
7603
7597
  if (value !== probablySameValue) {
7604
7598
  setValue(probablySameValue);
@@ -7614,7 +7608,7 @@ function useFragment(options) {
7614
7608
  var cache = useApolloClient().cache;
7615
7609
  var fragment = options.fragment, fragmentName = options.fragmentName, from = options.from, _a = options.optimistic, optimistic = _a === void 0 ? true : _a, rest = tslib.__rest(options, ["fragment", "fragmentName", "from", "optimistic"]);
7616
7610
  var diffOptions = tslib.__assign(tslib.__assign({}, rest), { returnPartialData: true, id: typeof from === "string" ? from : cache.identify(from), query: cache["getFragmentDoc"](fragment, fragmentName), optimistic: optimistic });
7617
- var resultRef = React.useRef();
7611
+ var resultRef = React__namespace.useRef();
7618
7612
  var latestDiff = cache.diff(diffOptions);
7619
7613
  var getSnapshot = function () {
7620
7614
  var latestDiffToResult = diffToResult(latestDiff);
@@ -7644,25 +7638,15 @@ function diffToResult(diff) {
7644
7638
  }
7645
7639
 
7646
7640
  function useDeepMemo(memoFn, deps) {
7647
- var ref = React.useRef();
7641
+ var ref = React__namespace.useRef();
7648
7642
  if (!ref.current || !equal.equal(ref.current.deps, deps)) {
7649
7643
  ref.current = { value: memoFn(), deps: deps };
7650
7644
  }
7651
7645
  return ref.current.value;
7652
7646
  }
7653
7647
 
7654
- function useStrictModeSafeCleanupEffect(cleanup) {
7655
- var timeout;
7656
- React.useEffect(function () {
7657
- clearTimeout(timeout);
7658
- return function () {
7659
- timeout = setTimeout(cleanup);
7660
- };
7661
- }, []);
7662
- }
7663
-
7664
7648
  var useKey = 'use';
7665
- var realHook = React__default[useKey];
7649
+ var realHook = React__namespace[useKey];
7666
7650
  var __use = realHook ||
7667
7651
  function __use(promise) {
7668
7652
  var statefulPromise = wrapPromiseWithState(promise);
@@ -7677,7 +7661,7 @@ var __use = realHook ||
7677
7661
  };
7678
7662
 
7679
7663
  function useSuspenseCache(override) {
7680
- var context = React.useContext(getApolloContext());
7664
+ var context = React__namespace.useContext(getApolloContext());
7681
7665
  var suspenseCache = override || context.suspenseCache;
7682
7666
  invariant(suspenseCache, 54);
7683
7667
  return suspenseCache;
@@ -7694,7 +7678,7 @@ function useSuspenseQuery(query, options) {
7694
7678
  var queryRef = suspenseCache.getQueryRef(cacheKey, function () {
7695
7679
  return client.watchQuery(watchQueryOptions);
7696
7680
  });
7697
- var _b = React.useState(function () { return new Map([[queryRef.key, queryRef.promise]]); }), promiseCache = _b[0], setPromiseCache = _b[1];
7681
+ var _b = React__namespace.useState(function () { return new Map([[queryRef.key, queryRef.promise]]); }), promiseCache = _b[0], setPromiseCache = _b[1];
7698
7682
  var promise = promiseCache.get(queryRef.key);
7699
7683
  if (queryRef.didChangeOptions(watchQueryOptions)) {
7700
7684
  promise = queryRef.applyOptions(watchQueryOptions);
@@ -7704,15 +7688,19 @@ function useSuspenseQuery(query, options) {
7704
7688
  promise = queryRef.promise;
7705
7689
  promiseCache.set(queryRef.key, promise);
7706
7690
  }
7707
- useTrackedQueryRefs(queryRef);
7708
- React.useEffect(function () {
7709
- return queryRef.listen(function (promise) {
7691
+ React__namespace.useEffect(function () {
7692
+ var dispose = queryRef.retain();
7693
+ var removeListener = queryRef.listen(function (promise) {
7710
7694
  setPromiseCache(function (promiseCache) {
7711
7695
  return new Map(promiseCache).set(queryRef.key, promise);
7712
7696
  });
7713
7697
  });
7698
+ return function () {
7699
+ removeListener();
7700
+ dispose();
7701
+ };
7714
7702
  }, [queryRef]);
7715
- var skipResult = React.useMemo(function () {
7703
+ var skipResult = React__namespace.useMemo(function () {
7716
7704
  var error = toApolloError(queryRef.result);
7717
7705
  return {
7718
7706
  loading: false,
@@ -7722,22 +7710,22 @@ function useSuspenseQuery(query, options) {
7722
7710
  };
7723
7711
  }, [queryRef.result]);
7724
7712
  var result = fetchPolicy === 'standby' ? skipResult : __use(promise);
7725
- var fetchMore = React.useCallback(function (options) {
7713
+ var fetchMore = React__namespace.useCallback(function (options) {
7726
7714
  var promise = queryRef.fetchMore(options);
7727
7715
  setPromiseCache(function (previousPromiseCache) {
7728
- return new Map(previousPromiseCache).set(queryRef.key, promise);
7716
+ return new Map(previousPromiseCache).set(queryRef.key, queryRef.promise);
7729
7717
  });
7730
7718
  return promise;
7731
7719
  }, [queryRef]);
7732
- var refetch = React.useCallback(function (variables) {
7720
+ var refetch = React__namespace.useCallback(function (variables) {
7733
7721
  var promise = queryRef.refetch(variables);
7734
7722
  setPromiseCache(function (previousPromiseCache) {
7735
- return new Map(previousPromiseCache).set(queryRef.key, promise);
7723
+ return new Map(previousPromiseCache).set(queryRef.key, queryRef.promise);
7736
7724
  });
7737
7725
  return promise;
7738
7726
  }, [queryRef]);
7739
- var subscribeToMore = React.useCallback(function (options) { return queryRef.observable.subscribeToMore(options); }, [queryRef]);
7740
- return React.useMemo(function () {
7727
+ var subscribeToMore = React__namespace.useCallback(function (options) { return queryRef.observable.subscribeToMore(options); }, [queryRef]);
7728
+ return React__namespace.useMemo(function () {
7741
7729
  return {
7742
7730
  client: client,
7743
7731
  data: result.data,
@@ -7767,7 +7755,7 @@ function validateFetchPolicy(fetchPolicy) {
7767
7755
  }
7768
7756
  function validatePartialDataReturn(fetchPolicy, returnPartialData) {
7769
7757
  if (fetchPolicy === 'no-cache' && returnPartialData) {
7770
- __DEV__ && invariant.warn(56);
7758
+ globalThis.__DEV__ !== false && invariant.warn(56);
7771
7759
  }
7772
7760
  }
7773
7761
  function toApolloError(result) {
@@ -7775,13 +7763,6 @@ function toApolloError(result) {
7775
7763
  ? new ApolloError({ graphQLErrors: result.errors })
7776
7764
  : result.error;
7777
7765
  }
7778
- function useTrackedQueryRefs(queryRef) {
7779
- var trackedQueryRefs = React.useRef(new Set());
7780
- trackedQueryRefs.current.add(queryRef);
7781
- useStrictModeSafeCleanupEffect(function () {
7782
- trackedQueryRefs.current.forEach(function (sub) { return sub.dispose(); });
7783
- });
7784
- }
7785
7766
  function useWatchQueryOptions(_a) {
7786
7767
  var client = _a.client, query = _a.query, options = _a.options;
7787
7768
  return useDeepMemo(function () {
@@ -7790,7 +7771,7 @@ function useWatchQueryOptions(_a) {
7790
7771
  ((_a = client.defaultOptions.watchQuery) === null || _a === void 0 ? void 0 : _a.fetchPolicy) ||
7791
7772
  'cache-first';
7792
7773
  var watchQueryOptions = tslib.__assign(tslib.__assign({}, options), { fetchPolicy: fetchPolicy, query: query, notifyOnNetworkStatusChange: false, nextFetchPolicy: void 0 });
7793
- if (__DEV__) {
7774
+ if (globalThis.__DEV__ !== false) {
7794
7775
  validateOptions(watchQueryOptions);
7795
7776
  }
7796
7777
  if (options.skip) {
@@ -7814,11 +7795,12 @@ var InternalQueryReference = (function () {
7814
7795
  var _this = this;
7815
7796
  var _a;
7816
7797
  this.listeners = new Set();
7817
- this.initialized = false;
7818
- this.refetching = false;
7798
+ this.status = 'loading';
7799
+ this.references = 0;
7819
7800
  this.listen = this.listen.bind(this);
7820
7801
  this.handleNext = this.handleNext.bind(this);
7821
7802
  this.handleError = this.handleError.bind(this);
7803
+ this.initiateFetch = this.initiateFetch.bind(this);
7822
7804
  this.dispose = this.dispose.bind(this);
7823
7805
  this.observable = observable;
7824
7806
  this.result = observable.getCurrentResult(false);
@@ -7828,21 +7810,25 @@ var InternalQueryReference = (function () {
7828
7810
  }
7829
7811
  if (isNetworkRequestSettled(this.result.networkStatus) ||
7830
7812
  (this.result.data &&
7831
- (!this.result.partial || this.observable.options.returnPartialData))) {
7813
+ (!this.result.partial || this.watchQueryOptions.returnPartialData))) {
7832
7814
  this.promise = createFulfilledPromise(this.result);
7833
- this.initialized = true;
7834
- this.refetching = false;
7815
+ this.status = 'idle';
7835
7816
  }
7836
- this.subscription = observable.subscribe({
7837
- next: this.handleNext,
7838
- error: this.handleError,
7839
- });
7840
- if (!this.promise) {
7817
+ else {
7841
7818
  this.promise = new Promise(function (resolve, reject) {
7842
7819
  _this.resolve = resolve;
7843
7820
  _this.reject = reject;
7844
7821
  });
7845
7822
  }
7823
+ this.subscription = observable
7824
+ .filter(function (_a) {
7825
+ var data = _a.data;
7826
+ return !equal.equal(data, {});
7827
+ })
7828
+ .subscribe({
7829
+ next: this.handleNext,
7830
+ error: this.handleError,
7831
+ });
7846
7832
  this.autoDisposeTimeoutId = setTimeout(this.dispose, (_a = options.autoDisposeTimeoutMs) !== null && _a !== void 0 ? _a : 30000);
7847
7833
  }
7848
7834
  Object.defineProperty(InternalQueryReference.prototype, "watchQueryOptions", {
@@ -7852,6 +7838,24 @@ var InternalQueryReference = (function () {
7852
7838
  enumerable: false,
7853
7839
  configurable: true
7854
7840
  });
7841
+ InternalQueryReference.prototype.retain = function () {
7842
+ var _this = this;
7843
+ this.references++;
7844
+ clearTimeout(this.autoDisposeTimeoutId);
7845
+ var disposed = false;
7846
+ return function () {
7847
+ if (disposed) {
7848
+ return;
7849
+ }
7850
+ disposed = true;
7851
+ _this.references--;
7852
+ setTimeout(function () {
7853
+ if (!_this.references) {
7854
+ _this.dispose();
7855
+ }
7856
+ });
7857
+ };
7858
+ };
7855
7859
  InternalQueryReference.prototype.didChangeOptions = function (watchQueryOptions) {
7856
7860
  var _this = this;
7857
7861
  return OBSERVED_CHANGED_OPTIONS.some(function (option) {
@@ -7859,40 +7863,36 @@ var InternalQueryReference = (function () {
7859
7863
  });
7860
7864
  };
7861
7865
  InternalQueryReference.prototype.applyOptions = function (watchQueryOptions) {
7862
- var currentFetchPolicy = this.watchQueryOptions.fetchPolicy;
7866
+ var _a = this.watchQueryOptions, currentFetchPolicy = _a.fetchPolicy, currentCanonizeResults = _a.canonizeResults;
7863
7867
  if (currentFetchPolicy === 'standby' &&
7864
7868
  currentFetchPolicy !== watchQueryOptions.fetchPolicy) {
7865
- this.promise = this.observable.reobserve(watchQueryOptions);
7869
+ this.observable.reobserve(watchQueryOptions);
7870
+ this.initiateFetch();
7866
7871
  }
7867
7872
  else {
7868
7873
  this.observable.silentSetOptions(watchQueryOptions);
7869
- this.result = tslib.__assign(tslib.__assign({}, this.result), this.observable.getCurrentResult());
7870
- this.promise = createFulfilledPromise(this.result);
7874
+ if (currentCanonizeResults !== watchQueryOptions.canonizeResults) {
7875
+ this.result = tslib.__assign(tslib.__assign({}, this.result), this.observable.getCurrentResult());
7876
+ this.promise = createFulfilledPromise(this.result);
7877
+ }
7871
7878
  }
7872
7879
  return this.promise;
7873
7880
  };
7874
7881
  InternalQueryReference.prototype.listen = function (listener) {
7875
7882
  var _this = this;
7876
- clearTimeout(this.autoDisposeTimeoutId);
7877
7883
  this.listeners.add(listener);
7878
7884
  return function () {
7879
7885
  _this.listeners.delete(listener);
7880
7886
  };
7881
7887
  };
7882
7888
  InternalQueryReference.prototype.refetch = function (variables) {
7883
- this.refetching = true;
7884
7889
  var promise = this.observable.refetch(variables);
7885
- this.promise = promise;
7890
+ this.initiateFetch();
7886
7891
  return promise;
7887
7892
  };
7888
7893
  InternalQueryReference.prototype.fetchMore = function (options) {
7889
7894
  var promise = this.observable.fetchMore(options);
7890
- this.promise = promise;
7891
- return promise;
7892
- };
7893
- InternalQueryReference.prototype.reobserve = function (watchQueryOptions) {
7894
- var promise = this.observable.reobserve(watchQueryOptions);
7895
- this.promise = promise;
7895
+ this.initiateFetch();
7896
7896
  return promise;
7897
7897
  };
7898
7898
  InternalQueryReference.prototype.dispose = function () {
@@ -7902,45 +7902,57 @@ var InternalQueryReference = (function () {
7902
7902
  InternalQueryReference.prototype.onDispose = function () {
7903
7903
  };
7904
7904
  InternalQueryReference.prototype.handleNext = function (result) {
7905
- if (!this.initialized || this.refetching) {
7906
- if (!isNetworkRequestSettled(result.networkStatus)) {
7907
- return;
7908
- }
7909
- if (this.result.data && result.data === void 0) {
7910
- result.data = this.result.data;
7905
+ var _a;
7906
+ switch (this.status) {
7907
+ case 'loading': {
7908
+ if (result.data === void 0) {
7909
+ result.data = this.result.data;
7910
+ }
7911
+ this.status = 'idle';
7912
+ this.result = result;
7913
+ (_a = this.resolve) === null || _a === void 0 ? void 0 : _a.call(this, result);
7914
+ break;
7911
7915
  }
7912
- this.initialized = true;
7913
- this.refetching = false;
7914
- this.result = result;
7915
- if (this.resolve) {
7916
- this.resolve(result);
7916
+ case 'idle': {
7917
+ if (result.data === this.result.data) {
7918
+ return;
7919
+ }
7920
+ if (result.data === void 0) {
7921
+ result.data = this.result.data;
7922
+ }
7923
+ this.result = result;
7924
+ this.promise = createFulfilledPromise(result);
7925
+ this.deliver(this.promise);
7926
+ break;
7917
7927
  }
7918
- return;
7919
7928
  }
7920
- if (result.data === this.result.data) {
7921
- return;
7922
- }
7923
- this.result = result;
7924
- this.promise = createFulfilledPromise(result);
7925
- this.deliver(this.promise);
7926
7929
  };
7927
7930
  InternalQueryReference.prototype.handleError = function (error) {
7928
- var result = tslib.__assign(tslib.__assign({}, this.result), { error: error, networkStatus: exports.NetworkStatus.error });
7929
- this.result = result;
7930
- if (!this.initialized || this.refetching) {
7931
- this.initialized = true;
7932
- this.refetching = false;
7933
- if (this.reject) {
7934
- this.reject(error);
7931
+ var _a;
7932
+ switch (this.status) {
7933
+ case 'loading': {
7934
+ this.status = 'idle';
7935
+ (_a = this.reject) === null || _a === void 0 ? void 0 : _a.call(this, error);
7936
+ break;
7937
+ }
7938
+ case 'idle': {
7939
+ this.promise = createRejectedPromise(error);
7940
+ this.deliver(this.promise);
7935
7941
  }
7936
- return;
7937
7942
  }
7938
- this.promise = createRejectedPromise(error);
7939
- this.deliver(this.promise);
7940
7943
  };
7941
7944
  InternalQueryReference.prototype.deliver = function (promise) {
7942
7945
  this.listeners.forEach(function (listener) { return listener(promise); });
7943
7946
  };
7947
+ InternalQueryReference.prototype.initiateFetch = function () {
7948
+ var _this = this;
7949
+ this.status = 'loading';
7950
+ this.promise = new Promise(function (resolve, reject) {
7951
+ _this.resolve = resolve;
7952
+ _this.reject = reject;
7953
+ });
7954
+ this.promise.catch(function () { });
7955
+ };
7944
7956
  return InternalQueryReference;
7945
7957
  }());
7946
7958
 
@@ -7955,28 +7967,28 @@ function useBackgroundQuery(query, options) {
7955
7967
  var queryRef = suspenseCache.getQueryRef(cacheKey, function () {
7956
7968
  return client.watchQuery(watchQueryOptions);
7957
7969
  });
7958
- var _b = React.useState(function () { return new Map([[queryRef.key, queryRef.promise]]); }), promiseCache = _b[0], setPromiseCache = _b[1];
7970
+ var _b = React__namespace.useState(function () { return new Map([[queryRef.key, queryRef.promise]]); }), promiseCache = _b[0], setPromiseCache = _b[1];
7959
7971
  if (queryRef.didChangeOptions(watchQueryOptions)) {
7960
7972
  var promise = queryRef.applyOptions(watchQueryOptions);
7961
7973
  promiseCache.set(queryRef.key, promise);
7962
7974
  }
7963
- useTrackedQueryRefs(queryRef);
7964
- var fetchMore = React.useCallback(function (options) {
7975
+ React__namespace.useEffect(function () { return queryRef.retain(); }, [queryRef]);
7976
+ var fetchMore = React__namespace.useCallback(function (options) {
7965
7977
  var promise = queryRef.fetchMore(options);
7966
7978
  setPromiseCache(function (promiseCache) {
7967
- return new Map(promiseCache).set(queryRef.key, promise);
7979
+ return new Map(promiseCache).set(queryRef.key, queryRef.promise);
7968
7980
  });
7969
7981
  return promise;
7970
7982
  }, [queryRef]);
7971
- var refetch = React.useCallback(function (variables) {
7983
+ var refetch = React__namespace.useCallback(function (variables) {
7972
7984
  var promise = queryRef.refetch(variables);
7973
7985
  setPromiseCache(function (promiseCache) {
7974
- return new Map(promiseCache).set(queryRef.key, promise);
7986
+ return new Map(promiseCache).set(queryRef.key, queryRef.promise);
7975
7987
  });
7976
7988
  return promise;
7977
7989
  }, [queryRef]);
7978
7990
  queryRef.promiseCache = promiseCache;
7979
- return React.useMemo(function () {
7991
+ return React__namespace.useMemo(function () {
7980
7992
  var _a;
7981
7993
  return [
7982
7994
  (_a = {}, _a[QUERY_REFERENCE_SYMBOL] = queryRef, _a),
@@ -7989,10 +8001,10 @@ function useBackgroundQuery(query, options) {
7989
8001
  }
7990
8002
 
7991
8003
  function useReadQuery(queryRef) {
7992
- var _a = React.useState(0), forceUpdate = _a[1];
8004
+ var _a = React__namespace.useState(0), forceUpdate = _a[1];
7993
8005
  var internalQueryRef = queryRef[QUERY_REFERENCE_SYMBOL];
7994
8006
  invariant__default(internalQueryRef.promiseCache, 49);
7995
- var skipResult = React.useMemo(function () {
8007
+ var skipResult = React__namespace.useMemo(function () {
7996
8008
  var error = toApolloError(internalQueryRef.result);
7997
8009
  return {
7998
8010
  loading: false,
@@ -8006,7 +8018,7 @@ function useReadQuery(queryRef) {
8006
8018
  promise = internalQueryRef.promise;
8007
8019
  internalQueryRef.promiseCache.set(internalQueryRef.key, promise);
8008
8020
  }
8009
- React.useEffect(function () {
8021
+ React__namespace.useEffect(function () {
8010
8022
  return internalQueryRef.listen(function (promise) {
8011
8023
  internalQueryRef.promiseCache.set(internalQueryRef.key, promise);
8012
8024
  forceUpdate(function (prevState) { return prevState + 1; });
@@ -8015,7 +8027,7 @@ function useReadQuery(queryRef) {
8015
8027
  var result = internalQueryRef.watchQueryOptions.fetchPolicy === 'standby'
8016
8028
  ? skipResult
8017
8029
  : __use(promise);
8018
- return React.useMemo(function () {
8030
+ return React__namespace.useMemo(function () {
8019
8031
  return {
8020
8032
  data: result.data,
8021
8033
  networkStatus: result.networkStatus,