@apollo/client 3.8.0-beta.6 → 3.8.0-rc.0

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 (652) hide show
  1. package/apollo-client.cjs +416 -398
  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 +7 -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 +29 -39
  103. package/dev/dev.cjs.map +1 -1
  104. package/dev/dev.cjs.native.js +29 -39
  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/invariantErrorCodes.js +27 -36
  127. package/link/batch/batch.cjs.map +1 -1
  128. package/link/batch/batchLink.d.ts +5 -5
  129. package/link/batch/batchLink.d.ts.map +1 -1
  130. package/link/batch/batchLink.js +3 -3
  131. package/link/batch/batchLink.js.map +1 -1
  132. package/link/batch/batching.d.ts +2 -2
  133. package/link/batch/batching.d.ts.map +1 -1
  134. package/link/batch/batching.js +1 -1
  135. package/link/batch/batching.js.map +1 -1
  136. package/link/batch/index.d.ts +1 -1
  137. package/link/batch/index.d.ts.map +1 -1
  138. package/link/batch/index.js +1 -1
  139. package/link/batch/index.js.map +1 -1
  140. package/link/batch-http/batch-http.cjs +5 -7
  141. package/link/batch-http/batch-http.cjs.map +1 -1
  142. package/link/batch-http/batch-http.cjs.native.js +5 -7
  143. package/link/batch-http/batchHttpLink.d.ts +5 -5
  144. package/link/batch-http/batchHttpLink.d.ts.map +1 -1
  145. package/link/batch-http/batchHttpLink.js +10 -12
  146. package/link/batch-http/batchHttpLink.js.map +1 -1
  147. package/link/batch-http/index.d.ts +1 -1
  148. package/link/batch-http/index.d.ts.map +1 -1
  149. package/link/batch-http/index.js +1 -1
  150. package/link/batch-http/index.js.map +1 -1
  151. package/link/context/context.cjs.map +1 -1
  152. package/link/context/index.d.ts +3 -3
  153. package/link/context/index.d.ts.map +1 -1
  154. package/link/context/index.js +2 -2
  155. package/link/context/index.js.map +1 -1
  156. package/link/core/ApolloLink.d.ts +3 -3
  157. package/link/core/ApolloLink.d.ts.map +1 -1
  158. package/link/core/ApolloLink.js +4 -4
  159. package/link/core/ApolloLink.js.map +1 -1
  160. package/link/core/concat.d.ts +1 -1
  161. package/link/core/concat.d.ts.map +1 -1
  162. package/link/core/concat.js +1 -1
  163. package/link/core/concat.js.map +1 -1
  164. package/link/core/core.cjs +1 -1
  165. package/link/core/core.cjs.map +1 -1
  166. package/link/core/core.cjs.native.js +1 -1
  167. package/link/core/empty.d.ts +1 -1
  168. package/link/core/empty.d.ts.map +1 -1
  169. package/link/core/empty.js +1 -1
  170. package/link/core/empty.js.map +1 -1
  171. package/link/core/execute.d.ts +1 -1
  172. package/link/core/execute.d.ts.map +1 -1
  173. package/link/core/execute.js +1 -1
  174. package/link/core/execute.js.map +1 -1
  175. package/link/core/from.d.ts +1 -1
  176. package/link/core/from.d.ts.map +1 -1
  177. package/link/core/from.js +1 -1
  178. package/link/core/from.js.map +1 -1
  179. package/link/core/index.d.ts +8 -8
  180. package/link/core/index.d.ts.map +1 -1
  181. package/link/core/index.js +8 -8
  182. package/link/core/index.js.map +1 -1
  183. package/link/core/split.d.ts +1 -1
  184. package/link/core/split.d.ts.map +1 -1
  185. package/link/core/split.js +1 -1
  186. package/link/core/split.js.map +1 -1
  187. package/link/core/types.d.ts +2 -2
  188. package/link/core/types.d.ts.map +1 -1
  189. package/link/core/types.js.map +1 -1
  190. package/link/error/error.cjs.map +1 -1
  191. package/link/error/index.d.ts +4 -4
  192. package/link/error/index.d.ts.map +1 -1
  193. package/link/error/index.js +2 -2
  194. package/link/error/index.js.map +1 -1
  195. package/link/http/HttpLink.d.ts +3 -3
  196. package/link/http/HttpLink.d.ts.map +1 -1
  197. package/link/http/HttpLink.js +2 -2
  198. package/link/http/HttpLink.js.map +1 -1
  199. package/link/http/checkFetcher.js +1 -1
  200. package/link/http/checkFetcher.js.map +1 -1
  201. package/link/http/createHttpLink.d.ts +2 -2
  202. package/link/http/createHttpLink.d.ts.map +1 -1
  203. package/link/http/createHttpLink.js +28 -23
  204. package/link/http/createHttpLink.js.map +1 -1
  205. package/link/http/createSignalIfSupported.d.ts.map +1 -1
  206. package/link/http/createSignalIfSupported.js.map +1 -1
  207. package/link/http/http.cjs +49 -62
  208. package/link/http/http.cjs.map +1 -1
  209. package/link/http/http.cjs.native.js +49 -62
  210. package/link/http/index.d.ts +10 -10
  211. package/link/http/index.d.ts.map +1 -1
  212. package/link/http/index.js +10 -10
  213. package/link/http/index.js.map +1 -1
  214. package/link/http/iterators/nodeStream.js.map +1 -1
  215. package/link/http/iterators/promise.js.map +1 -1
  216. package/link/http/iterators/reader.js.map +1 -1
  217. package/link/http/parseAndCheckHttpResponse.d.ts +4 -5
  218. package/link/http/parseAndCheckHttpResponse.d.ts.map +1 -1
  219. package/link/http/parseAndCheckHttpResponse.js +34 -53
  220. package/link/http/parseAndCheckHttpResponse.js.map +1 -1
  221. package/link/http/responseIterator.js.map +1 -1
  222. package/link/http/rewriteURIForGET.d.ts +1 -1
  223. package/link/http/rewriteURIForGET.d.ts.map +1 -1
  224. package/link/http/rewriteURIForGET.js +1 -1
  225. package/link/http/rewriteURIForGET.js.map +1 -1
  226. package/link/http/selectHttpOptionsAndBody.d.ts +2 -2
  227. package/link/http/selectHttpOptionsAndBody.d.ts.map +1 -1
  228. package/link/http/selectHttpOptionsAndBody.js +1 -1
  229. package/link/http/selectHttpOptionsAndBody.js.map +1 -1
  230. package/link/http/selectURI.d.ts +1 -1
  231. package/link/http/selectURI.d.ts.map +1 -1
  232. package/link/http/selectURI.js.map +1 -1
  233. package/link/http/serializeFetchParameter.d.ts +1 -1
  234. package/link/http/serializeFetchParameter.d.ts.map +1 -1
  235. package/link/http/serializeFetchParameter.js +1 -1
  236. package/link/http/serializeFetchParameter.js.map +1 -1
  237. package/link/persisted-queries/index.d.ts +3 -3
  238. package/link/persisted-queries/index.d.ts.map +1 -1
  239. package/link/persisted-queries/index.js +4 -4
  240. package/link/persisted-queries/index.js.map +1 -1
  241. package/link/persisted-queries/persisted-queries.cjs.map +1 -1
  242. package/link/remove-typename/index.d.ts +1 -1
  243. package/link/remove-typename/index.d.ts.map +1 -1
  244. package/link/remove-typename/index.js +1 -1
  245. package/link/remove-typename/index.js.map +1 -1
  246. package/link/remove-typename/remove-typename.cjs.map +1 -1
  247. package/link/remove-typename/removeTypenameFromVariables.d.ts +1 -1
  248. package/link/remove-typename/removeTypenameFromVariables.d.ts.map +1 -1
  249. package/link/remove-typename/removeTypenameFromVariables.js +2 -2
  250. package/link/remove-typename/removeTypenameFromVariables.js.map +1 -1
  251. package/link/retry/delayFunction.d.ts +1 -1
  252. package/link/retry/delayFunction.d.ts.map +1 -1
  253. package/link/retry/delayFunction.js.map +1 -1
  254. package/link/retry/index.d.ts +1 -1
  255. package/link/retry/index.d.ts.map +1 -1
  256. package/link/retry/index.js +1 -1
  257. package/link/retry/index.js.map +1 -1
  258. package/link/retry/retry.cjs.map +1 -1
  259. package/link/retry/retryFunction.d.ts +1 -1
  260. package/link/retry/retryFunction.d.ts.map +1 -1
  261. package/link/retry/retryFunction.js.map +1 -1
  262. package/link/retry/retryLink.d.ts +5 -5
  263. package/link/retry/retryLink.d.ts.map +1 -1
  264. package/link/retry/retryLink.js +4 -4
  265. package/link/retry/retryLink.js.map +1 -1
  266. package/link/schema/index.d.ts +3 -3
  267. package/link/schema/index.d.ts.map +1 -1
  268. package/link/schema/index.js +2 -2
  269. package/link/schema/index.js.map +1 -1
  270. package/link/schema/schema.cjs.map +1 -1
  271. package/link/subscriptions/index.d.ts +3 -3
  272. package/link/subscriptions/index.d.ts.map +1 -1
  273. package/link/subscriptions/index.js +1 -1
  274. package/link/subscriptions/index.js.map +1 -1
  275. package/link/subscriptions/subscriptions.cjs.map +1 -1
  276. package/link/utils/createOperation.d.ts +1 -1
  277. package/link/utils/createOperation.d.ts.map +1 -1
  278. package/link/utils/createOperation.js.map +1 -1
  279. package/link/utils/fromError.d.ts +1 -1
  280. package/link/utils/fromError.d.ts.map +1 -1
  281. package/link/utils/fromError.js +1 -1
  282. package/link/utils/fromError.js.map +1 -1
  283. package/link/utils/fromPromise.d.ts +1 -1
  284. package/link/utils/fromPromise.d.ts.map +1 -1
  285. package/link/utils/fromPromise.js +1 -1
  286. package/link/utils/fromPromise.js.map +1 -1
  287. package/link/utils/index.d.ts +9 -9
  288. package/link/utils/index.d.ts.map +1 -1
  289. package/link/utils/index.js +9 -9
  290. package/link/utils/index.js.map +1 -1
  291. package/link/utils/toPromise.d.ts +1 -1
  292. package/link/utils/toPromise.d.ts.map +1 -1
  293. package/link/utils/toPromise.js +2 -2
  294. package/link/utils/toPromise.js.map +1 -1
  295. package/link/utils/transformOperation.d.ts +1 -1
  296. package/link/utils/transformOperation.d.ts.map +1 -1
  297. package/link/utils/transformOperation.js +1 -1
  298. package/link/utils/transformOperation.js.map +1 -1
  299. package/link/utils/utils.cjs +1 -1
  300. package/link/utils/utils.cjs.map +1 -1
  301. package/link/utils/utils.cjs.native.js +1 -1
  302. package/link/utils/validateOperation.d.ts +1 -1
  303. package/link/utils/validateOperation.d.ts.map +1 -1
  304. package/link/utils/validateOperation.js +1 -1
  305. package/link/utils/validateOperation.js.map +1 -1
  306. package/link/ws/index.d.ts +3 -3
  307. package/link/ws/index.d.ts.map +1 -1
  308. package/link/ws/index.js +1 -1
  309. package/link/ws/index.js.map +1 -1
  310. package/link/ws/ws.cjs.map +1 -1
  311. package/package.json +20 -16
  312. package/react/cache/QueryReference.d.ts +8 -7
  313. package/react/cache/QueryReference.d.ts.map +1 -1
  314. package/react/cache/QueryReference.js +84 -53
  315. package/react/cache/QueryReference.js.map +1 -1
  316. package/react/cache/SuspenseCache.d.ts +4 -5
  317. package/react/cache/SuspenseCache.d.ts.map +1 -1
  318. package/react/cache/SuspenseCache.js +2 -2
  319. package/react/cache/SuspenseCache.js.map +1 -1
  320. package/react/cache/getSuspenseCache.d.ts +16 -0
  321. package/react/cache/getSuspenseCache.d.ts.map +1 -0
  322. package/react/cache/getSuspenseCache.js +10 -0
  323. package/react/cache/getSuspenseCache.js.map +1 -0
  324. package/react/cache/index.d.ts +6 -1
  325. package/react/cache/index.d.ts.map +1 -1
  326. package/react/cache/index.js +15 -1
  327. package/react/cache/index.js.map +1 -1
  328. package/react/cache/types.d.ts +2 -1
  329. package/react/cache/types.d.ts.map +1 -1
  330. package/react/cache/types.js.map +1 -1
  331. package/react/components/Mutation.d.ts +3 -3
  332. package/react/components/Mutation.d.ts.map +1 -1
  333. package/react/components/Mutation.js +1 -1
  334. package/react/components/Mutation.js.map +1 -1
  335. package/react/components/Query.d.ts +2 -2
  336. package/react/components/Query.d.ts.map +1 -1
  337. package/react/components/Query.js +1 -1
  338. package/react/components/Query.js.map +1 -1
  339. package/react/components/Subscription.d.ts +2 -2
  340. package/react/components/Subscription.d.ts.map +1 -1
  341. package/react/components/Subscription.js +1 -1
  342. package/react/components/Subscription.js.map +1 -1
  343. package/react/components/components.cjs.map +1 -1
  344. package/react/components/index.d.ts +4 -4
  345. package/react/components/index.d.ts.map +1 -1
  346. package/react/components/index.js +4 -4
  347. package/react/components/index.js.map +1 -1
  348. package/react/components/types.d.ts +2 -2
  349. package/react/components/types.d.ts.map +1 -1
  350. package/react/components/types.js.map +1 -1
  351. package/react/context/ApolloConsumer.d.ts +1 -1
  352. package/react/context/ApolloConsumer.d.ts.map +1 -1
  353. package/react/context/ApolloConsumer.js +2 -2
  354. package/react/context/ApolloConsumer.js.map +1 -1
  355. package/react/context/ApolloContext.d.ts +3 -6
  356. package/react/context/ApolloContext.d.ts.map +1 -1
  357. package/react/context/ApolloContext.js +11 -4
  358. package/react/context/ApolloContext.js.map +1 -1
  359. package/react/context/ApolloProvider.d.ts +1 -3
  360. package/react/context/ApolloProvider.d.ts.map +1 -1
  361. package/react/context/ApolloProvider.js +5 -5
  362. package/react/context/ApolloProvider.js.map +1 -1
  363. package/react/context/context.cjs +12 -5
  364. package/react/context/context.cjs.map +1 -1
  365. package/react/context/context.cjs.native.js +12 -5
  366. package/react/context/index.d.ts +4 -4
  367. package/react/context/index.d.ts.map +1 -1
  368. package/react/context/index.js +4 -4
  369. package/react/context/index.js.map +1 -1
  370. package/react/hoc/graphql.d.ts +2 -2
  371. package/react/hoc/graphql.d.ts.map +1 -1
  372. package/react/hoc/graphql.js +4 -4
  373. package/react/hoc/graphql.js.map +1 -1
  374. package/react/hoc/hoc-utils.d.ts +2 -2
  375. package/react/hoc/hoc-utils.d.ts.map +1 -1
  376. package/react/hoc/hoc-utils.js +1 -1
  377. package/react/hoc/hoc-utils.js.map +1 -1
  378. package/react/hoc/hoc.cjs.map +1 -1
  379. package/react/hoc/index.d.ts +7 -7
  380. package/react/hoc/index.d.ts.map +1 -1
  381. package/react/hoc/index.js +7 -7
  382. package/react/hoc/index.js.map +1 -1
  383. package/react/hoc/mutation-hoc.d.ts +3 -3
  384. package/react/hoc/mutation-hoc.d.ts.map +1 -1
  385. package/react/hoc/mutation-hoc.js +3 -3
  386. package/react/hoc/mutation-hoc.js.map +1 -1
  387. package/react/hoc/query-hoc.d.ts +1 -1
  388. package/react/hoc/query-hoc.d.ts.map +1 -1
  389. package/react/hoc/query-hoc.js +3 -3
  390. package/react/hoc/query-hoc.js.map +1 -1
  391. package/react/hoc/subscription-hoc.d.ts +1 -1
  392. package/react/hoc/subscription-hoc.d.ts.map +1 -1
  393. package/react/hoc/subscription-hoc.js +3 -3
  394. package/react/hoc/subscription-hoc.js.map +1 -1
  395. package/react/hoc/types.d.ts +4 -4
  396. package/react/hoc/types.d.ts.map +1 -1
  397. package/react/hoc/types.js.map +1 -1
  398. package/react/hoc/withApollo.d.ts +1 -1
  399. package/react/hoc/withApollo.d.ts.map +1 -1
  400. package/react/hoc/withApollo.js +2 -2
  401. package/react/hoc/withApollo.js.map +1 -1
  402. package/react/hooks/hooks.cjs +279 -231
  403. package/react/hooks/hooks.cjs.map +1 -1
  404. package/react/hooks/hooks.cjs.native.js +279 -231
  405. package/react/hooks/index.d.ts +11 -11
  406. package/react/hooks/index.d.ts.map +1 -1
  407. package/react/hooks/index.js +11 -11
  408. package/react/hooks/index.js.map +1 -1
  409. package/react/hooks/internal/__use.js +2 -2
  410. package/react/hooks/internal/__use.js.map +1 -1
  411. package/react/hooks/internal/index.d.ts +3 -4
  412. package/react/hooks/internal/index.d.ts.map +1 -1
  413. package/react/hooks/internal/index.js +3 -4
  414. package/react/hooks/internal/index.js.map +1 -1
  415. package/react/hooks/internal/useDeepMemo.js +2 -2
  416. package/react/hooks/internal/useDeepMemo.js.map +1 -1
  417. package/react/hooks/internal/useIsomorphicLayoutEffect.d.ts +2 -2
  418. package/react/hooks/internal/useIsomorphicLayoutEffect.d.ts.map +1 -1
  419. package/react/hooks/internal/useIsomorphicLayoutEffect.js +4 -4
  420. package/react/hooks/internal/useIsomorphicLayoutEffect.js.map +1 -1
  421. package/react/hooks/useApolloClient.d.ts +1 -1
  422. package/react/hooks/useApolloClient.d.ts.map +1 -1
  423. package/react/hooks/useApolloClient.js +4 -4
  424. package/react/hooks/useApolloClient.js.map +1 -1
  425. package/react/hooks/useBackgroundQuery.d.ts +5 -5
  426. package/react/hooks/useBackgroundQuery.d.ts.map +1 -1
  427. package/react/hooks/useBackgroundQuery.js +19 -15
  428. package/react/hooks/useBackgroundQuery.js.map +1 -1
  429. package/react/hooks/useFragment.d.ts +4 -4
  430. package/react/hooks/useFragment.d.ts.map +1 -1
  431. package/react/hooks/useFragment.js +2 -2
  432. package/react/hooks/useFragment.js.map +1 -1
  433. package/react/hooks/useLazyQuery.d.ts +2 -2
  434. package/react/hooks/useLazyQuery.d.ts.map +1 -1
  435. package/react/hooks/useLazyQuery.js +9 -9
  436. package/react/hooks/useLazyQuery.js.map +1 -1
  437. package/react/hooks/useMutation.d.ts +2 -2
  438. package/react/hooks/useMutation.d.ts.map +1 -1
  439. package/react/hooks/useMutation.js +10 -10
  440. package/react/hooks/useMutation.js.map +1 -1
  441. package/react/hooks/useQuery.d.ts +4 -4
  442. package/react/hooks/useQuery.d.ts.map +1 -1
  443. package/react/hooks/useQuery.js +17 -17
  444. package/react/hooks/useQuery.js.map +1 -1
  445. package/react/hooks/useReactiveVar.d.ts +1 -1
  446. package/react/hooks/useReactiveVar.d.ts.map +1 -1
  447. package/react/hooks/useReactiveVar.js +3 -3
  448. package/react/hooks/useReactiveVar.js.map +1 -1
  449. package/react/hooks/useReadQuery.d.ts +3 -3
  450. package/react/hooks/useReadQuery.d.ts.map +1 -1
  451. package/react/hooks/useReadQuery.js +5 -5
  452. package/react/hooks/useReadQuery.js.map +1 -1
  453. package/react/hooks/useSubscription.d.ts +2 -2
  454. package/react/hooks/useSubscription.d.ts.map +1 -1
  455. package/react/hooks/useSubscription.js +14 -14
  456. package/react/hooks/useSubscription.js.map +1 -1
  457. package/react/hooks/useSuspenseQuery.d.ts +4 -6
  458. package/react/hooks/useSuspenseQuery.d.ts.map +1 -1
  459. package/react/hooks/useSuspenseQuery.js +33 -33
  460. package/react/hooks/useSuspenseQuery.js.map +1 -1
  461. package/react/hooks/useSyncExternalStore.js +4 -4
  462. package/react/hooks/useSyncExternalStore.js.map +1 -1
  463. package/react/index.d.ts +6 -6
  464. package/react/index.d.ts.map +1 -1
  465. package/react/index.js +6 -6
  466. package/react/index.js.map +1 -1
  467. package/react/parser/index.js +6 -6
  468. package/react/parser/index.js.map +1 -1
  469. package/react/parser/parser.cjs +5 -5
  470. package/react/parser/parser.cjs.map +1 -1
  471. package/react/parser/parser.cjs.native.js +5 -5
  472. package/react/react.cjs +96 -54
  473. package/react/react.cjs.map +1 -1
  474. package/react/react.cjs.native.js +96 -54
  475. package/react/ssr/RenderPromises.d.ts +2 -2
  476. package/react/ssr/RenderPromises.d.ts.map +1 -1
  477. package/react/ssr/RenderPromises.js.map +1 -1
  478. package/react/ssr/getDataFromTree.js +2 -2
  479. package/react/ssr/getDataFromTree.js.map +1 -1
  480. package/react/ssr/index.d.ts +3 -3
  481. package/react/ssr/index.d.ts.map +1 -1
  482. package/react/ssr/index.js +3 -3
  483. package/react/ssr/index.js.map +1 -1
  484. package/react/ssr/renderToStringWithData.js +1 -1
  485. package/react/ssr/renderToStringWithData.js.map +1 -1
  486. package/react/ssr/ssr.cjs.map +1 -1
  487. package/react/types/types.d.ts +7 -7
  488. package/react/types/types.d.ts.map +1 -1
  489. package/react/types/types.js.map +1 -1
  490. package/testing/core/core.cjs +1 -1
  491. package/testing/core/core.cjs.map +1 -1
  492. package/testing/core/core.cjs.native.js +1 -1
  493. package/testing/core/index.d.ts +7 -7
  494. package/testing/core/index.d.ts.map +1 -1
  495. package/testing/core/index.js +7 -7
  496. package/testing/core/index.js.map +1 -1
  497. package/testing/core/mocking/mockClient.d.ts +2 -2
  498. package/testing/core/mocking/mockClient.d.ts.map +1 -1
  499. package/testing/core/mocking/mockClient.js +3 -3
  500. package/testing/core/mocking/mockClient.js.map +1 -1
  501. package/testing/core/mocking/mockLink.d.ts +3 -3
  502. package/testing/core/mocking/mockLink.d.ts.map +1 -1
  503. package/testing/core/mocking/mockLink.js +4 -4
  504. package/testing/core/mocking/mockLink.js.map +1 -1
  505. package/testing/core/mocking/mockQueryManager.d.ts +3 -3
  506. package/testing/core/mocking/mockQueryManager.d.ts.map +1 -1
  507. package/testing/core/mocking/mockQueryManager.js +3 -3
  508. package/testing/core/mocking/mockQueryManager.js.map +1 -1
  509. package/testing/core/mocking/mockSubscriptionLink.d.ts +3 -3
  510. package/testing/core/mocking/mockSubscriptionLink.d.ts.map +1 -1
  511. package/testing/core/mocking/mockSubscriptionLink.js +2 -2
  512. package/testing/core/mocking/mockSubscriptionLink.js.map +1 -1
  513. package/testing/core/mocking/mockWatchQuery.d.ts +2 -2
  514. package/testing/core/mocking/mockWatchQuery.d.ts.map +1 -1
  515. package/testing/core/mocking/mockWatchQuery.js +1 -1
  516. package/testing/core/mocking/mockWatchQuery.js.map +1 -1
  517. package/testing/core/observableToPromise.d.ts +2 -2
  518. package/testing/core/observableToPromise.d.ts.map +1 -1
  519. package/testing/core/observableToPromise.js.map +1 -1
  520. package/testing/core/subscribeAndCount.d.ts +1 -1
  521. package/testing/core/subscribeAndCount.d.ts.map +1 -1
  522. package/testing/core/subscribeAndCount.js +1 -1
  523. package/testing/core/subscribeAndCount.js.map +1 -1
  524. package/testing/index.d.ts +3 -3
  525. package/testing/index.d.ts.map +1 -1
  526. package/testing/index.js +3 -3
  527. package/testing/index.js.map +1 -1
  528. package/testing/matchers/index.js +2 -2
  529. package/testing/matchers/index.js.map +1 -1
  530. package/testing/matchers/toHaveSuspenseCacheEntryUsing.d.ts +1 -2
  531. package/testing/matchers/toHaveSuspenseCacheEntryUsing.d.ts.map +1 -1
  532. package/testing/matchers/toHaveSuspenseCacheEntryUsing.js +12 -6
  533. package/testing/matchers/toHaveSuspenseCacheEntryUsing.js.map +1 -1
  534. package/testing/matchers/toMatchDocument.d.ts +1 -1
  535. package/testing/matchers/toMatchDocument.d.ts.map +1 -1
  536. package/testing/matchers/toMatchDocument.js +1 -1
  537. package/testing/matchers/toMatchDocument.js.map +1 -1
  538. package/testing/react/MockedProvider.d.ts +6 -9
  539. package/testing/react/MockedProvider.d.ts.map +1 -1
  540. package/testing/react/MockedProvider.js +8 -10
  541. package/testing/react/MockedProvider.js.map +1 -1
  542. package/testing/testing.cjs +4 -6
  543. package/testing/testing.cjs.map +1 -1
  544. package/testing/testing.cjs.native.js +4 -6
  545. package/utilities/common/canUse.js.map +1 -1
  546. package/utilities/common/compact.d.ts +1 -1
  547. package/utilities/common/compact.d.ts.map +1 -1
  548. package/utilities/common/compact.js.map +1 -1
  549. package/utilities/common/errorHandling.d.ts +1 -1
  550. package/utilities/common/errorHandling.d.ts.map +1 -1
  551. package/utilities/common/errorHandling.js.map +1 -1
  552. package/utilities/common/incrementalResult.d.ts +1 -1
  553. package/utilities/common/incrementalResult.d.ts.map +1 -1
  554. package/utilities/common/incrementalResult.js.map +1 -1
  555. package/utilities/common/maybeDeepFreeze.d.ts.map +1 -1
  556. package/utilities/common/maybeDeepFreeze.js +3 -4
  557. package/utilities/common/maybeDeepFreeze.js.map +1 -1
  558. package/utilities/common/mergeDeep.d.ts +1 -1
  559. package/utilities/common/mergeDeep.d.ts.map +1 -1
  560. package/utilities/common/mergeDeep.js.map +1 -1
  561. package/utilities/common/mergeOptions.d.ts +1 -1
  562. package/utilities/common/mergeOptions.d.ts.map +1 -1
  563. package/utilities/common/mergeOptions.js.map +1 -1
  564. package/utilities/common/omitDeep.d.ts +1 -1
  565. package/utilities/common/omitDeep.d.ts.map +1 -1
  566. package/utilities/common/omitDeep.js +1 -1
  567. package/utilities/common/omitDeep.js.map +1 -1
  568. package/utilities/common/responseIterator.js.map +1 -1
  569. package/utilities/common/stringifyForDisplay.js.map +1 -1
  570. package/utilities/common/stripTypename.d.ts +1 -1
  571. package/utilities/common/stripTypename.d.ts.map +1 -1
  572. package/utilities/common/stripTypename.js +1 -1
  573. package/utilities/common/stripTypename.js.map +1 -1
  574. package/utilities/globals/global.d.ts.map +1 -1
  575. package/utilities/globals/global.js.map +1 -1
  576. package/utilities/globals/globals.cjs +4 -16
  577. package/utilities/globals/globals.cjs.map +1 -1
  578. package/utilities/globals/globals.cjs.native.js +4 -16
  579. package/utilities/globals/index.d.ts +5 -6
  580. package/utilities/globals/index.d.ts.map +1 -1
  581. package/utilities/globals/index.js +2 -5
  582. package/utilities/globals/index.js.map +1 -1
  583. package/utilities/globals/invariantWrappers.d.ts +1 -1
  584. package/utilities/globals/invariantWrappers.d.ts.map +1 -1
  585. package/utilities/globals/invariantWrappers.js +3 -3
  586. package/utilities/globals/invariantWrappers.js.map +1 -1
  587. package/utilities/graphql/DocumentTransform.js +4 -4
  588. package/utilities/graphql/DocumentTransform.js.map +1 -1
  589. package/utilities/graphql/directives.js +5 -5
  590. package/utilities/graphql/directives.js.map +1 -1
  591. package/utilities/graphql/fragments.js +4 -4
  592. package/utilities/graphql/fragments.js.map +1 -1
  593. package/utilities/graphql/getFromAST.js +10 -10
  594. package/utilities/graphql/getFromAST.js.map +1 -1
  595. package/utilities/graphql/operations.d.ts +1 -1
  596. package/utilities/graphql/operations.d.ts.map +1 -1
  597. package/utilities/graphql/operations.js +1 -1
  598. package/utilities/graphql/operations.js.map +1 -1
  599. package/utilities/graphql/print.js +1 -1
  600. package/utilities/graphql/print.js.map +1 -1
  601. package/utilities/graphql/storeUtils.d.ts +1 -1
  602. package/utilities/graphql/storeUtils.d.ts.map +1 -1
  603. package/utilities/graphql/storeUtils.js +4 -4
  604. package/utilities/graphql/storeUtils.js.map +1 -1
  605. package/utilities/graphql/transform.js +7 -7
  606. package/utilities/graphql/transform.js.map +1 -1
  607. package/utilities/index.d.ts +34 -34
  608. package/utilities/index.d.ts.map +1 -1
  609. package/utilities/index.js +32 -32
  610. package/utilities/index.js.map +1 -1
  611. package/utilities/observables/Concast.d.ts +2 -2
  612. package/utilities/observables/Concast.d.ts.map +1 -1
  613. package/utilities/observables/Concast.js.map +1 -1
  614. package/utilities/observables/asyncMap.d.ts +1 -1
  615. package/utilities/observables/asyncMap.d.ts.map +1 -1
  616. package/utilities/observables/asyncMap.js.map +1 -1
  617. package/utilities/observables/iteration.d.ts +1 -1
  618. package/utilities/observables/iteration.d.ts.map +1 -1
  619. package/utilities/observables/iteration.js.map +1 -1
  620. package/utilities/observables/subclassing.d.ts +1 -1
  621. package/utilities/observables/subclassing.d.ts.map +1 -1
  622. package/utilities/observables/subclassing.js.map +1 -1
  623. package/utilities/policies/pagination.d.ts +1 -1
  624. package/utilities/policies/pagination.d.ts.map +1 -1
  625. package/utilities/policies/pagination.js +1 -1
  626. package/utilities/policies/pagination.js.map +1 -1
  627. package/utilities/types/DeepOmit.d.ts +1 -1
  628. package/utilities/types/DeepOmit.d.ts.map +1 -1
  629. package/utilities/types/DeepOmit.js.map +1 -1
  630. package/utilities/types/DeepPartial.d.ts +1 -1
  631. package/utilities/types/DeepPartial.d.ts.map +1 -1
  632. package/utilities/types/DeepPartial.js.map +1 -1
  633. package/utilities/utilities.cjs +21 -21
  634. package/utilities/utilities.cjs.map +1 -1
  635. package/utilities/utilities.cjs.native.js +21 -21
  636. package/version.js +1 -1
  637. package/react/hooks/internal/useStrictModeSafeCleanupEffect.d.ts +0 -2
  638. package/react/hooks/internal/useStrictModeSafeCleanupEffect.d.ts.map +0 -1
  639. package/react/hooks/internal/useStrictModeSafeCleanupEffect.js +0 -11
  640. package/react/hooks/internal/useStrictModeSafeCleanupEffect.js.map +0 -1
  641. package/react/hooks/useSuspenseCache.d.ts +0 -3
  642. package/react/hooks/useSuspenseCache.d.ts.map +0 -1
  643. package/react/hooks/useSuspenseCache.js +0 -10
  644. package/react/hooks/useSuspenseCache.js.map +0 -1
  645. package/utilities/globals/DEV.d.ts +0 -3
  646. package/utilities/globals/DEV.d.ts.map +0 -1
  647. package/utilities/globals/DEV.js +0 -4
  648. package/utilities/globals/DEV.js.map +0 -1
  649. package/utilities/globals/fix-graphql.d.ts +0 -2
  650. package/utilities/globals/fix-graphql.d.ts.map +0 -1
  651. package/utilities/globals/fix-graphql.js +0 -6
  652. package/utilities/globals/fix-graphql.js.map +0 -1
@@ -12,6 +12,7 @@ var errors = require('../../errors');
12
12
  var core = require('../../core');
13
13
  var parser = require('../parser');
14
14
  var cache = require('../../cache');
15
+ var trie = require('@wry/trie');
15
16
  var invariant = require('ts-invariant');
16
17
 
17
18
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e["default"] : e; }
@@ -29,11 +30,10 @@ function _interopNamespace(e) {
29
30
  }
30
31
 
31
32
  var React__namespace = /*#__PURE__*/_interopNamespace(React);
32
- var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
33
33
  var invariant__default = /*#__PURE__*/_interopDefaultLegacy(invariant);
34
34
 
35
35
  function useApolloClient(override) {
36
- var context$1 = React.useContext(context.getApolloContext());
36
+ var context$1 = React__namespace.useContext(context.getApolloContext());
37
37
  var client = override || context$1.client;
38
38
  globals.invariant(!!client, 47);
39
39
  return client;
@@ -44,11 +44,11 @@ var uSESKey = "useSyncExternalStore";
44
44
  var realHook$1 = React__namespace[uSESKey];
45
45
  var useSyncExternalStore = realHook$1 || (function (subscribe, getSnapshot, getServerSnapshot) {
46
46
  var value = getSnapshot();
47
- if (globals.__DEV__ &&
47
+ if (globalThis.__DEV__ !== false &&
48
48
  !didWarnUncachedGetSnapshot &&
49
49
  value !== getSnapshot()) {
50
50
  didWarnUncachedGetSnapshot = true;
51
- globals.__DEV__ && globals.invariant.error(57);
51
+ globalThis.__DEV__ !== false && globals.invariant.error(56);
52
52
  }
53
53
  var _a = React__namespace.useState({ inst: { value: value, getSnapshot: getSnapshot } }), inst = _a[0].inst, forceUpdate = _a[1];
54
54
  if (utilities.canUseLayoutEffect) {
@@ -90,14 +90,14 @@ function useQuery(query, options) {
90
90
  return useInternalState(useApolloClient(options.client), query).useQuery(options);
91
91
  }
92
92
  function useInternalState(client, query) {
93
- var stateRef = React.useRef();
93
+ var stateRef = React__namespace.useRef();
94
94
  if (!stateRef.current ||
95
95
  client !== stateRef.current.client ||
96
96
  query !== stateRef.current.query) {
97
97
  stateRef.current = new InternalState(client, query, stateRef.current);
98
98
  }
99
99
  var state = stateRef.current;
100
- var _a = React.useState(0); _a[0]; var setTick = _a[1];
100
+ var _a = React__namespace.useState(0); _a[0]; var setTick = _a[1];
101
101
  state.forceUpdate = function () {
102
102
  setTick(function (tick) { return tick + 1; });
103
103
  };
@@ -128,7 +128,7 @@ var InternalState = (function () {
128
128
  }
129
129
  }
130
130
  InternalState.prototype.forceUpdate = function () {
131
- globals.__DEV__ && globals.invariant.warn(48);
131
+ globalThis.__DEV__ !== false && globals.invariant.warn(48);
132
132
  };
133
133
  InternalState.prototype.executeQuery = function (options) {
134
134
  var _this = this;
@@ -158,10 +158,10 @@ var InternalState = (function () {
158
158
  };
159
159
  InternalState.prototype.useQuery = function (options) {
160
160
  var _this = this;
161
- this.renderPromises = React.useContext(context.getApolloContext()).renderPromises;
161
+ this.renderPromises = React__namespace.useContext(context.getApolloContext()).renderPromises;
162
162
  this.useOptions(options);
163
163
  var obsQuery = this.useObservableQuery();
164
- var result = useSyncExternalStore(React.useCallback(function () {
164
+ var result = useSyncExternalStore(React__namespace.useCallback(function () {
165
165
  if (_this.renderPromises) {
166
166
  return function () { };
167
167
  }
@@ -291,7 +291,7 @@ var InternalState = (function () {
291
291
  && this.renderPromises.getSSRObservable(this.watchQueryOptions)
292
292
  || this.observable
293
293
  || this.client.watchQuery(this.getObsQueryOptions());
294
- this.obsQueryFields = React.useMemo(function () { return ({
294
+ this.obsQueryFields = React__namespace.useMemo(function () { return ({
295
295
  refetch: obsQuery.refetch.bind(obsQuery),
296
296
  reobserve: obsQuery.reobserve.bind(obsQuery),
297
297
  fetchMore: obsQuery.fetchMore.bind(obsQuery),
@@ -333,7 +333,7 @@ var InternalState = (function () {
333
333
  _this.onCompleted(result.data);
334
334
  }
335
335
  }).catch(function (error) {
336
- globals.__DEV__ && globals.invariant.warn(error);
336
+ globalThis.__DEV__ !== false && globals.invariant.warn(error);
337
337
  });
338
338
  }
339
339
  };
@@ -385,9 +385,9 @@ var EAGER_METHODS = [
385
385
  ];
386
386
  function useLazyQuery(query, options) {
387
387
  var _a;
388
- var execOptionsRef = React.useRef();
389
- var optionsRef = React.useRef();
390
- var queryRef = React.useRef();
388
+ var execOptionsRef = React__namespace.useRef();
389
+ var optionsRef = React__namespace.useRef();
390
+ var queryRef = React__namespace.useRef();
391
391
  var merged = utilities.mergeOptions(options, execOptionsRef.current || {});
392
392
  var document = (_a = merged === null || merged === void 0 ? void 0 : merged.query) !== null && _a !== void 0 ? _a : query;
393
393
  optionsRef.current = merged;
@@ -399,7 +399,7 @@ function useLazyQuery(query, options) {
399
399
  var result = Object.assign(useQueryResult, {
400
400
  called: !!execOptionsRef.current,
401
401
  });
402
- var eagerMethods = React.useMemo(function () {
402
+ var eagerMethods = React__namespace.useMemo(function () {
403
403
  var eagerMethods = {};
404
404
  var _loop_1 = function (key) {
405
405
  var method = result[key];
@@ -418,7 +418,7 @@ function useLazyQuery(query, options) {
418
418
  return eagerMethods;
419
419
  }, []);
420
420
  Object.assign(result, eagerMethods);
421
- var execute = React.useCallback(function (executeOptions) {
421
+ var execute = React__namespace.useCallback(function (executeOptions) {
422
422
  execOptionsRef.current = executeOptions ? tslib.__assign(tslib.__assign({}, executeOptions), { fetchPolicy: executeOptions.fetchPolicy || initialFetchPolicy }) : {
423
423
  fetchPolicy: initialFetchPolicy,
424
424
  };
@@ -435,12 +435,12 @@ function useLazyQuery(query, options) {
435
435
  function useMutation(mutation, options) {
436
436
  var client = useApolloClient(options === null || options === void 0 ? void 0 : options.client);
437
437
  parser.verifyDocumentType(mutation, parser.DocumentType.Mutation);
438
- var _a = React.useState({
438
+ var _a = React__namespace.useState({
439
439
  called: false,
440
440
  loading: false,
441
441
  client: client,
442
442
  }), result = _a[0], setResult = _a[1];
443
- var ref = React.useRef({
443
+ var ref = React__namespace.useRef({
444
444
  result: result,
445
445
  mutationId: 0,
446
446
  isMounted: true,
@@ -451,7 +451,7 @@ function useMutation(mutation, options) {
451
451
  {
452
452
  Object.assign(ref.current, { client: client, options: options, mutation: mutation });
453
453
  }
454
- var execute = React.useCallback(function (executeOptions) {
454
+ var execute = React__namespace.useCallback(function (executeOptions) {
455
455
  if (executeOptions === void 0) { executeOptions = {}; }
456
456
  var _a = ref.current, options = _a.options, mutation = _a.mutation;
457
457
  var baseOptions = tslib.__assign(tslib.__assign({}, options), { mutation: mutation });
@@ -512,12 +512,12 @@ function useMutation(mutation, options) {
512
512
  throw error;
513
513
  });
514
514
  }, []);
515
- var reset = React.useCallback(function () {
515
+ var reset = React__namespace.useCallback(function () {
516
516
  if (ref.current.isMounted) {
517
517
  setResult({ called: false, loading: false, client: client });
518
518
  }
519
519
  }, []);
520
- React.useEffect(function () {
520
+ React__namespace.useEffect(function () {
521
521
  ref.current.isMounted = true;
522
522
  return function () {
523
523
  ref.current.isMounted = false;
@@ -527,10 +527,10 @@ function useMutation(mutation, options) {
527
527
  }
528
528
 
529
529
  function useSubscription(subscription, options) {
530
- var hasIssuedDeprecationWarningRef = React.useRef(false);
530
+ var hasIssuedDeprecationWarningRef = React__namespace.useRef(false);
531
531
  var client = useApolloClient(options === null || options === void 0 ? void 0 : options.client);
532
532
  parser.verifyDocumentType(subscription, parser.DocumentType.Subscription);
533
- var _a = React.useState({
533
+ var _a = React__namespace.useState({
534
534
  loading: !(options === null || options === void 0 ? void 0 : options.skip),
535
535
  error: void 0,
536
536
  data: void 0,
@@ -539,13 +539,13 @@ function useSubscription(subscription, options) {
539
539
  if (!hasIssuedDeprecationWarningRef.current) {
540
540
  hasIssuedDeprecationWarningRef.current = true;
541
541
  if (options === null || options === void 0 ? void 0 : options.onSubscriptionData) {
542
- globals.__DEV__ && globals.invariant.warn(options.onData ? 50 : 51);
542
+ globalThis.__DEV__ !== false && globals.invariant.warn(options.onData ? 50 : 51);
543
543
  }
544
544
  if (options === null || options === void 0 ? void 0 : options.onSubscriptionComplete) {
545
- globals.__DEV__ && globals.invariant.warn(options.onComplete ? 52 : 53);
545
+ globalThis.__DEV__ !== false && globals.invariant.warn(options.onComplete ? 52 : 53);
546
546
  }
547
547
  }
548
- var _b = React.useState(function () {
548
+ var _b = React__namespace.useState(function () {
549
549
  if (options === null || options === void 0 ? void 0 : options.skip) {
550
550
  return null;
551
551
  }
@@ -556,14 +556,14 @@ function useSubscription(subscription, options) {
556
556
  context: options === null || options === void 0 ? void 0 : options.context,
557
557
  });
558
558
  }), observable = _b[0], setObservable = _b[1];
559
- var canResetObservableRef = React.useRef(false);
560
- React.useEffect(function () {
559
+ var canResetObservableRef = React__namespace.useRef(false);
560
+ React__namespace.useEffect(function () {
561
561
  return function () {
562
562
  canResetObservableRef.current = true;
563
563
  };
564
564
  }, []);
565
- var ref = React.useRef({ client: client, subscription: subscription, options: options });
566
- React.useEffect(function () {
565
+ var ref = React__namespace.useRef({ client: client, subscription: subscription, options: options });
566
+ React__namespace.useEffect(function () {
567
567
  var _a, _b, _c, _d;
568
568
  var shouldResubscribe = options === null || options === void 0 ? void 0 : options.shouldResubscribe;
569
569
  if (typeof shouldResubscribe === 'function') {
@@ -604,7 +604,7 @@ function useSubscription(subscription, options) {
604
604
  }
605
605
  Object.assign(ref.current, { client: client, subscription: subscription, options: options });
606
606
  }, [client, subscription, options, canResetObservableRef.current]);
607
- React.useEffect(function () {
607
+ React__namespace.useEffect(function () {
608
608
  if (!observable) {
609
609
  return;
610
610
  }
@@ -671,8 +671,8 @@ function useSubscription(subscription, options) {
671
671
 
672
672
  function useReactiveVar(rv) {
673
673
  var value = rv();
674
- var setValue = React.useState(value)[1];
675
- React.useEffect(function () {
674
+ var setValue = React__namespace.useState(value)[1];
675
+ React__namespace.useEffect(function () {
676
676
  var probablySameValue = rv();
677
677
  if (value !== probablySameValue) {
678
678
  setValue(probablySameValue);
@@ -688,7 +688,7 @@ function useFragment(options) {
688
688
  var cache = useApolloClient().cache;
689
689
  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"]);
690
690
  var diffOptions = tslib.__assign(tslib.__assign({}, rest), { returnPartialData: true, id: typeof from === "string" ? from : cache.identify(from), query: cache["getFragmentDoc"](fragment, fragmentName), optimistic: optimistic });
691
- var resultRef = React.useRef();
691
+ var resultRef = React__namespace.useRef();
692
692
  var latestDiff = cache.diff(diffOptions);
693
693
  var getSnapshot = function () {
694
694
  var latestDiffToResult = diffToResult(latestDiff);
@@ -718,25 +718,15 @@ function diffToResult(diff) {
718
718
  }
719
719
 
720
720
  function useDeepMemo(memoFn, deps) {
721
- var ref = React.useRef();
721
+ var ref = React__namespace.useRef();
722
722
  if (!ref.current || !equality.equal(ref.current.deps, deps)) {
723
723
  ref.current = { value: memoFn(), deps: deps };
724
724
  }
725
725
  return ref.current.value;
726
726
  }
727
727
 
728
- function useStrictModeSafeCleanupEffect(cleanup) {
729
- var timeout;
730
- React.useEffect(function () {
731
- clearTimeout(timeout);
732
- return function () {
733
- timeout = setTimeout(cleanup);
734
- };
735
- }, []);
736
- }
737
-
738
728
  var useKey = 'use';
739
- var realHook = React__default[useKey];
729
+ var realHook = React__namespace[useKey];
740
730
  var __use = realHook ||
741
731
  function __use(promise) {
742
732
  var statefulPromise = utilities.wrapPromiseWithState(promise);
@@ -750,25 +740,227 @@ var __use = realHook ||
750
740
  }
751
741
  };
752
742
 
753
- function useSuspenseCache(override) {
754
- var context$1 = React.useContext(context.getApolloContext());
755
- var suspenseCache = override || context$1.suspenseCache;
756
- globals.invariant(suspenseCache, 54);
757
- return suspenseCache;
743
+ var QUERY_REFERENCE_SYMBOL = Symbol();
744
+ var OBSERVED_CHANGED_OPTIONS = [
745
+ 'canonizeResults',
746
+ 'context',
747
+ 'errorPolicy',
748
+ 'fetchPolicy',
749
+ 'refetchWritePolicy',
750
+ 'returnPartialData',
751
+ ];
752
+ var InternalQueryReference = (function () {
753
+ function InternalQueryReference(observable, options) {
754
+ var _this = this;
755
+ var _a;
756
+ this.listeners = new Set();
757
+ this.status = 'loading';
758
+ this.references = 0;
759
+ this.listen = this.listen.bind(this);
760
+ this.handleNext = this.handleNext.bind(this);
761
+ this.handleError = this.handleError.bind(this);
762
+ this.initiateFetch = this.initiateFetch.bind(this);
763
+ this.dispose = this.dispose.bind(this);
764
+ this.observable = observable;
765
+ this.result = observable.getCurrentResult(false);
766
+ this.key = options.key;
767
+ if (options.onDispose) {
768
+ this.onDispose = options.onDispose;
769
+ }
770
+ if (core.isNetworkRequestSettled(this.result.networkStatus) ||
771
+ (this.result.data &&
772
+ (!this.result.partial || this.watchQueryOptions.returnPartialData))) {
773
+ this.promise = utilities.createFulfilledPromise(this.result);
774
+ this.status = 'idle';
775
+ }
776
+ else {
777
+ this.promise = new Promise(function (resolve, reject) {
778
+ _this.resolve = resolve;
779
+ _this.reject = reject;
780
+ });
781
+ }
782
+ this.subscription = observable
783
+ .filter(function (_a) {
784
+ var data = _a.data;
785
+ return !equality.equal(data, {});
786
+ })
787
+ .subscribe({
788
+ next: this.handleNext,
789
+ error: this.handleError,
790
+ });
791
+ this.autoDisposeTimeoutId = setTimeout(this.dispose, (_a = options.autoDisposeTimeoutMs) !== null && _a !== void 0 ? _a : 30000);
792
+ }
793
+ Object.defineProperty(InternalQueryReference.prototype, "watchQueryOptions", {
794
+ get: function () {
795
+ return this.observable.options;
796
+ },
797
+ enumerable: false,
798
+ configurable: true
799
+ });
800
+ InternalQueryReference.prototype.retain = function () {
801
+ var _this = this;
802
+ this.references++;
803
+ clearTimeout(this.autoDisposeTimeoutId);
804
+ var disposed = false;
805
+ return function () {
806
+ if (disposed) {
807
+ return;
808
+ }
809
+ disposed = true;
810
+ _this.references--;
811
+ setTimeout(function () {
812
+ if (!_this.references) {
813
+ _this.dispose();
814
+ }
815
+ });
816
+ };
817
+ };
818
+ InternalQueryReference.prototype.didChangeOptions = function (watchQueryOptions) {
819
+ var _this = this;
820
+ return OBSERVED_CHANGED_OPTIONS.some(function (option) {
821
+ return !equality.equal(_this.watchQueryOptions[option], watchQueryOptions[option]);
822
+ });
823
+ };
824
+ InternalQueryReference.prototype.applyOptions = function (watchQueryOptions) {
825
+ var _a = this.watchQueryOptions, currentFetchPolicy = _a.fetchPolicy, currentCanonizeResults = _a.canonizeResults;
826
+ if (currentFetchPolicy === 'standby' &&
827
+ currentFetchPolicy !== watchQueryOptions.fetchPolicy) {
828
+ this.observable.reobserve(watchQueryOptions);
829
+ this.initiateFetch();
830
+ }
831
+ else {
832
+ this.observable.silentSetOptions(watchQueryOptions);
833
+ if (currentCanonizeResults !== watchQueryOptions.canonizeResults) {
834
+ this.result = tslib.__assign(tslib.__assign({}, this.result), this.observable.getCurrentResult());
835
+ this.promise = utilities.createFulfilledPromise(this.result);
836
+ }
837
+ }
838
+ return this.promise;
839
+ };
840
+ InternalQueryReference.prototype.listen = function (listener) {
841
+ var _this = this;
842
+ this.listeners.add(listener);
843
+ return function () {
844
+ _this.listeners.delete(listener);
845
+ };
846
+ };
847
+ InternalQueryReference.prototype.refetch = function (variables) {
848
+ var promise = this.observable.refetch(variables);
849
+ this.initiateFetch();
850
+ return promise;
851
+ };
852
+ InternalQueryReference.prototype.fetchMore = function (options) {
853
+ var promise = this.observable.fetchMore(options);
854
+ this.initiateFetch();
855
+ return promise;
856
+ };
857
+ InternalQueryReference.prototype.dispose = function () {
858
+ this.subscription.unsubscribe();
859
+ this.onDispose();
860
+ };
861
+ InternalQueryReference.prototype.onDispose = function () {
862
+ };
863
+ InternalQueryReference.prototype.handleNext = function (result) {
864
+ var _a;
865
+ switch (this.status) {
866
+ case 'loading': {
867
+ if (result.data === void 0) {
868
+ result.data = this.result.data;
869
+ }
870
+ this.status = 'idle';
871
+ this.result = result;
872
+ (_a = this.resolve) === null || _a === void 0 ? void 0 : _a.call(this, result);
873
+ break;
874
+ }
875
+ case 'idle': {
876
+ if (result.data === this.result.data) {
877
+ return;
878
+ }
879
+ if (result.data === void 0) {
880
+ result.data = this.result.data;
881
+ }
882
+ this.result = result;
883
+ this.promise = utilities.createFulfilledPromise(result);
884
+ this.deliver(this.promise);
885
+ break;
886
+ }
887
+ }
888
+ };
889
+ InternalQueryReference.prototype.handleError = function (error) {
890
+ var _a;
891
+ switch (this.status) {
892
+ case 'loading': {
893
+ this.status = 'idle';
894
+ (_a = this.reject) === null || _a === void 0 ? void 0 : _a.call(this, error);
895
+ break;
896
+ }
897
+ case 'idle': {
898
+ this.promise = utilities.createRejectedPromise(error);
899
+ this.deliver(this.promise);
900
+ }
901
+ }
902
+ };
903
+ InternalQueryReference.prototype.deliver = function (promise) {
904
+ this.listeners.forEach(function (listener) { return listener(promise); });
905
+ };
906
+ InternalQueryReference.prototype.initiateFetch = function () {
907
+ var _this = this;
908
+ this.status = 'loading';
909
+ this.promise = new Promise(function (resolve, reject) {
910
+ _this.resolve = resolve;
911
+ _this.reject = reject;
912
+ });
913
+ this.promise.catch(function () { });
914
+ };
915
+ return InternalQueryReference;
916
+ }());
917
+
918
+ var SuspenseCache = (function () {
919
+ function SuspenseCache(options) {
920
+ if (options === void 0) { options = Object.create(null); }
921
+ this.queryRefs = new trie.Trie(utilities.canUseWeakMap);
922
+ this.options = options;
923
+ }
924
+ SuspenseCache.prototype.getQueryRef = function (cacheKey, createObservable) {
925
+ var ref = this.queryRefs.lookupArray(cacheKey);
926
+ if (!ref.current) {
927
+ ref.current = new InternalQueryReference(createObservable(), {
928
+ key: cacheKey,
929
+ autoDisposeTimeoutMs: this.options.autoDisposeTimeoutMs,
930
+ onDispose: function () {
931
+ delete ref.current;
932
+ },
933
+ });
934
+ }
935
+ return ref.current;
936
+ };
937
+ return SuspenseCache;
938
+ }());
939
+
940
+ var suspenseCacheSymbol = Symbol.for('apollo.suspenseCache');
941
+ function getSuspenseCache(client) {
942
+ var _a;
943
+ if (!client[suspenseCacheSymbol]) {
944
+ client[suspenseCacheSymbol] = new SuspenseCache((_a = client.defaultOptions.react) === null || _a === void 0 ? void 0 : _a.suspense);
945
+ }
946
+ return client[suspenseCacheSymbol];
758
947
  }
759
948
 
760
949
  function useSuspenseQuery(query, options) {
761
950
  if (options === void 0) { options = Object.create(null); }
762
951
  var client = useApolloClient(options.client);
763
- var suspenseCache = useSuspenseCache(options.suspenseCache);
952
+ var suspenseCache = getSuspenseCache(client);
764
953
  var watchQueryOptions = useWatchQueryOptions({ client: client, query: query, options: options });
765
954
  var fetchPolicy = watchQueryOptions.fetchPolicy, variables = watchQueryOptions.variables;
766
955
  var _a = options.queryKey, queryKey = _a === void 0 ? [] : _a;
767
- var cacheKey = [client, query, cache.canonicalStringify(variables)].concat(queryKey);
956
+ var cacheKey = tslib.__spreadArray([
957
+ query,
958
+ cache.canonicalStringify(variables)
959
+ ], [].concat(queryKey), true);
768
960
  var queryRef = suspenseCache.getQueryRef(cacheKey, function () {
769
961
  return client.watchQuery(watchQueryOptions);
770
962
  });
771
- var _b = React.useState(function () { return new Map([[queryRef.key, queryRef.promise]]); }), promiseCache = _b[0], setPromiseCache = _b[1];
963
+ var _b = React__namespace.useState(function () { return new Map([[queryRef.key, queryRef.promise]]); }), promiseCache = _b[0], setPromiseCache = _b[1];
772
964
  var promise = promiseCache.get(queryRef.key);
773
965
  if (queryRef.didChangeOptions(watchQueryOptions)) {
774
966
  promise = queryRef.applyOptions(watchQueryOptions);
@@ -778,15 +970,19 @@ function useSuspenseQuery(query, options) {
778
970
  promise = queryRef.promise;
779
971
  promiseCache.set(queryRef.key, promise);
780
972
  }
781
- useTrackedQueryRefs(queryRef);
782
- React.useEffect(function () {
783
- return queryRef.listen(function (promise) {
973
+ React__namespace.useEffect(function () {
974
+ var dispose = queryRef.retain();
975
+ var removeListener = queryRef.listen(function (promise) {
784
976
  setPromiseCache(function (promiseCache) {
785
977
  return new Map(promiseCache).set(queryRef.key, promise);
786
978
  });
787
979
  });
980
+ return function () {
981
+ removeListener();
982
+ dispose();
983
+ };
788
984
  }, [queryRef]);
789
- var skipResult = React.useMemo(function () {
985
+ var skipResult = React__namespace.useMemo(function () {
790
986
  var error = toApolloError(queryRef.result);
791
987
  return {
792
988
  loading: false,
@@ -796,22 +992,22 @@ function useSuspenseQuery(query, options) {
796
992
  };
797
993
  }, [queryRef.result]);
798
994
  var result = fetchPolicy === 'standby' ? skipResult : __use(promise);
799
- var fetchMore = React.useCallback(function (options) {
995
+ var fetchMore = React__namespace.useCallback(function (options) {
800
996
  var promise = queryRef.fetchMore(options);
801
997
  setPromiseCache(function (previousPromiseCache) {
802
- return new Map(previousPromiseCache).set(queryRef.key, promise);
998
+ return new Map(previousPromiseCache).set(queryRef.key, queryRef.promise);
803
999
  });
804
1000
  return promise;
805
1001
  }, [queryRef]);
806
- var refetch = React.useCallback(function (variables) {
1002
+ var refetch = React__namespace.useCallback(function (variables) {
807
1003
  var promise = queryRef.refetch(variables);
808
1004
  setPromiseCache(function (previousPromiseCache) {
809
- return new Map(previousPromiseCache).set(queryRef.key, promise);
1005
+ return new Map(previousPromiseCache).set(queryRef.key, queryRef.promise);
810
1006
  });
811
1007
  return promise;
812
1008
  }, [queryRef]);
813
- var subscribeToMore = React.useCallback(function (options) { return queryRef.observable.subscribeToMore(options); }, [queryRef]);
814
- return React.useMemo(function () {
1009
+ var subscribeToMore = React__namespace.useCallback(function (options) { return queryRef.observable.subscribeToMore(options); }, [queryRef]);
1010
+ return React__namespace.useMemo(function () {
815
1011
  return {
816
1012
  client: client,
817
1013
  data: result.data,
@@ -837,11 +1033,11 @@ function validateFetchPolicy(fetchPolicy) {
837
1033
  'no-cache',
838
1034
  'cache-and-network',
839
1035
  ];
840
- globals.invariant(supportedFetchPolicies.includes(fetchPolicy), 55, fetchPolicy);
1036
+ globals.invariant(supportedFetchPolicies.includes(fetchPolicy), 54, fetchPolicy);
841
1037
  }
842
1038
  function validatePartialDataReturn(fetchPolicy, returnPartialData) {
843
1039
  if (fetchPolicy === 'no-cache' && returnPartialData) {
844
- globals.__DEV__ && globals.invariant.warn(56);
1040
+ globalThis.__DEV__ !== false && globals.invariant.warn(55);
845
1041
  }
846
1042
  }
847
1043
  function toApolloError(result) {
@@ -849,13 +1045,6 @@ function toApolloError(result) {
849
1045
  ? new core.ApolloError({ graphQLErrors: result.errors })
850
1046
  : result.error;
851
1047
  }
852
- function useTrackedQueryRefs(queryRef) {
853
- var trackedQueryRefs = React.useRef(new Set());
854
- trackedQueryRefs.current.add(queryRef);
855
- useStrictModeSafeCleanupEffect(function () {
856
- trackedQueryRefs.current.forEach(function (sub) { return sub.dispose(); });
857
- });
858
- }
859
1048
  function useWatchQueryOptions(_a) {
860
1049
  var client = _a.client, query = _a.query, options = _a.options;
861
1050
  return useDeepMemo(function () {
@@ -864,7 +1053,7 @@ function useWatchQueryOptions(_a) {
864
1053
  ((_a = client.defaultOptions.watchQuery) === null || _a === void 0 ? void 0 : _a.fetchPolicy) ||
865
1054
  'cache-first';
866
1055
  var watchQueryOptions = tslib.__assign(tslib.__assign({}, options), { fetchPolicy: fetchPolicy, query: query, notifyOnNetworkStatusChange: false, nextFetchPolicy: void 0 });
867
- if (globals.__DEV__) {
1056
+ if (globalThis.__DEV__ !== false) {
868
1057
  validateOptions(watchQueryOptions);
869
1058
  }
870
1059
  if (options.skip) {
@@ -874,183 +1063,42 @@ function useWatchQueryOptions(_a) {
874
1063
  }, [client, options, query]);
875
1064
  }
876
1065
 
877
- var QUERY_REFERENCE_SYMBOL = Symbol();
878
- var OBSERVED_CHANGED_OPTIONS = [
879
- 'canonizeResults',
880
- 'context',
881
- 'errorPolicy',
882
- 'fetchPolicy',
883
- 'refetchWritePolicy',
884
- 'returnPartialData',
885
- ];
886
- ((function () {
887
- function InternalQueryReference(observable, options) {
888
- var _this = this;
889
- var _a;
890
- this.listeners = new Set();
891
- this.initialized = false;
892
- this.refetching = false;
893
- this.listen = this.listen.bind(this);
894
- this.handleNext = this.handleNext.bind(this);
895
- this.handleError = this.handleError.bind(this);
896
- this.dispose = this.dispose.bind(this);
897
- this.observable = observable;
898
- this.result = observable.getCurrentResult(false);
899
- this.key = options.key;
900
- if (options.onDispose) {
901
- this.onDispose = options.onDispose;
902
- }
903
- if (core.isNetworkRequestSettled(this.result.networkStatus) ||
904
- (this.result.data &&
905
- (!this.result.partial || this.observable.options.returnPartialData))) {
906
- this.promise = utilities.createFulfilledPromise(this.result);
907
- this.initialized = true;
908
- this.refetching = false;
909
- }
910
- this.subscription = observable.subscribe({
911
- next: this.handleNext,
912
- error: this.handleError,
913
- });
914
- if (!this.promise) {
915
- this.promise = new Promise(function (resolve, reject) {
916
- _this.resolve = resolve;
917
- _this.reject = reject;
918
- });
919
- }
920
- this.autoDisposeTimeoutId = setTimeout(this.dispose, (_a = options.autoDisposeTimeoutMs) !== null && _a !== void 0 ? _a : 30000);
921
- }
922
- Object.defineProperty(InternalQueryReference.prototype, "watchQueryOptions", {
923
- get: function () {
924
- return this.observable.options;
925
- },
926
- enumerable: false,
927
- configurable: true
928
- });
929
- InternalQueryReference.prototype.didChangeOptions = function (watchQueryOptions) {
930
- var _this = this;
931
- return OBSERVED_CHANGED_OPTIONS.some(function (option) {
932
- return !equality.equal(_this.watchQueryOptions[option], watchQueryOptions[option]);
933
- });
934
- };
935
- InternalQueryReference.prototype.applyOptions = function (watchQueryOptions) {
936
- var currentFetchPolicy = this.watchQueryOptions.fetchPolicy;
937
- if (currentFetchPolicy === 'standby' &&
938
- currentFetchPolicy !== watchQueryOptions.fetchPolicy) {
939
- this.promise = this.observable.reobserve(watchQueryOptions);
940
- }
941
- else {
942
- this.observable.silentSetOptions(watchQueryOptions);
943
- this.result = tslib.__assign(tslib.__assign({}, this.result), this.observable.getCurrentResult());
944
- this.promise = utilities.createFulfilledPromise(this.result);
945
- }
946
- return this.promise;
947
- };
948
- InternalQueryReference.prototype.listen = function (listener) {
949
- var _this = this;
950
- clearTimeout(this.autoDisposeTimeoutId);
951
- this.listeners.add(listener);
952
- return function () {
953
- _this.listeners.delete(listener);
954
- };
955
- };
956
- InternalQueryReference.prototype.refetch = function (variables) {
957
- this.refetching = true;
958
- var promise = this.observable.refetch(variables);
959
- this.promise = promise;
960
- return promise;
961
- };
962
- InternalQueryReference.prototype.fetchMore = function (options) {
963
- var promise = this.observable.fetchMore(options);
964
- this.promise = promise;
965
- return promise;
966
- };
967
- InternalQueryReference.prototype.reobserve = function (watchQueryOptions) {
968
- var promise = this.observable.reobserve(watchQueryOptions);
969
- this.promise = promise;
970
- return promise;
971
- };
972
- InternalQueryReference.prototype.dispose = function () {
973
- this.subscription.unsubscribe();
974
- this.onDispose();
975
- };
976
- InternalQueryReference.prototype.onDispose = function () {
977
- };
978
- InternalQueryReference.prototype.handleNext = function (result) {
979
- if (!this.initialized || this.refetching) {
980
- if (!core.isNetworkRequestSettled(result.networkStatus)) {
981
- return;
982
- }
983
- if (this.result.data && result.data === void 0) {
984
- result.data = this.result.data;
985
- }
986
- this.initialized = true;
987
- this.refetching = false;
988
- this.result = result;
989
- if (this.resolve) {
990
- this.resolve(result);
991
- }
992
- return;
993
- }
994
- if (result.data === this.result.data) {
995
- return;
996
- }
997
- this.result = result;
998
- this.promise = utilities.createFulfilledPromise(result);
999
- this.deliver(this.promise);
1000
- };
1001
- InternalQueryReference.prototype.handleError = function (error) {
1002
- var result = tslib.__assign(tslib.__assign({}, this.result), { error: error, networkStatus: core.NetworkStatus.error });
1003
- this.result = result;
1004
- if (!this.initialized || this.refetching) {
1005
- this.initialized = true;
1006
- this.refetching = false;
1007
- if (this.reject) {
1008
- this.reject(error);
1009
- }
1010
- return;
1011
- }
1012
- this.promise = utilities.createRejectedPromise(error);
1013
- this.deliver(this.promise);
1014
- };
1015
- InternalQueryReference.prototype.deliver = function (promise) {
1016
- this.listeners.forEach(function (listener) { return listener(promise); });
1017
- };
1018
- return InternalQueryReference;
1019
- })());
1020
-
1021
1066
  function useBackgroundQuery(query, options) {
1022
1067
  if (options === void 0) { options = Object.create(null); }
1023
- var suspenseCache = useSuspenseCache(options.suspenseCache);
1024
1068
  var client = useApolloClient(options.client);
1069
+ var suspenseCache = getSuspenseCache(client);
1025
1070
  var watchQueryOptions = useWatchQueryOptions({ client: client, query: query, options: options });
1026
1071
  var variables = watchQueryOptions.variables;
1027
1072
  var _a = options.queryKey, queryKey = _a === void 0 ? [] : _a;
1028
- var cacheKey = [client, query, cache.canonicalStringify(variables)].concat(queryKey);
1073
+ var cacheKey = tslib.__spreadArray([
1074
+ query,
1075
+ cache.canonicalStringify(variables)
1076
+ ], [].concat(queryKey), true);
1029
1077
  var queryRef = suspenseCache.getQueryRef(cacheKey, function () {
1030
1078
  return client.watchQuery(watchQueryOptions);
1031
1079
  });
1032
- var _b = React.useState(function () { return new Map([[queryRef.key, queryRef.promise]]); }), promiseCache = _b[0], setPromiseCache = _b[1];
1080
+ var _b = React__namespace.useState(function () { return new Map([[queryRef.key, queryRef.promise]]); }), promiseCache = _b[0], setPromiseCache = _b[1];
1033
1081
  if (queryRef.didChangeOptions(watchQueryOptions)) {
1034
1082
  var promise = queryRef.applyOptions(watchQueryOptions);
1035
1083
  promiseCache.set(queryRef.key, promise);
1036
1084
  }
1037
- useTrackedQueryRefs(queryRef);
1038
- var fetchMore = React.useCallback(function (options) {
1085
+ React__namespace.useEffect(function () { return queryRef.retain(); }, [queryRef]);
1086
+ var fetchMore = React__namespace.useCallback(function (options) {
1039
1087
  var promise = queryRef.fetchMore(options);
1040
1088
  setPromiseCache(function (promiseCache) {
1041
- return new Map(promiseCache).set(queryRef.key, promise);
1089
+ return new Map(promiseCache).set(queryRef.key, queryRef.promise);
1042
1090
  });
1043
1091
  return promise;
1044
1092
  }, [queryRef]);
1045
- var refetch = React.useCallback(function (variables) {
1093
+ var refetch = React__namespace.useCallback(function (variables) {
1046
1094
  var promise = queryRef.refetch(variables);
1047
1095
  setPromiseCache(function (promiseCache) {
1048
- return new Map(promiseCache).set(queryRef.key, promise);
1096
+ return new Map(promiseCache).set(queryRef.key, queryRef.promise);
1049
1097
  });
1050
1098
  return promise;
1051
1099
  }, [queryRef]);
1052
1100
  queryRef.promiseCache = promiseCache;
1053
- return React.useMemo(function () {
1101
+ return React__namespace.useMemo(function () {
1054
1102
  var _a;
1055
1103
  return [
1056
1104
  (_a = {}, _a[QUERY_REFERENCE_SYMBOL] = queryRef, _a),
@@ -1063,10 +1111,10 @@ function useBackgroundQuery(query, options) {
1063
1111
  }
1064
1112
 
1065
1113
  function useReadQuery(queryRef) {
1066
- var _a = React.useState(0), forceUpdate = _a[1];
1114
+ var _a = React__namespace.useState(0), forceUpdate = _a[1];
1067
1115
  var internalQueryRef = queryRef[QUERY_REFERENCE_SYMBOL];
1068
1116
  invariant__default(internalQueryRef.promiseCache, 49);
1069
- var skipResult = React.useMemo(function () {
1117
+ var skipResult = React__namespace.useMemo(function () {
1070
1118
  var error = toApolloError(internalQueryRef.result);
1071
1119
  return {
1072
1120
  loading: false,
@@ -1080,7 +1128,7 @@ function useReadQuery(queryRef) {
1080
1128
  promise = internalQueryRef.promise;
1081
1129
  internalQueryRef.promiseCache.set(internalQueryRef.key, promise);
1082
1130
  }
1083
- React.useEffect(function () {
1131
+ React__namespace.useEffect(function () {
1084
1132
  return internalQueryRef.listen(function (promise) {
1085
1133
  internalQueryRef.promiseCache.set(internalQueryRef.key, promise);
1086
1134
  forceUpdate(function (prevState) { return prevState + 1; });
@@ -1089,7 +1137,7 @@ function useReadQuery(queryRef) {
1089
1137
  var result = internalQueryRef.watchQueryOptions.fetchPolicy === 'standby'
1090
1138
  ? skipResult
1091
1139
  : __use(promise);
1092
- return React.useMemo(function () {
1140
+ return React__namespace.useMemo(function () {
1093
1141
  return {
1094
1142
  data: result.data,
1095
1143
  networkStatus: result.networkStatus,