@apollo/client 3.8.0-beta.5 → 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 (646) hide show
  1. package/apollo-client.cjs +282 -242
  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 +12 -11
  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 +5 -5
  72. package/core/LocalState.js.map +1 -1
  73. package/core/ObservableQuery.d.ts +11 -10
  74. package/core/ObservableQuery.d.ts.map +1 -1
  75. package/core/ObservableQuery.js +17 -13
  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 +12 -12
  82. package/core/QueryManager.d.ts.map +1 -1
  83. package/core/QueryManager.js +25 -25
  84. package/core/QueryManager.js.map +1 -1
  85. package/core/core.cjs +43 -37
  86. package/core/core.cjs.map +1 -1
  87. package/core/core.cjs.native.js +43 -37
  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 +73 -81
  103. package/dev/dev.cjs.map +1 -1
  104. package/dev/dev.cjs.native.js +73 -81
  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 +71 -78
  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.map +1 -1
  141. package/link/batch-http/batchHttpLink.d.ts +5 -5
  142. package/link/batch-http/batchHttpLink.d.ts.map +1 -1
  143. package/link/batch-http/batchHttpLink.js +5 -5
  144. package/link/batch-http/batchHttpLink.js.map +1 -1
  145. package/link/batch-http/index.d.ts +1 -1
  146. package/link/batch-http/index.d.ts.map +1 -1
  147. package/link/batch-http/index.js +1 -1
  148. package/link/batch-http/index.js.map +1 -1
  149. package/link/context/context.cjs.map +1 -1
  150. package/link/context/index.d.ts +3 -3
  151. package/link/context/index.d.ts.map +1 -1
  152. package/link/context/index.js +2 -2
  153. package/link/context/index.js.map +1 -1
  154. package/link/core/ApolloLink.d.ts +3 -3
  155. package/link/core/ApolloLink.d.ts.map +1 -1
  156. package/link/core/ApolloLink.js +5 -5
  157. package/link/core/ApolloLink.js.map +1 -1
  158. package/link/core/concat.d.ts +1 -1
  159. package/link/core/concat.d.ts.map +1 -1
  160. package/link/core/concat.js +1 -1
  161. package/link/core/concat.js.map +1 -1
  162. package/link/core/core.cjs +2 -2
  163. package/link/core/core.cjs.map +1 -1
  164. package/link/core/core.cjs.native.js +2 -2
  165. package/link/core/empty.d.ts +1 -1
  166. package/link/core/empty.d.ts.map +1 -1
  167. package/link/core/empty.js +1 -1
  168. package/link/core/empty.js.map +1 -1
  169. package/link/core/execute.d.ts +1 -1
  170. package/link/core/execute.d.ts.map +1 -1
  171. package/link/core/execute.js +1 -1
  172. package/link/core/execute.js.map +1 -1
  173. package/link/core/from.d.ts +1 -1
  174. package/link/core/from.d.ts.map +1 -1
  175. package/link/core/from.js +1 -1
  176. package/link/core/from.js.map +1 -1
  177. package/link/core/index.d.ts +8 -8
  178. package/link/core/index.d.ts.map +1 -1
  179. package/link/core/index.js +8 -8
  180. package/link/core/index.js.map +1 -1
  181. package/link/core/split.d.ts +1 -1
  182. package/link/core/split.d.ts.map +1 -1
  183. package/link/core/split.js +1 -1
  184. package/link/core/split.js.map +1 -1
  185. package/link/core/types.d.ts +2 -2
  186. package/link/core/types.d.ts.map +1 -1
  187. package/link/core/types.js.map +1 -1
  188. package/link/error/error.cjs.map +1 -1
  189. package/link/error/index.d.ts +4 -4
  190. package/link/error/index.d.ts.map +1 -1
  191. package/link/error/index.js +2 -2
  192. package/link/error/index.js.map +1 -1
  193. package/link/http/HttpLink.d.ts +3 -3
  194. package/link/http/HttpLink.d.ts.map +1 -1
  195. package/link/http/HttpLink.js +2 -2
  196. package/link/http/HttpLink.js.map +1 -1
  197. package/link/http/checkFetcher.js +2 -2
  198. package/link/http/checkFetcher.js.map +1 -1
  199. package/link/http/createHttpLink.d.ts +2 -2
  200. package/link/http/createHttpLink.d.ts.map +1 -1
  201. package/link/http/createHttpLink.js +14 -14
  202. package/link/http/createHttpLink.js.map +1 -1
  203. package/link/http/http.cjs +4 -4
  204. package/link/http/http.cjs.map +1 -1
  205. package/link/http/http.cjs.native.js +4 -4
  206. package/link/http/index.d.ts +10 -10
  207. package/link/http/index.d.ts.map +1 -1
  208. package/link/http/index.js +10 -10
  209. package/link/http/index.js.map +1 -1
  210. package/link/http/iterators/nodeStream.js.map +1 -1
  211. package/link/http/iterators/promise.js.map +1 -1
  212. package/link/http/iterators/reader.js.map +1 -1
  213. package/link/http/parseAndCheckHttpResponse.d.ts +2 -2
  214. package/link/http/parseAndCheckHttpResponse.d.ts.map +1 -1
  215. package/link/http/parseAndCheckHttpResponse.js +2 -2
  216. package/link/http/parseAndCheckHttpResponse.js.map +1 -1
  217. package/link/http/responseIterator.js.map +1 -1
  218. package/link/http/rewriteURIForGET.d.ts +1 -1
  219. package/link/http/rewriteURIForGET.d.ts.map +1 -1
  220. package/link/http/rewriteURIForGET.js +1 -1
  221. package/link/http/rewriteURIForGET.js.map +1 -1
  222. package/link/http/selectHttpOptionsAndBody.d.ts +2 -2
  223. package/link/http/selectHttpOptionsAndBody.d.ts.map +1 -1
  224. package/link/http/selectHttpOptionsAndBody.js +1 -1
  225. package/link/http/selectHttpOptionsAndBody.js.map +1 -1
  226. package/link/http/selectURI.d.ts +1 -1
  227. package/link/http/selectURI.d.ts.map +1 -1
  228. package/link/http/selectURI.js.map +1 -1
  229. package/link/http/serializeFetchParameter.d.ts +1 -1
  230. package/link/http/serializeFetchParameter.d.ts.map +1 -1
  231. package/link/http/serializeFetchParameter.js +2 -2
  232. package/link/http/serializeFetchParameter.js.map +1 -1
  233. package/link/persisted-queries/index.d.ts +3 -3
  234. package/link/persisted-queries/index.d.ts.map +1 -1
  235. package/link/persisted-queries/index.js +6 -6
  236. package/link/persisted-queries/index.js.map +1 -1
  237. package/link/persisted-queries/persisted-queries.cjs +2 -2
  238. package/link/persisted-queries/persisted-queries.cjs.map +1 -1
  239. package/link/persisted-queries/persisted-queries.cjs.native.js +2 -2
  240. package/link/remove-typename/index.d.ts +1 -1
  241. package/link/remove-typename/index.d.ts.map +1 -1
  242. package/link/remove-typename/index.js +1 -1
  243. package/link/remove-typename/index.js.map +1 -1
  244. package/link/remove-typename/remove-typename.cjs.map +1 -1
  245. package/link/remove-typename/removeTypenameFromVariables.d.ts +1 -1
  246. package/link/remove-typename/removeTypenameFromVariables.d.ts.map +1 -1
  247. package/link/remove-typename/removeTypenameFromVariables.js +2 -2
  248. package/link/remove-typename/removeTypenameFromVariables.js.map +1 -1
  249. package/link/retry/delayFunction.d.ts +1 -1
  250. package/link/retry/delayFunction.d.ts.map +1 -1
  251. package/link/retry/delayFunction.js.map +1 -1
  252. package/link/retry/index.d.ts +1 -1
  253. package/link/retry/index.d.ts.map +1 -1
  254. package/link/retry/index.js +1 -1
  255. package/link/retry/index.js.map +1 -1
  256. package/link/retry/retry.cjs.map +1 -1
  257. package/link/retry/retryFunction.d.ts +1 -1
  258. package/link/retry/retryFunction.d.ts.map +1 -1
  259. package/link/retry/retryFunction.js.map +1 -1
  260. package/link/retry/retryLink.d.ts +5 -5
  261. package/link/retry/retryLink.d.ts.map +1 -1
  262. package/link/retry/retryLink.js +4 -4
  263. package/link/retry/retryLink.js.map +1 -1
  264. package/link/schema/index.d.ts +3 -3
  265. package/link/schema/index.d.ts.map +1 -1
  266. package/link/schema/index.js +2 -2
  267. package/link/schema/index.js.map +1 -1
  268. package/link/schema/schema.cjs.map +1 -1
  269. package/link/subscriptions/index.d.ts +3 -3
  270. package/link/subscriptions/index.d.ts.map +1 -1
  271. package/link/subscriptions/index.js +1 -1
  272. package/link/subscriptions/index.js.map +1 -1
  273. package/link/subscriptions/subscriptions.cjs.map +1 -1
  274. package/link/utils/createOperation.d.ts +1 -1
  275. package/link/utils/createOperation.d.ts.map +1 -1
  276. package/link/utils/createOperation.js.map +1 -1
  277. package/link/utils/fromError.d.ts +1 -1
  278. package/link/utils/fromError.d.ts.map +1 -1
  279. package/link/utils/fromError.js +1 -1
  280. package/link/utils/fromError.js.map +1 -1
  281. package/link/utils/fromPromise.d.ts +1 -1
  282. package/link/utils/fromPromise.d.ts.map +1 -1
  283. package/link/utils/fromPromise.js +1 -1
  284. package/link/utils/fromPromise.js.map +1 -1
  285. package/link/utils/index.d.ts +9 -9
  286. package/link/utils/index.d.ts.map +1 -1
  287. package/link/utils/index.js +9 -9
  288. package/link/utils/index.js.map +1 -1
  289. package/link/utils/toPromise.d.ts +1 -1
  290. package/link/utils/toPromise.d.ts.map +1 -1
  291. package/link/utils/toPromise.js +2 -2
  292. package/link/utils/toPromise.js.map +1 -1
  293. package/link/utils/transformOperation.d.ts +1 -1
  294. package/link/utils/transformOperation.d.ts.map +1 -1
  295. package/link/utils/transformOperation.js +1 -1
  296. package/link/utils/transformOperation.js.map +1 -1
  297. package/link/utils/utils.cjs +2 -2
  298. package/link/utils/utils.cjs.map +1 -1
  299. package/link/utils/utils.cjs.native.js +2 -2
  300. package/link/utils/validateOperation.d.ts +1 -1
  301. package/link/utils/validateOperation.d.ts.map +1 -1
  302. package/link/utils/validateOperation.js +2 -2
  303. package/link/utils/validateOperation.js.map +1 -1
  304. package/link/ws/index.d.ts +3 -3
  305. package/link/ws/index.d.ts.map +1 -1
  306. package/link/ws/index.js +1 -1
  307. package/link/ws/index.js.map +1 -1
  308. package/link/ws/ws.cjs.map +1 -1
  309. package/package.json +18 -14
  310. package/react/cache/QueryReference.d.ts +9 -6
  311. package/react/cache/QueryReference.d.ts.map +1 -1
  312. package/react/cache/QueryReference.js +108 -52
  313. package/react/cache/QueryReference.js.map +1 -1
  314. package/react/cache/SuspenseCache.d.ts +3 -3
  315. package/react/cache/SuspenseCache.d.ts.map +1 -1
  316. package/react/cache/SuspenseCache.js +2 -2
  317. package/react/cache/SuspenseCache.js.map +1 -1
  318. package/react/cache/index.d.ts +1 -1
  319. package/react/cache/index.d.ts.map +1 -1
  320. package/react/cache/index.js +1 -1
  321. package/react/cache/index.js.map +1 -1
  322. package/react/components/Mutation.d.ts +3 -3
  323. package/react/components/Mutation.d.ts.map +1 -1
  324. package/react/components/Mutation.js +1 -1
  325. package/react/components/Mutation.js.map +1 -1
  326. package/react/components/Query.d.ts +2 -2
  327. package/react/components/Query.d.ts.map +1 -1
  328. package/react/components/Query.js +1 -1
  329. package/react/components/Query.js.map +1 -1
  330. package/react/components/Subscription.d.ts +2 -2
  331. package/react/components/Subscription.d.ts.map +1 -1
  332. package/react/components/Subscription.js +1 -1
  333. package/react/components/Subscription.js.map +1 -1
  334. package/react/components/components.cjs.map +1 -1
  335. package/react/components/index.d.ts +4 -4
  336. package/react/components/index.d.ts.map +1 -1
  337. package/react/components/index.js +4 -4
  338. package/react/components/index.js.map +1 -1
  339. package/react/components/types.d.ts +2 -2
  340. package/react/components/types.d.ts.map +1 -1
  341. package/react/components/types.js.map +1 -1
  342. package/react/context/ApolloConsumer.d.ts +1 -1
  343. package/react/context/ApolloConsumer.d.ts.map +1 -1
  344. package/react/context/ApolloConsumer.js +3 -3
  345. package/react/context/ApolloConsumer.js.map +1 -1
  346. package/react/context/ApolloContext.d.ts +4 -5
  347. package/react/context/ApolloContext.d.ts.map +1 -1
  348. package/react/context/ApolloContext.js +12 -5
  349. package/react/context/ApolloContext.js.map +1 -1
  350. package/react/context/ApolloProvider.d.ts +2 -2
  351. package/react/context/ApolloProvider.d.ts.map +1 -1
  352. package/react/context/ApolloProvider.js +3 -3
  353. package/react/context/ApolloProvider.js.map +1 -1
  354. package/react/context/context.cjs +12 -5
  355. package/react/context/context.cjs.map +1 -1
  356. package/react/context/context.cjs.native.js +12 -5
  357. package/react/context/index.d.ts +4 -4
  358. package/react/context/index.d.ts.map +1 -1
  359. package/react/context/index.js +4 -4
  360. package/react/context/index.js.map +1 -1
  361. package/react/hoc/graphql.d.ts +2 -2
  362. package/react/hoc/graphql.d.ts.map +1 -1
  363. package/react/hoc/graphql.js +4 -4
  364. package/react/hoc/graphql.js.map +1 -1
  365. package/react/hoc/hoc-utils.d.ts +2 -2
  366. package/react/hoc/hoc-utils.d.ts.map +1 -1
  367. package/react/hoc/hoc-utils.js +2 -2
  368. package/react/hoc/hoc-utils.js.map +1 -1
  369. package/react/hoc/hoc.cjs +2 -2
  370. package/react/hoc/hoc.cjs.map +1 -1
  371. package/react/hoc/hoc.cjs.native.js +2 -2
  372. package/react/hoc/index.d.ts +7 -7
  373. package/react/hoc/index.d.ts.map +1 -1
  374. package/react/hoc/index.js +7 -7
  375. package/react/hoc/index.js.map +1 -1
  376. package/react/hoc/mutation-hoc.d.ts +3 -3
  377. package/react/hoc/mutation-hoc.d.ts.map +1 -1
  378. package/react/hoc/mutation-hoc.js +3 -3
  379. package/react/hoc/mutation-hoc.js.map +1 -1
  380. package/react/hoc/query-hoc.d.ts +1 -1
  381. package/react/hoc/query-hoc.d.ts.map +1 -1
  382. package/react/hoc/query-hoc.js +3 -3
  383. package/react/hoc/query-hoc.js.map +1 -1
  384. package/react/hoc/subscription-hoc.d.ts +1 -1
  385. package/react/hoc/subscription-hoc.d.ts.map +1 -1
  386. package/react/hoc/subscription-hoc.js +3 -3
  387. package/react/hoc/subscription-hoc.js.map +1 -1
  388. package/react/hoc/types.d.ts +4 -4
  389. package/react/hoc/types.d.ts.map +1 -1
  390. package/react/hoc/types.js.map +1 -1
  391. package/react/hoc/withApollo.d.ts +1 -1
  392. package/react/hoc/withApollo.d.ts.map +1 -1
  393. package/react/hoc/withApollo.js +3 -3
  394. package/react/hoc/withApollo.js.map +1 -1
  395. package/react/hooks/hooks.cjs +179 -140
  396. package/react/hooks/hooks.cjs.map +1 -1
  397. package/react/hooks/hooks.cjs.native.js +179 -140
  398. package/react/hooks/index.d.ts +11 -11
  399. package/react/hooks/index.d.ts.map +1 -1
  400. package/react/hooks/index.js +11 -11
  401. package/react/hooks/index.js.map +1 -1
  402. package/react/hooks/internal/__use.js +2 -2
  403. package/react/hooks/internal/__use.js.map +1 -1
  404. package/react/hooks/internal/index.d.ts +3 -4
  405. package/react/hooks/internal/index.d.ts.map +1 -1
  406. package/react/hooks/internal/index.js +3 -4
  407. package/react/hooks/internal/index.js.map +1 -1
  408. package/react/hooks/internal/useDeepMemo.js +2 -2
  409. package/react/hooks/internal/useDeepMemo.js.map +1 -1
  410. package/react/hooks/internal/useIsomorphicLayoutEffect.d.ts +2 -2
  411. package/react/hooks/internal/useIsomorphicLayoutEffect.d.ts.map +1 -1
  412. package/react/hooks/internal/useIsomorphicLayoutEffect.js +4 -4
  413. package/react/hooks/internal/useIsomorphicLayoutEffect.js.map +1 -1
  414. package/react/hooks/useApolloClient.d.ts +1 -1
  415. package/react/hooks/useApolloClient.d.ts.map +1 -1
  416. package/react/hooks/useApolloClient.js +5 -5
  417. package/react/hooks/useApolloClient.js.map +1 -1
  418. package/react/hooks/useBackgroundQuery.d.ts +5 -5
  419. package/react/hooks/useBackgroundQuery.d.ts.map +1 -1
  420. package/react/hooks/useBackgroundQuery.js +16 -17
  421. package/react/hooks/useBackgroundQuery.js.map +1 -1
  422. package/react/hooks/useFragment.d.ts +4 -4
  423. package/react/hooks/useFragment.d.ts.map +1 -1
  424. package/react/hooks/useFragment.js +2 -2
  425. package/react/hooks/useFragment.js.map +1 -1
  426. package/react/hooks/useLazyQuery.d.ts +2 -2
  427. package/react/hooks/useLazyQuery.d.ts.map +1 -1
  428. package/react/hooks/useLazyQuery.js +9 -9
  429. package/react/hooks/useLazyQuery.js.map +1 -1
  430. package/react/hooks/useMutation.d.ts +2 -2
  431. package/react/hooks/useMutation.d.ts.map +1 -1
  432. package/react/hooks/useMutation.js +10 -10
  433. package/react/hooks/useMutation.js.map +1 -1
  434. package/react/hooks/useQuery.d.ts +4 -4
  435. package/react/hooks/useQuery.d.ts.map +1 -1
  436. package/react/hooks/useQuery.js +17 -17
  437. package/react/hooks/useQuery.js.map +1 -1
  438. package/react/hooks/useReactiveVar.d.ts +1 -1
  439. package/react/hooks/useReactiveVar.d.ts.map +1 -1
  440. package/react/hooks/useReactiveVar.js +3 -3
  441. package/react/hooks/useReactiveVar.js.map +1 -1
  442. package/react/hooks/useReadQuery.d.ts +3 -3
  443. package/react/hooks/useReadQuery.d.ts.map +1 -1
  444. package/react/hooks/useReadQuery.js +6 -6
  445. package/react/hooks/useReadQuery.js.map +1 -1
  446. package/react/hooks/useSubscription.d.ts +2 -2
  447. package/react/hooks/useSubscription.d.ts.map +1 -1
  448. package/react/hooks/useSubscription.js +14 -14
  449. package/react/hooks/useSubscription.js.map +1 -1
  450. package/react/hooks/useSuspenseCache.d.ts +1 -1
  451. package/react/hooks/useSuspenseCache.d.ts.map +1 -1
  452. package/react/hooks/useSuspenseCache.js +5 -5
  453. package/react/hooks/useSuspenseCache.js.map +1 -1
  454. package/react/hooks/useSuspenseQuery.d.ts +4 -6
  455. package/react/hooks/useSuspenseQuery.d.ts.map +1 -1
  456. package/react/hooks/useSuspenseQuery.js +30 -34
  457. package/react/hooks/useSuspenseQuery.js.map +1 -1
  458. package/react/hooks/useSyncExternalStore.js +4 -4
  459. package/react/hooks/useSyncExternalStore.js.map +1 -1
  460. package/react/index.d.ts +6 -6
  461. package/react/index.d.ts.map +1 -1
  462. package/react/index.js +6 -6
  463. package/react/index.js.map +1 -1
  464. package/react/parser/index.js +6 -6
  465. package/react/parser/index.js.map +1 -1
  466. package/react/parser/parser.cjs +5 -5
  467. package/react/parser/parser.cjs.map +1 -1
  468. package/react/parser/parser.cjs.native.js +5 -5
  469. package/react/react.cjs +106 -50
  470. package/react/react.cjs.map +1 -1
  471. package/react/react.cjs.native.js +106 -50
  472. package/react/ssr/RenderPromises.d.ts +2 -2
  473. package/react/ssr/RenderPromises.d.ts.map +1 -1
  474. package/react/ssr/RenderPromises.js.map +1 -1
  475. package/react/ssr/getDataFromTree.js +2 -2
  476. package/react/ssr/getDataFromTree.js.map +1 -1
  477. package/react/ssr/index.d.ts +3 -3
  478. package/react/ssr/index.d.ts.map +1 -1
  479. package/react/ssr/index.js +3 -3
  480. package/react/ssr/index.js.map +1 -1
  481. package/react/ssr/renderToStringWithData.js +1 -1
  482. package/react/ssr/renderToStringWithData.js.map +1 -1
  483. package/react/ssr/ssr.cjs.map +1 -1
  484. package/react/types/types.d.ts +7 -7
  485. package/react/types/types.d.ts.map +1 -1
  486. package/react/types/types.js.map +1 -1
  487. package/testing/core/core.cjs +1 -1
  488. package/testing/core/core.cjs.map +1 -1
  489. package/testing/core/core.cjs.native.js +1 -1
  490. package/testing/core/index.d.ts +7 -7
  491. package/testing/core/index.d.ts.map +1 -1
  492. package/testing/core/index.js +7 -7
  493. package/testing/core/index.js.map +1 -1
  494. package/testing/core/mocking/mockClient.d.ts +2 -2
  495. package/testing/core/mocking/mockClient.d.ts.map +1 -1
  496. package/testing/core/mocking/mockClient.js +3 -3
  497. package/testing/core/mocking/mockClient.js.map +1 -1
  498. package/testing/core/mocking/mockLink.d.ts +3 -3
  499. package/testing/core/mocking/mockLink.d.ts.map +1 -1
  500. package/testing/core/mocking/mockLink.js +4 -4
  501. package/testing/core/mocking/mockLink.js.map +1 -1
  502. package/testing/core/mocking/mockQueryManager.d.ts +3 -3
  503. package/testing/core/mocking/mockQueryManager.d.ts.map +1 -1
  504. package/testing/core/mocking/mockQueryManager.js +3 -3
  505. package/testing/core/mocking/mockQueryManager.js.map +1 -1
  506. package/testing/core/mocking/mockSubscriptionLink.d.ts +3 -3
  507. package/testing/core/mocking/mockSubscriptionLink.d.ts.map +1 -1
  508. package/testing/core/mocking/mockSubscriptionLink.js +2 -2
  509. package/testing/core/mocking/mockSubscriptionLink.js.map +1 -1
  510. package/testing/core/mocking/mockWatchQuery.d.ts +2 -2
  511. package/testing/core/mocking/mockWatchQuery.d.ts.map +1 -1
  512. package/testing/core/mocking/mockWatchQuery.js +1 -1
  513. package/testing/core/mocking/mockWatchQuery.js.map +1 -1
  514. package/testing/core/observableToPromise.d.ts +2 -2
  515. package/testing/core/observableToPromise.d.ts.map +1 -1
  516. package/testing/core/observableToPromise.js.map +1 -1
  517. package/testing/core/subscribeAndCount.d.ts +1 -1
  518. package/testing/core/subscribeAndCount.d.ts.map +1 -1
  519. package/testing/core/subscribeAndCount.js +1 -1
  520. package/testing/core/subscribeAndCount.js.map +1 -1
  521. package/testing/index.d.ts +3 -3
  522. package/testing/index.d.ts.map +1 -1
  523. package/testing/index.js +3 -3
  524. package/testing/index.js.map +1 -1
  525. package/testing/matchers/index.js +2 -2
  526. package/testing/matchers/index.js.map +1 -1
  527. package/testing/matchers/toHaveSuspenseCacheEntryUsing.d.ts +1 -1
  528. package/testing/matchers/toHaveSuspenseCacheEntryUsing.d.ts.map +1 -1
  529. package/testing/matchers/toHaveSuspenseCacheEntryUsing.js +2 -2
  530. package/testing/matchers/toHaveSuspenseCacheEntryUsing.js.map +1 -1
  531. package/testing/matchers/toMatchDocument.d.ts +1 -1
  532. package/testing/matchers/toMatchDocument.d.ts.map +1 -1
  533. package/testing/matchers/toMatchDocument.js +1 -1
  534. package/testing/matchers/toMatchDocument.js.map +1 -1
  535. package/testing/react/MockedProvider.d.ts +7 -7
  536. package/testing/react/MockedProvider.d.ts.map +1 -1
  537. package/testing/react/MockedProvider.js +5 -5
  538. package/testing/react/MockedProvider.js.map +1 -1
  539. package/testing/testing.cjs.map +1 -1
  540. package/utilities/common/canUse.js.map +1 -1
  541. package/utilities/common/compact.d.ts +1 -1
  542. package/utilities/common/compact.d.ts.map +1 -1
  543. package/utilities/common/compact.js.map +1 -1
  544. package/utilities/common/errorHandling.d.ts +1 -1
  545. package/utilities/common/errorHandling.d.ts.map +1 -1
  546. package/utilities/common/errorHandling.js.map +1 -1
  547. package/utilities/common/incrementalResult.d.ts +1 -1
  548. package/utilities/common/incrementalResult.d.ts.map +1 -1
  549. package/utilities/common/incrementalResult.js.map +1 -1
  550. package/utilities/common/maybeDeepFreeze.d.ts.map +1 -1
  551. package/utilities/common/maybeDeepFreeze.js +3 -4
  552. package/utilities/common/maybeDeepFreeze.js.map +1 -1
  553. package/utilities/common/mergeDeep.d.ts +1 -1
  554. package/utilities/common/mergeDeep.d.ts.map +1 -1
  555. package/utilities/common/mergeDeep.js.map +1 -1
  556. package/utilities/common/mergeOptions.d.ts +1 -1
  557. package/utilities/common/mergeOptions.d.ts.map +1 -1
  558. package/utilities/common/mergeOptions.js.map +1 -1
  559. package/utilities/common/omitDeep.d.ts +1 -1
  560. package/utilities/common/omitDeep.d.ts.map +1 -1
  561. package/utilities/common/omitDeep.js +1 -1
  562. package/utilities/common/omitDeep.js.map +1 -1
  563. package/utilities/common/responseIterator.js.map +1 -1
  564. package/utilities/common/stringifyForDisplay.js.map +1 -1
  565. package/utilities/common/stripTypename.d.ts +1 -1
  566. package/utilities/common/stripTypename.d.ts.map +1 -1
  567. package/utilities/common/stripTypename.js +1 -1
  568. package/utilities/common/stripTypename.js.map +1 -1
  569. package/utilities/globals/global.d.ts.map +1 -1
  570. package/utilities/globals/global.js.map +1 -1
  571. package/utilities/globals/globals.cjs +4 -16
  572. package/utilities/globals/globals.cjs.map +1 -1
  573. package/utilities/globals/globals.cjs.native.js +4 -16
  574. package/utilities/globals/index.d.ts +5 -6
  575. package/utilities/globals/index.d.ts.map +1 -1
  576. package/utilities/globals/index.js +2 -5
  577. package/utilities/globals/index.js.map +1 -1
  578. package/utilities/globals/invariantWrappers.d.ts +1 -1
  579. package/utilities/globals/invariantWrappers.d.ts.map +1 -1
  580. package/utilities/globals/invariantWrappers.js +3 -3
  581. package/utilities/globals/invariantWrappers.js.map +1 -1
  582. package/utilities/graphql/DocumentTransform.js +4 -4
  583. package/utilities/graphql/DocumentTransform.js.map +1 -1
  584. package/utilities/graphql/directives.js +5 -5
  585. package/utilities/graphql/directives.js.map +1 -1
  586. package/utilities/graphql/fragments.js +4 -4
  587. package/utilities/graphql/fragments.js.map +1 -1
  588. package/utilities/graphql/getFromAST.js +10 -10
  589. package/utilities/graphql/getFromAST.js.map +1 -1
  590. package/utilities/graphql/operations.d.ts +1 -1
  591. package/utilities/graphql/operations.d.ts.map +1 -1
  592. package/utilities/graphql/operations.js +1 -1
  593. package/utilities/graphql/operations.js.map +1 -1
  594. package/utilities/graphql/print.js +1 -1
  595. package/utilities/graphql/print.js.map +1 -1
  596. package/utilities/graphql/storeUtils.d.ts +1 -1
  597. package/utilities/graphql/storeUtils.d.ts.map +1 -1
  598. package/utilities/graphql/storeUtils.js +4 -4
  599. package/utilities/graphql/storeUtils.js.map +1 -1
  600. package/utilities/graphql/transform.js +7 -7
  601. package/utilities/graphql/transform.js.map +1 -1
  602. package/utilities/index.d.ts +34 -34
  603. package/utilities/index.d.ts.map +1 -1
  604. package/utilities/index.js +32 -32
  605. package/utilities/index.js.map +1 -1
  606. package/utilities/observables/Concast.d.ts +2 -2
  607. package/utilities/observables/Concast.d.ts.map +1 -1
  608. package/utilities/observables/Concast.js.map +1 -1
  609. package/utilities/observables/asyncMap.d.ts +1 -1
  610. package/utilities/observables/asyncMap.d.ts.map +1 -1
  611. package/utilities/observables/asyncMap.js.map +1 -1
  612. package/utilities/observables/iteration.d.ts +1 -1
  613. package/utilities/observables/iteration.d.ts.map +1 -1
  614. package/utilities/observables/iteration.js.map +1 -1
  615. package/utilities/observables/subclassing.d.ts +1 -1
  616. package/utilities/observables/subclassing.d.ts.map +1 -1
  617. package/utilities/observables/subclassing.js.map +1 -1
  618. package/utilities/policies/pagination.d.ts +1 -1
  619. package/utilities/policies/pagination.d.ts.map +1 -1
  620. package/utilities/policies/pagination.js +1 -1
  621. package/utilities/policies/pagination.js.map +1 -1
  622. package/utilities/promises/decoration.d.ts.map +1 -1
  623. package/utilities/promises/decoration.js +1 -0
  624. package/utilities/promises/decoration.js.map +1 -1
  625. package/utilities/types/DeepOmit.d.ts +1 -1
  626. package/utilities/types/DeepOmit.d.ts.map +1 -1
  627. package/utilities/types/DeepOmit.js.map +1 -1
  628. package/utilities/types/DeepPartial.d.ts +1 -1
  629. package/utilities/types/DeepPartial.d.ts.map +1 -1
  630. package/utilities/types/DeepPartial.js.map +1 -1
  631. package/utilities/utilities.cjs +22 -21
  632. package/utilities/utilities.cjs.map +1 -1
  633. package/utilities/utilities.cjs.native.js +22 -21
  634. package/version.js +1 -1
  635. package/react/hooks/internal/useStrictModeSafeCleanupEffect.d.ts +0 -2
  636. package/react/hooks/internal/useStrictModeSafeCleanupEffect.d.ts.map +0 -1
  637. package/react/hooks/internal/useStrictModeSafeCleanupEffect.js +0 -11
  638. package/react/hooks/internal/useStrictModeSafeCleanupEffect.js.map +0 -1
  639. package/utilities/globals/DEV.d.ts +0 -3
  640. package/utilities/globals/DEV.d.ts.map +0 -1
  641. package/utilities/globals/DEV.js +0 -4
  642. package/utilities/globals/DEV.js.map +0 -1
  643. package/utilities/globals/fix-graphql.d.ts +0 -2
  644. package/utilities/globals/fix-graphql.d.ts.map +0 -1
  645. package/utilities/globals/fix-graphql.js +0 -6
  646. 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.5';
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) {
@@ -132,7 +118,7 @@ function shouldInclude(_a, variables) {
132
118
  var evaledValue = false;
133
119
  if (ifArgument.value.kind === 'Variable') {
134
120
  evaledValue = variables && variables[ifArgument.value.name.value];
135
- invariant(evaledValue !== void 0, 66, directive.name.value);
121
+ invariant(evaledValue !== void 0, 65, directive.name.value);
136
122
  }
137
123
  else {
138
124
  evaledValue = ifArgument.value.value;
@@ -168,12 +154,12 @@ function getInclusionDirectives(directives) {
168
154
  return;
169
155
  var directiveArguments = directive.arguments;
170
156
  var directiveName = directive.name.value;
171
- invariant(directiveArguments && directiveArguments.length === 1, 67, directiveName);
157
+ invariant(directiveArguments && directiveArguments.length === 1, 66, directiveName);
172
158
  var ifArgument = directiveArguments[0];
173
- invariant(ifArgument.name && ifArgument.name.value === 'if', 68, directiveName);
159
+ invariant(ifArgument.name && ifArgument.name.value === 'if', 67, directiveName);
174
160
  var ifValue = ifArgument.value;
175
161
  invariant(ifValue &&
176
- (ifValue.kind === 'Variable' || ifValue.kind === 'BooleanValue'), 69, directiveName);
162
+ (ifValue.kind === 'Variable' || ifValue.kind === 'BooleanValue'), 68, directiveName);
177
163
  result.push({ directive: directive, ifArgument: ifArgument });
178
164
  });
179
165
  }
@@ -200,7 +186,7 @@ function getFragmentQueryDocument(document, fragmentName) {
200
186
  document.definitions.forEach(function (definition) {
201
187
  if (definition.kind === 'OperationDefinition') {
202
188
  throw newInvariantError(
203
- 70,
189
+ 69,
204
190
  definition.operation,
205
191
  definition.name ? " named '".concat(definition.name.value, "'") : ''
206
192
  );
@@ -210,7 +196,7 @@ function getFragmentQueryDocument(document, fragmentName) {
210
196
  }
211
197
  });
212
198
  if (typeof actualFragmentName === 'undefined') {
213
- invariant(fragments.length === 1, 71, fragments.length);
199
+ invariant(fragments.length === 1, 70, fragments.length);
214
200
  actualFragmentName = fragments[0].name.value;
215
201
  }
216
202
  var query = tslib.__assign(tslib.__assign({}, document), { definitions: tslib.__spreadArray([
@@ -251,7 +237,7 @@ function getFragmentFromSelection(selection, fragmentMap) {
251
237
  return fragmentMap(fragmentName);
252
238
  }
253
239
  var fragment = fragmentMap && fragmentMap[fragmentName];
254
- invariant(fragment, 72, fragmentName);
240
+ invariant(fragment, 71, fragmentName);
255
241
  return fragment || null;
256
242
  }
257
243
  default:
@@ -329,7 +315,7 @@ function valueToObjectRepresentation(argObj, name, value, variables) {
329
315
  argObj[name.value] = null;
330
316
  }
331
317
  else {
332
- throw newInvariantError(81, name.value, value.kind);
318
+ throw newInvariantError(80, name.value, value.kind);
333
319
  }
334
320
  }
335
321
  function storeKeyNameFromField(field, variables) {
@@ -474,16 +460,16 @@ function isInlineFragment(selection) {
474
460
  }
475
461
 
476
462
  function checkDocument(doc) {
477
- invariant(doc && doc.kind === 'Document', 73);
463
+ invariant(doc && doc.kind === 'Document', 72);
478
464
  var operations = doc.definitions
479
465
  .filter(function (d) { return d.kind !== 'FragmentDefinition'; })
480
466
  .map(function (definition) {
481
467
  if (definition.kind !== 'OperationDefinition') {
482
- throw newInvariantError(74, definition.kind);
468
+ throw newInvariantError(73, definition.kind);
483
469
  }
484
470
  return definition;
485
471
  });
486
- invariant(operations.length <= 1, 75, operations.length);
472
+ invariant(operations.length <= 1, 74, operations.length);
487
473
  return doc;
488
474
  }
489
475
  function getOperationDefinition(doc) {
@@ -506,14 +492,14 @@ function getFragmentDefinitions(doc) {
506
492
  }
507
493
  function getQueryDefinition(doc) {
508
494
  var queryDef = getOperationDefinition(doc);
509
- invariant(queryDef && queryDef.operation === 'query', 76);
495
+ invariant(queryDef && queryDef.operation === 'query', 75);
510
496
  return queryDef;
511
497
  }
512
498
  function getFragmentDefinition(doc) {
513
- invariant(doc.kind === 'Document', 77);
514
- invariant(doc.definitions.length <= 1, 78);
499
+ invariant(doc.kind === 'Document', 76);
500
+ invariant(doc.definitions.length <= 1, 77);
515
501
  var fragmentDef = doc.definitions[0];
516
- invariant(fragmentDef.kind === 'FragmentDefinition', 79);
502
+ invariant(fragmentDef.kind === 'FragmentDefinition', 78);
517
503
  return fragmentDef;
518
504
  }
519
505
  function getMainDefinition(queryDoc) {
@@ -536,7 +522,7 @@ function getMainDefinition(queryDoc) {
536
522
  if (fragmentDefinition) {
537
523
  return fragmentDefinition;
538
524
  }
539
- throw newInvariantError(80);
525
+ throw newInvariantError(79);
540
526
  }
541
527
  function getDefaultValues(definition) {
542
528
  var defaultValues = Object.create(null);
@@ -608,7 +594,7 @@ var DocumentTransform = (function () {
608
594
  return;
609
595
  var cacheKeys = this.getCacheKey(document);
610
596
  if (cacheKeys) {
611
- invariant(Array.isArray(cacheKeys), 65);
597
+ invariant(Array.isArray(cacheKeys), 64);
612
598
  return this.stableCacheKeys.lookupArray(cacheKeys);
613
599
  }
614
600
  };
@@ -701,7 +687,7 @@ function removeDirectivesFromDocument(directives, doc) {
701
687
  return getInUseByFragmentName(ancestor.name.value);
702
688
  }
703
689
  }
704
- __DEV__ && invariant.error(82);
690
+ globalThis.__DEV__ !== false && invariant.error(81);
705
691
  return null;
706
692
  };
707
693
  var operationCount = 0;
@@ -978,6 +964,7 @@ function createFulfilledPromise(value) {
978
964
  }
979
965
  function createRejectedPromise(reason) {
980
966
  var promise = Promise.reject(reason);
967
+ promise.catch(function () { });
981
968
  promise.status = 'rejected';
982
969
  promise.reason = reason;
983
970
  return promise;
@@ -1053,7 +1040,7 @@ function deepFreeze(value) {
1053
1040
  return value;
1054
1041
  }
1055
1042
  function shallowFreeze(obj) {
1056
- if (__DEV__ && !Object.isFrozen(obj)) {
1043
+ if (globalThis.__DEV__ !== false && !Object.isFrozen(obj)) {
1057
1044
  try {
1058
1045
  Object.freeze(obj);
1059
1046
  }
@@ -1066,7 +1053,7 @@ function shallowFreeze(obj) {
1066
1053
  return obj;
1067
1054
  }
1068
1055
  function maybeDeepFreeze(obj) {
1069
- if (__DEV__) {
1056
+ if (globalThis.__DEV__ !== false) {
1070
1057
  deepFreeze(obj);
1071
1058
  }
1072
1059
  return obj;
@@ -1378,7 +1365,7 @@ function toPromise(observable) {
1378
1365
  observable.subscribe({
1379
1366
  next: function (data) {
1380
1367
  if (completed) {
1381
- __DEV__ && invariant.warn(41);
1368
+ globalThis.__DEV__ !== false && invariant.warn(40);
1382
1369
  }
1383
1370
  else {
1384
1371
  completed = true;
@@ -1421,7 +1408,7 @@ function validateOperation(operation) {
1421
1408
  for (var _i = 0, _a = Object.keys(operation); _i < _a.length; _i++) {
1422
1409
  var key = _a[_i];
1423
1410
  if (OPERATION_FIELDS.indexOf(key) < 0) {
1424
- throw newInvariantError(42, key);
1411
+ throw newInvariantError(41, key);
1425
1412
  }
1426
1413
  }
1427
1414
  return operation;
@@ -1528,7 +1515,7 @@ var ApolloLink = (function () {
1528
1515
  ApolloLink.concat = function (first, second) {
1529
1516
  var firstLink = toLink(first);
1530
1517
  if (isTerminating(firstLink)) {
1531
- __DEV__ && invariant.warn(34, firstLink);
1518
+ globalThis.__DEV__ !== false && invariant.warn(33, firstLink);
1532
1519
  return firstLink;
1533
1520
  }
1534
1521
  var nextLink = toLink(second);
@@ -1552,7 +1539,7 @@ var ApolloLink = (function () {
1552
1539
  return ApolloLink.concat(this, next);
1553
1540
  };
1554
1541
  ApolloLink.prototype.request = function (operation, forward) {
1555
- throw newInvariantError(35);
1542
+ throw newInvariantError(34);
1556
1543
  };
1557
1544
  ApolloLink.prototype.onError = function (error, observer) {
1558
1545
  if (observer && observer.error) {
@@ -1927,7 +1914,7 @@ var serializeFetchParameter = function (p, label) {
1927
1914
  serialized = JSON.stringify(p);
1928
1915
  }
1929
1916
  catch (e) {
1930
- var parseError = newInvariantError(38, label, e.message);
1917
+ var parseError = newInvariantError(37, label, e.message);
1931
1918
  parseError.parseError = e;
1932
1919
  throw parseError;
1933
1920
  }
@@ -2010,7 +1997,7 @@ function removeDuplicateHeaders(headers, preserveHeaderCase) {
2010
1997
 
2011
1998
  var checkFetcher = function (fetcher) {
2012
1999
  if (!fetcher && typeof fetch === 'undefined') {
2013
- throw newInvariantError(36);
2000
+ throw newInvariantError(35);
2014
2001
  }
2015
2002
  };
2016
2003
 
@@ -2082,7 +2069,7 @@ var backupFetch = maybe(function () { return fetch; });
2082
2069
  var createHttpLink = function (linkOptions) {
2083
2070
  if (linkOptions === void 0) { linkOptions = {}; }
2084
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"]);
2085
- if (__DEV__) {
2072
+ if (globalThis.__DEV__ !== false) {
2086
2073
  checkFetcher(preferredFetch || backupFetch);
2087
2074
  }
2088
2075
  var linkConfig = {
@@ -2145,7 +2132,7 @@ var createHttpLink = function (linkOptions) {
2145
2132
  options.headers = options.headers || {};
2146
2133
  var acceptHeader = "multipart/mixed;";
2147
2134
  if (isSubscription && hasDefer) {
2148
- __DEV__ && invariant.warn(37);
2135
+ globalThis.__DEV__ !== false && invariant.warn(36);
2149
2136
  }
2150
2137
  if (isSubscription) {
2151
2138
  acceptHeader += 'boundary=graphql;subscriptionSpec=1.0,application/json';
@@ -2897,7 +2884,7 @@ var ObjectCanon = (function () {
2897
2884
  var node = this.pool.lookupArray(array);
2898
2885
  if (!node.array) {
2899
2886
  this.known.add(node.array = array);
2900
- if (__DEV__) {
2887
+ if (globalThis.__DEV__ !== false) {
2901
2888
  Object.freeze(array);
2902
2889
  }
2903
2890
  }
@@ -2922,7 +2909,7 @@ var ObjectCanon = (function () {
2922
2909
  keys.sorted.forEach(function (key, i) {
2923
2910
  obj_1[key] = array_1[firstValueIndex_1 + i];
2924
2911
  });
2925
- if (__DEV__) {
2912
+ if (globalThis.__DEV__ !== false) {
2926
2913
  Object.freeze(obj_1);
2927
2914
  }
2928
2915
  }
@@ -3189,7 +3176,7 @@ var StoreReader = (function () {
3189
3176
  context: context,
3190
3177
  }), i);
3191
3178
  }
3192
- if (__DEV__) {
3179
+ if (globalThis.__DEV__ !== false) {
3193
3180
  assertSelectionSetForIdValue(context.store, field, item);
3194
3181
  }
3195
3182
  return item;
@@ -3634,7 +3621,7 @@ var Policies = (function () {
3634
3621
  if (supertypeSet.has(supertype)) {
3635
3622
  if (!typenameSupertypeSet.has(supertype)) {
3636
3623
  if (checkingFuzzySubtypes) {
3637
- __DEV__ && invariant.warn(4, typename, supertype);
3624
+ globalThis.__DEV__ !== false && invariant.warn(4, typename, supertype);
3638
3625
  }
3639
3626
  typenameSupertypeSet.add(supertype);
3640
3627
  }
@@ -3787,8 +3774,8 @@ function normalizeReadFieldOptions(readFieldArgs, objectOrReference, variables)
3787
3774
  options.from = objectOrReference;
3788
3775
  }
3789
3776
  }
3790
- if (__DEV__ && options.from === void 0) {
3791
- __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)));
3792
3779
  }
3793
3780
  if (void 0 === options.variables) {
3794
3781
  options.variables = variables;
@@ -3871,7 +3858,7 @@ var StoreWriter = (function () {
3871
3858
  }
3872
3859
  storeObject = applied;
3873
3860
  }
3874
- if (__DEV__ && !context.overwrite) {
3861
+ if (globalThis.__DEV__ !== false && !context.overwrite) {
3875
3862
  var fieldsWithSelectionSets_1 = Object.create(null);
3876
3863
  fieldNodeSet.forEach(function (field) {
3877
3864
  if (field.selectionSet) {
@@ -3959,12 +3946,12 @@ var StoreWriter = (function () {
3959
3946
  _a[storeFieldName] = incomingValue,
3960
3947
  _a));
3961
3948
  }
3962
- else if (__DEV__ &&
3949
+ else if (globalThis.__DEV__ !== false &&
3963
3950
  !context.clientOnly &&
3964
3951
  !context.deferred &&
3965
3952
  !addTypenameToDocument.added(field) &&
3966
3953
  !policies.getReadFunction(typename, field.name.value)) {
3967
- __DEV__ && invariant.error(10, resultKeyNameFromField(field), result);
3954
+ globalThis.__DEV__ !== false && invariant.error(10, resultKeyNameFromField(field), result);
3968
3955
  }
3969
3956
  });
3970
3957
  try {
@@ -4013,7 +4000,7 @@ var StoreWriter = (function () {
4013
4000
  StoreWriter.prototype.processFieldValue = function (value, field, context, mergeTree) {
4014
4001
  var _this = this;
4015
4002
  if (!field.selectionSet || value === null) {
4016
- return __DEV__ ? cloneDeep(value) : value;
4003
+ return globalThis.__DEV__ !== false ? cloneDeep(value) : value;
4017
4004
  }
4018
4005
  if (isArray(value)) {
4019
4006
  return value.map(function (item, i) {
@@ -4204,7 +4191,7 @@ function warnAboutDataLoss(existingRef, incomingObj, storeFieldName, store) {
4204
4191
  }
4205
4192
  });
4206
4193
  }
4207
- __DEV__ && invariant.warn(12, fieldName, parentType, childTypenames.length
4194
+ globalThis.__DEV__ !== false && invariant.warn(12, fieldName, parentType, childTypenames.length
4208
4195
  ? "either ensure all objects of type " + childTypenames.join(" and ") + " have an ID or a custom merge function, or "
4209
4196
  : "", typeDotName, existing, incoming);
4210
4197
  }
@@ -4364,7 +4351,7 @@ var InMemoryCache = (function (_super) {
4364
4351
  return this.policies.identify(object)[0];
4365
4352
  }
4366
4353
  catch (e) {
4367
- __DEV__ && invariant.warn(e);
4354
+ globalThis.__DEV__ !== false && invariant.warn(e);
4368
4355
  }
4369
4356
  };
4370
4357
  InMemoryCache.prototype.evict = function (options) {
@@ -4527,10 +4514,11 @@ function isNetworkRequestSettled(networkStatus) {
4527
4514
  function equalByQuery(query, _a, _b, variables) {
4528
4515
  var aData = _a.data, aRest = tslib.__rest(_a, ["data"]);
4529
4516
  var bData = _b.data, bRest = tslib.__rest(_b, ["data"]);
4530
- return equal__default(aRest, bRest) && equalBySelectionSet(getMainDefinition(query).selectionSet, aData, bData, {
4531
- fragmentMap: createFragmentMap(getFragmentDefinitions(query)),
4532
- variables: variables,
4533
- });
4517
+ return (equal__default(aRest, bRest) &&
4518
+ equalBySelectionSet(getMainDefinition(query).selectionSet, aData, bData, {
4519
+ fragmentMap: createFragmentMap(getFragmentDefinitions(query)),
4520
+ variables: variables,
4521
+ }));
4534
4522
  }
4535
4523
  function equalBySelectionSet(selectionSet, aResult, bResult, context) {
4536
4524
  if (aResult === bResult) {
@@ -4582,10 +4570,10 @@ function equalBySelectionSet(selectionSet, aResult, bResult, context) {
4582
4570
  });
4583
4571
  }
4584
4572
  function selectionHasNonreactiveDirective(selection) {
4585
- return !!selection.directives && selection.directives.some(directiveIsNonreactive);
4573
+ return (!!selection.directives && selection.directives.some(directiveIsNonreactive));
4586
4574
  }
4587
4575
  function directiveIsNonreactive(dir) {
4588
- return dir.name.value === "nonreactive";
4576
+ return dir.name.value === 'nonreactive';
4589
4577
  }
4590
4578
 
4591
4579
  var assign = Object.assign, hasOwnProperty$2 = Object.hasOwnProperty;
@@ -4700,7 +4688,7 @@ var ObservableQuery = (function (_super) {
4700
4688
  else {
4701
4689
  result.partial = true;
4702
4690
  }
4703
- if (__DEV__ &&
4691
+ if (globalThis.__DEV__ !== false &&
4704
4692
  !diff.complete &&
4705
4693
  !this.options.partialRefetch &&
4706
4694
  !result.loading &&
@@ -4760,12 +4748,12 @@ var ObservableQuery = (function (_super) {
4760
4748
  else {
4761
4749
  reobserveOptions.fetchPolicy = 'network-only';
4762
4750
  }
4763
- if (__DEV__ && variables && hasOwnProperty$2.call(variables, "variables")) {
4751
+ if (globalThis.__DEV__ !== false && variables && hasOwnProperty$2.call(variables, "variables")) {
4764
4752
  var queryDef = getQueryDefinition(this.query);
4765
4753
  var vars = queryDef.variableDefinitions;
4766
4754
  if (!vars || !vars.some(function (v) { return v.variable.name.value === "variables"; })) {
4767
- __DEV__ && invariant.warn(
4768
- 19,
4755
+ globalThis.__DEV__ !== false && invariant.warn(
4756
+ 18,
4769
4757
  variables,
4770
4758
  ((_a = queryDef.name) === null || _a === void 0 ? void 0 : _a.value) || queryDef
4771
4759
  );
@@ -4856,7 +4844,7 @@ var ObservableQuery = (function (_super) {
4856
4844
  options.onError(err);
4857
4845
  return;
4858
4846
  }
4859
- __DEV__ && invariant.error(20, err);
4847
+ globalThis.__DEV__ !== false && invariant.error(19, err);
4860
4848
  },
4861
4849
  });
4862
4850
  this.subscriptions.add(subscription);
@@ -4869,6 +4857,10 @@ var ObservableQuery = (function (_super) {
4869
4857
  ObservableQuery.prototype.setOptions = function (newOptions) {
4870
4858
  return this.reobserve(newOptions);
4871
4859
  };
4860
+ ObservableQuery.prototype.silentSetOptions = function (newOptions) {
4861
+ var mergedOptions = compact(this.options, newOptions || {});
4862
+ assign(this.options, mergedOptions);
4863
+ };
4872
4864
  ObservableQuery.prototype.setVariables = function (variables) {
4873
4865
  if (equal.equal(this.variables, variables)) {
4874
4866
  return this.observers.size
@@ -4954,7 +4946,7 @@ var ObservableQuery = (function (_super) {
4954
4946
  pollingInfo.interval === pollInterval) {
4955
4947
  return;
4956
4948
  }
4957
- invariant(pollInterval, 21);
4949
+ invariant(pollInterval, 20);
4958
4950
  var info = pollingInfo || (this.pollingInfo = {});
4959
4951
  info.interval = pollInterval;
4960
4952
  var maybeFetch = function () {
@@ -5107,11 +5099,11 @@ function reobserveCacheFirst(obsQuery) {
5107
5099
  return obsQuery.reobserve();
5108
5100
  }
5109
5101
  function defaultSubscriptionObserverErrorCallback(error) {
5110
- __DEV__ && invariant.error(22, error.message, error.stack);
5102
+ globalThis.__DEV__ !== false && invariant.error(21, error.message, error.stack);
5111
5103
  }
5112
5104
  function logMissingFieldErrors(missing) {
5113
- if (__DEV__ && missing) {
5114
- __DEV__ && invariant.debug(23, missing);
5105
+ if (globalThis.__DEV__ !== false && missing) {
5106
+ globalThis.__DEV__ !== false && invariant.debug(22, missing);
5115
5107
  }
5116
5108
  }
5117
5109
  function skipCacheDataFor(fetchPolicy) {
@@ -5293,7 +5285,7 @@ var LocalState = (function () {
5293
5285
  }
5294
5286
  else {
5295
5287
  fragment = fragmentMap[selection.name.value];
5296
- invariant(fragment, 17, selection.name.value);
5288
+ invariant(fragment, 16, selection.name.value);
5297
5289
  }
5298
5290
  if (fragment && fragment.typeCondition) {
5299
5291
  typeCondition = fragment.typeCondition.name.value;
@@ -5406,7 +5398,7 @@ var LocalState = (function () {
5406
5398
  },
5407
5399
  FragmentSpread: function (spread, _, __, ___, ancestors) {
5408
5400
  var fragment = fragmentMap[spread.name.value];
5409
- invariant(fragment, 18, spread.name.value);
5401
+ invariant(fragment, 17, spread.name.value);
5410
5402
  var fragmentSelections = collectByDefinition(fragment);
5411
5403
  if (fragmentSelections.size > 0) {
5412
5404
  ancestors.forEach(function (node) {
@@ -5743,7 +5735,7 @@ var QueryManager = (function () {
5743
5735
  this.queries.forEach(function (_info, queryId) {
5744
5736
  _this.stopQueryNoBroadcast(queryId);
5745
5737
  });
5746
- this.cancelPendingFetches(newInvariantError(24));
5738
+ this.cancelPendingFetches(newInvariantError(23));
5747
5739
  };
5748
5740
  QueryManager.prototype.cancelPendingFetches = function (error) {
5749
5741
  this.fetchCancelFns.forEach(function (cancel) { return cancel(error); });
@@ -5757,9 +5749,9 @@ var QueryManager = (function () {
5757
5749
  return tslib.__generator(this, function (_h) {
5758
5750
  switch (_h.label) {
5759
5751
  case 0:
5760
- invariant(mutation, 25);
5752
+ invariant(mutation, 24);
5761
5753
  invariant(fetchPolicy === 'network-only' ||
5762
- fetchPolicy === 'no-cache', 26);
5754
+ fetchPolicy === 'no-cache', 25);
5763
5755
  mutationId = this.generateMutationId();
5764
5756
  mutation = this.cache.transformForLink(this.transform(mutation));
5765
5757
  hasClientExports = this.getDocumentInfo(mutation).hasClientExports;
@@ -5995,7 +5987,7 @@ var QueryManager = (function () {
5995
5987
  _this.markMutationResult(tslib.__assign(tslib.__assign({}, mutation), { result: { data: data } }), cache);
5996
5988
  }
5997
5989
  catch (error) {
5998
- __DEV__ && invariant.error(error);
5990
+ globalThis.__DEV__ !== false && invariant.error(error);
5999
5991
  }
6000
5992
  }, mutation.mutationId);
6001
5993
  };
@@ -6077,10 +6069,10 @@ var QueryManager = (function () {
6077
6069
  QueryManager.prototype.query = function (options, queryId) {
6078
6070
  var _this = this;
6079
6071
  if (queryId === void 0) { queryId = this.generateQueryId(); }
6080
- invariant(options.query, 27);
6081
- invariant(options.query.kind === 'Document', 28);
6082
- invariant(!options.returnPartialData, 29);
6083
- invariant(!options.pollInterval, 30);
6072
+ invariant(options.query, 26);
6073
+ invariant(options.query.kind === 'Document', 27);
6074
+ invariant(!options.returnPartialData, 28);
6075
+ invariant(!options.pollInterval, 29);
6084
6076
  return this.fetchQuery(queryId, tslib.__assign(tslib.__assign({}, options), { query: this.transform(options.query) })).finally(function () { return _this.stopQuery(queryId); });
6085
6077
  };
6086
6078
  QueryManager.prototype.generateQueryId = function () {
@@ -6105,7 +6097,7 @@ var QueryManager = (function () {
6105
6097
  if (options === void 0) { options = {
6106
6098
  discardWatches: true,
6107
6099
  }; }
6108
- this.cancelPendingFetches(newInvariantError(31));
6100
+ this.cancelPendingFetches(newInvariantError(30));
6109
6101
  this.queries.forEach(function (queryInfo) {
6110
6102
  if (queryInfo.observableQuery) {
6111
6103
  queryInfo.networkStatus = exports.NetworkStatus.loading;
@@ -6178,10 +6170,10 @@ var QueryManager = (function () {
6178
6170
  queries.set(queryId, oq);
6179
6171
  });
6180
6172
  }
6181
- if (__DEV__ && queryNamesAndDocs.size) {
6173
+ if (globalThis.__DEV__ !== false && queryNamesAndDocs.size) {
6182
6174
  queryNamesAndDocs.forEach(function (included, nameOrDoc) {
6183
6175
  if (!included) {
6184
- __DEV__ && invariant.warn(typeof nameOrDoc === "string" ? 32 : 33, nameOrDoc);
6176
+ globalThis.__DEV__ !== false && invariant.warn(typeof nameOrDoc === "string" ? 31 : 32, nameOrDoc);
6185
6177
  }
6186
6178
  });
6187
6179
  }
@@ -6497,7 +6489,7 @@ var QueryManager = (function () {
6497
6489
  var resultsFromCache = function (diff, networkStatus) {
6498
6490
  if (networkStatus === void 0) { networkStatus = queryInfo.networkStatus || exports.NetworkStatus.loading; }
6499
6491
  var data = diff.result;
6500
- if (__DEV__ &&
6492
+ if (globalThis.__DEV__ !== false &&
6501
6493
  !returnPartialData &&
6502
6494
  !equal.equal(data, {})) {
6503
6495
  logMissingFieldErrors(diff.missing);
@@ -6600,7 +6592,7 @@ var ApolloClient = (function () {
6600
6592
  }
6601
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' &&
6602
6594
  !window.__APOLLO_CLIENT__ &&
6603
- __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;
6604
6596
  var link = options.link;
6605
6597
  if (!link) {
6606
6598
  link = uri
@@ -6624,7 +6616,7 @@ var ApolloClient = (function () {
6624
6616
  if (connectToDevTools && typeof window === 'object') {
6625
6617
  window.__APOLLO_CLIENT__ = this;
6626
6618
  }
6627
- if (!hasSuggestedDevtools && connectToDevTools && __DEV__) {
6619
+ if (!hasSuggestedDevtools && connectToDevTools && globalThis.__DEV__ !== false) {
6628
6620
  hasSuggestedDevtools = true;
6629
6621
  if (typeof window !== 'undefined' &&
6630
6622
  window.document &&
@@ -6643,7 +6635,8 @@ var ApolloClient = (function () {
6643
6635
  }
6644
6636
  }
6645
6637
  if (url) {
6646
- __DEV__ && invariant.log(14, url);
6638
+ globalThis.__DEV__ !== false && invariant.log("Download the Apollo DevTools for a better development " +
6639
+ "experience: %s", url);
6647
6640
  }
6648
6641
  }
6649
6642
  }
@@ -6706,7 +6699,7 @@ var ApolloClient = (function () {
6706
6699
  if (this.defaultOptions.query) {
6707
6700
  options = mergeOptions(this.defaultOptions.query, options);
6708
6701
  }
6709
- invariant(options.fetchPolicy !== 'cache-and-network', 15);
6702
+ invariant(options.fetchPolicy !== 'cache-and-network', 14);
6710
6703
  if (this.disableNetworkFetches && options.fetchPolicy === 'network-only') {
6711
6704
  options = tslib.__assign(tslib.__assign({}, options), { fetchPolicy: 'cache-first' });
6712
6705
  }
@@ -6795,7 +6788,7 @@ var ApolloClient = (function () {
6795
6788
  result.queries = queries;
6796
6789
  result.results = results;
6797
6790
  result.catch(function (error) {
6798
- __DEV__ && invariant.debug(16, error);
6791
+ globalThis.__DEV__ !== false && invariant.debug(15, error);
6799
6792
  });
6800
6793
  return result;
6801
6794
  };
@@ -6831,16 +6824,23 @@ var contextKey = canUseSymbol
6831
6824
  ? Symbol.for('__APOLLO_CONTEXT__')
6832
6825
  : '__APOLLO_CONTEXT__';
6833
6826
  function getApolloContext() {
6834
- invariant('createContext' in React__namespace, 44);
6835
- var contextStorage = global$1[contextKey] || (global$1[contextKey] = Object.create(null));
6836
- return contextStorage[React__namespace.version] || (contextStorage[React__namespace.version] = Object.assign(React__namespace.createContext({}), { displayName: 'ApolloContext' }));
6827
+ invariant('createContext' in React__namespace, 43);
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;
6837
6837
  }
6838
6838
  var resetApolloContext = getApolloContext;
6839
6839
 
6840
6840
  var ApolloConsumer = function (props) {
6841
6841
  var ApolloContext = getApolloContext();
6842
6842
  return (React__namespace.createElement(ApolloContext.Consumer, null, function (context) {
6843
- invariant(context && context.client, 43);
6843
+ invariant(context && context.client, 42);
6844
6844
  return props.children(context.client);
6845
6845
  }));
6846
6846
  };
@@ -6852,14 +6852,14 @@ var ApolloProvider = function (_a) {
6852
6852
  var context = React__namespace.useMemo(function () {
6853
6853
  return tslib.__assign(tslib.__assign({}, parentContext), { client: client || parentContext.client, suspenseCache: suspenseCache || parentContext.suspenseCache });
6854
6854
  }, [parentContext, client, suspenseCache]);
6855
- invariant(context.client, 45);
6855
+ invariant(context.client, 44);
6856
6856
  return (React__namespace.createElement(ApolloContext.Provider, { value: context }, children));
6857
6857
  };
6858
6858
 
6859
6859
  function useApolloClient(override) {
6860
- var context = React.useContext(getApolloContext());
6860
+ var context = React__namespace.useContext(getApolloContext());
6861
6861
  var client = override || context.client;
6862
- invariant(!!client, 48);
6862
+ invariant(!!client, 47);
6863
6863
  return client;
6864
6864
  }
6865
6865
 
@@ -6868,11 +6868,11 @@ var uSESKey = "useSyncExternalStore";
6868
6868
  var realHook$1 = React__namespace[uSESKey];
6869
6869
  var useSyncExternalStore = realHook$1 || (function (subscribe, getSnapshot, getServerSnapshot) {
6870
6870
  var value = getSnapshot();
6871
- if (__DEV__ &&
6871
+ if (globalThis.__DEV__ !== false &&
6872
6872
  !didWarnUncachedGetSnapshot &&
6873
6873
  value !== getSnapshot()) {
6874
6874
  didWarnUncachedGetSnapshot = true;
6875
- __DEV__ && invariant.error(58);
6875
+ globalThis.__DEV__ !== false && invariant.error(57);
6876
6876
  }
6877
6877
  var _a = React__namespace.useState({ inst: { value: value, getSnapshot: getSnapshot } }), inst = _a[0].inst, forceUpdate = _a[1];
6878
6878
  if (canUseLayoutEffect) {
@@ -6935,7 +6935,7 @@ function parser(document) {
6935
6935
  if (cached)
6936
6936
  return cached;
6937
6937
  var variables, type, name;
6938
- invariant(!!document && !!document.kind, 59, document);
6938
+ invariant(!!document && !!document.kind, 58, document);
6939
6939
  var fragments = [];
6940
6940
  var queries = [];
6941
6941
  var mutations = [];
@@ -6961,10 +6961,10 @@ function parser(document) {
6961
6961
  }
6962
6962
  }
6963
6963
  invariant(!fragments.length ||
6964
- (queries.length || mutations.length || subscriptions.length), 60);
6964
+ (queries.length || mutations.length || subscriptions.length), 59);
6965
6965
  invariant(
6966
6966
  queries.length + mutations.length + subscriptions.length <= 1,
6967
- 61,
6967
+ 60,
6968
6968
  document,
6969
6969
  queries.length,
6970
6970
  subscriptions.length,
@@ -6978,7 +6978,7 @@ function parser(document) {
6978
6978
  : mutations.length
6979
6979
  ? mutations
6980
6980
  : subscriptions;
6981
- invariant(definitions.length === 1, 62, document, definitions.length);
6981
+ invariant(definitions.length === 1, 61, document, definitions.length);
6982
6982
  var definition = definitions[0];
6983
6983
  variables = definition.variableDefinitions || [];
6984
6984
  if (definition.name && definition.name.kind === 'Name') {
@@ -6997,7 +6997,7 @@ function verifyDocumentType(document, type) {
6997
6997
  var usedOperationName = operationName(operation.type);
6998
6998
  invariant(
6999
6999
  operation.type === type,
7000
- 63,
7000
+ 62,
7001
7001
  requiredOperationName,
7002
7002
  requiredOperationName,
7003
7003
  usedOperationName
@@ -7010,14 +7010,14 @@ function useQuery(query, options) {
7010
7010
  return useInternalState(useApolloClient(options.client), query).useQuery(options);
7011
7011
  }
7012
7012
  function useInternalState(client, query) {
7013
- var stateRef = React.useRef();
7013
+ var stateRef = React__namespace.useRef();
7014
7014
  if (!stateRef.current ||
7015
7015
  client !== stateRef.current.client ||
7016
7016
  query !== stateRef.current.query) {
7017
7017
  stateRef.current = new InternalState(client, query, stateRef.current);
7018
7018
  }
7019
7019
  var state = stateRef.current;
7020
- var _a = React.useState(0); _a[0]; var setTick = _a[1];
7020
+ var _a = React__namespace.useState(0); _a[0]; var setTick = _a[1];
7021
7021
  state.forceUpdate = function () {
7022
7022
  setTick(function (tick) { return tick + 1; });
7023
7023
  };
@@ -7048,7 +7048,7 @@ var InternalState = (function () {
7048
7048
  }
7049
7049
  }
7050
7050
  InternalState.prototype.forceUpdate = function () {
7051
- __DEV__ && invariant.warn(49);
7051
+ globalThis.__DEV__ !== false && invariant.warn(48);
7052
7052
  };
7053
7053
  InternalState.prototype.executeQuery = function (options) {
7054
7054
  var _this = this;
@@ -7078,10 +7078,10 @@ var InternalState = (function () {
7078
7078
  };
7079
7079
  InternalState.prototype.useQuery = function (options) {
7080
7080
  var _this = this;
7081
- this.renderPromises = React.useContext(getApolloContext()).renderPromises;
7081
+ this.renderPromises = React__namespace.useContext(getApolloContext()).renderPromises;
7082
7082
  this.useOptions(options);
7083
7083
  var obsQuery = this.useObservableQuery();
7084
- var result = useSyncExternalStore(React.useCallback(function () {
7084
+ var result = useSyncExternalStore(React__namespace.useCallback(function () {
7085
7085
  if (_this.renderPromises) {
7086
7086
  return function () { };
7087
7087
  }
@@ -7211,7 +7211,7 @@ var InternalState = (function () {
7211
7211
  && this.renderPromises.getSSRObservable(this.watchQueryOptions)
7212
7212
  || this.observable
7213
7213
  || this.client.watchQuery(this.getObsQueryOptions());
7214
- this.obsQueryFields = React.useMemo(function () { return ({
7214
+ this.obsQueryFields = React__namespace.useMemo(function () { return ({
7215
7215
  refetch: obsQuery.refetch.bind(obsQuery),
7216
7216
  reobserve: obsQuery.reobserve.bind(obsQuery),
7217
7217
  fetchMore: obsQuery.fetchMore.bind(obsQuery),
@@ -7253,7 +7253,7 @@ var InternalState = (function () {
7253
7253
  _this.onCompleted(result.data);
7254
7254
  }
7255
7255
  }).catch(function (error) {
7256
- __DEV__ && invariant.warn(error);
7256
+ globalThis.__DEV__ !== false && invariant.warn(error);
7257
7257
  });
7258
7258
  }
7259
7259
  };
@@ -7305,9 +7305,9 @@ var EAGER_METHODS = [
7305
7305
  ];
7306
7306
  function useLazyQuery(query, options) {
7307
7307
  var _a;
7308
- var execOptionsRef = React.useRef();
7309
- var optionsRef = React.useRef();
7310
- var queryRef = React.useRef();
7308
+ var execOptionsRef = React__namespace.useRef();
7309
+ var optionsRef = React__namespace.useRef();
7310
+ var queryRef = React__namespace.useRef();
7311
7311
  var merged = mergeOptions(options, execOptionsRef.current || {});
7312
7312
  var document = (_a = merged === null || merged === void 0 ? void 0 : merged.query) !== null && _a !== void 0 ? _a : query;
7313
7313
  optionsRef.current = merged;
@@ -7319,7 +7319,7 @@ function useLazyQuery(query, options) {
7319
7319
  var result = Object.assign(useQueryResult, {
7320
7320
  called: !!execOptionsRef.current,
7321
7321
  });
7322
- var eagerMethods = React.useMemo(function () {
7322
+ var eagerMethods = React__namespace.useMemo(function () {
7323
7323
  var eagerMethods = {};
7324
7324
  var _loop_1 = function (key) {
7325
7325
  var method = result[key];
@@ -7338,7 +7338,7 @@ function useLazyQuery(query, options) {
7338
7338
  return eagerMethods;
7339
7339
  }, []);
7340
7340
  Object.assign(result, eagerMethods);
7341
- var execute = React.useCallback(function (executeOptions) {
7341
+ var execute = React__namespace.useCallback(function (executeOptions) {
7342
7342
  execOptionsRef.current = executeOptions ? tslib.__assign(tslib.__assign({}, executeOptions), { fetchPolicy: executeOptions.fetchPolicy || initialFetchPolicy }) : {
7343
7343
  fetchPolicy: initialFetchPolicy,
7344
7344
  };
@@ -7355,12 +7355,12 @@ function useLazyQuery(query, options) {
7355
7355
  function useMutation(mutation, options) {
7356
7356
  var client = useApolloClient(options === null || options === void 0 ? void 0 : options.client);
7357
7357
  verifyDocumentType(mutation, exports.DocumentType.Mutation);
7358
- var _a = React.useState({
7358
+ var _a = React__namespace.useState({
7359
7359
  called: false,
7360
7360
  loading: false,
7361
7361
  client: client,
7362
7362
  }), result = _a[0], setResult = _a[1];
7363
- var ref = React.useRef({
7363
+ var ref = React__namespace.useRef({
7364
7364
  result: result,
7365
7365
  mutationId: 0,
7366
7366
  isMounted: true,
@@ -7371,7 +7371,7 @@ function useMutation(mutation, options) {
7371
7371
  {
7372
7372
  Object.assign(ref.current, { client: client, options: options, mutation: mutation });
7373
7373
  }
7374
- var execute = React.useCallback(function (executeOptions) {
7374
+ var execute = React__namespace.useCallback(function (executeOptions) {
7375
7375
  if (executeOptions === void 0) { executeOptions = {}; }
7376
7376
  var _a = ref.current, options = _a.options, mutation = _a.mutation;
7377
7377
  var baseOptions = tslib.__assign(tslib.__assign({}, options), { mutation: mutation });
@@ -7432,12 +7432,12 @@ function useMutation(mutation, options) {
7432
7432
  throw error;
7433
7433
  });
7434
7434
  }, []);
7435
- var reset = React.useCallback(function () {
7435
+ var reset = React__namespace.useCallback(function () {
7436
7436
  if (ref.current.isMounted) {
7437
7437
  setResult({ called: false, loading: false, client: client });
7438
7438
  }
7439
7439
  }, []);
7440
- React.useEffect(function () {
7440
+ React__namespace.useEffect(function () {
7441
7441
  ref.current.isMounted = true;
7442
7442
  return function () {
7443
7443
  ref.current.isMounted = false;
@@ -7447,10 +7447,10 @@ function useMutation(mutation, options) {
7447
7447
  }
7448
7448
 
7449
7449
  function useSubscription(subscription, options) {
7450
- var hasIssuedDeprecationWarningRef = React.useRef(false);
7450
+ var hasIssuedDeprecationWarningRef = React__namespace.useRef(false);
7451
7451
  var client = useApolloClient(options === null || options === void 0 ? void 0 : options.client);
7452
7452
  verifyDocumentType(subscription, exports.DocumentType.Subscription);
7453
- var _a = React.useState({
7453
+ var _a = React__namespace.useState({
7454
7454
  loading: !(options === null || options === void 0 ? void 0 : options.skip),
7455
7455
  error: void 0,
7456
7456
  data: void 0,
@@ -7459,13 +7459,13 @@ function useSubscription(subscription, options) {
7459
7459
  if (!hasIssuedDeprecationWarningRef.current) {
7460
7460
  hasIssuedDeprecationWarningRef.current = true;
7461
7461
  if (options === null || options === void 0 ? void 0 : options.onSubscriptionData) {
7462
- __DEV__ && invariant.warn(options.onData ? 51 : 52);
7462
+ globalThis.__DEV__ !== false && invariant.warn(options.onData ? 50 : 51);
7463
7463
  }
7464
7464
  if (options === null || options === void 0 ? void 0 : options.onSubscriptionComplete) {
7465
- __DEV__ && invariant.warn(options.onComplete ? 53 : 54);
7465
+ globalThis.__DEV__ !== false && invariant.warn(options.onComplete ? 52 : 53);
7466
7466
  }
7467
7467
  }
7468
- var _b = React.useState(function () {
7468
+ var _b = React__namespace.useState(function () {
7469
7469
  if (options === null || options === void 0 ? void 0 : options.skip) {
7470
7470
  return null;
7471
7471
  }
@@ -7476,14 +7476,14 @@ function useSubscription(subscription, options) {
7476
7476
  context: options === null || options === void 0 ? void 0 : options.context,
7477
7477
  });
7478
7478
  }), observable = _b[0], setObservable = _b[1];
7479
- var canResetObservableRef = React.useRef(false);
7480
- React.useEffect(function () {
7479
+ var canResetObservableRef = React__namespace.useRef(false);
7480
+ React__namespace.useEffect(function () {
7481
7481
  return function () {
7482
7482
  canResetObservableRef.current = true;
7483
7483
  };
7484
7484
  }, []);
7485
- var ref = React.useRef({ client: client, subscription: subscription, options: options });
7486
- React.useEffect(function () {
7485
+ var ref = React__namespace.useRef({ client: client, subscription: subscription, options: options });
7486
+ React__namespace.useEffect(function () {
7487
7487
  var _a, _b, _c, _d;
7488
7488
  var shouldResubscribe = options === null || options === void 0 ? void 0 : options.shouldResubscribe;
7489
7489
  if (typeof shouldResubscribe === 'function') {
@@ -7524,7 +7524,7 @@ function useSubscription(subscription, options) {
7524
7524
  }
7525
7525
  Object.assign(ref.current, { client: client, subscription: subscription, options: options });
7526
7526
  }, [client, subscription, options, canResetObservableRef.current]);
7527
- React.useEffect(function () {
7527
+ React__namespace.useEffect(function () {
7528
7528
  if (!observable) {
7529
7529
  return;
7530
7530
  }
@@ -7591,8 +7591,8 @@ function useSubscription(subscription, options) {
7591
7591
 
7592
7592
  function useReactiveVar(rv) {
7593
7593
  var value = rv();
7594
- var setValue = React.useState(value)[1];
7595
- React.useEffect(function () {
7594
+ var setValue = React__namespace.useState(value)[1];
7595
+ React__namespace.useEffect(function () {
7596
7596
  var probablySameValue = rv();
7597
7597
  if (value !== probablySameValue) {
7598
7598
  setValue(probablySameValue);
@@ -7608,7 +7608,7 @@ function useFragment(options) {
7608
7608
  var cache = useApolloClient().cache;
7609
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"]);
7610
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 });
7611
- var resultRef = React.useRef();
7611
+ var resultRef = React__namespace.useRef();
7612
7612
  var latestDiff = cache.diff(diffOptions);
7613
7613
  var getSnapshot = function () {
7614
7614
  var latestDiffToResult = diffToResult(latestDiff);
@@ -7638,25 +7638,15 @@ function diffToResult(diff) {
7638
7638
  }
7639
7639
 
7640
7640
  function useDeepMemo(memoFn, deps) {
7641
- var ref = React.useRef();
7641
+ var ref = React__namespace.useRef();
7642
7642
  if (!ref.current || !equal.equal(ref.current.deps, deps)) {
7643
7643
  ref.current = { value: memoFn(), deps: deps };
7644
7644
  }
7645
7645
  return ref.current.value;
7646
7646
  }
7647
7647
 
7648
- function useStrictModeSafeCleanupEffect(cleanup) {
7649
- var timeout;
7650
- React.useEffect(function () {
7651
- clearTimeout(timeout);
7652
- return function () {
7653
- timeout = setTimeout(cleanup);
7654
- };
7655
- }, []);
7656
- }
7657
-
7658
7648
  var useKey = 'use';
7659
- var realHook = React__default[useKey];
7649
+ var realHook = React__namespace[useKey];
7660
7650
  var __use = realHook ||
7661
7651
  function __use(promise) {
7662
7652
  var statefulPromise = wrapPromiseWithState(promise);
@@ -7671,9 +7661,9 @@ var __use = realHook ||
7671
7661
  };
7672
7662
 
7673
7663
  function useSuspenseCache(override) {
7674
- var context = React.useContext(getApolloContext());
7664
+ var context = React__namespace.useContext(getApolloContext());
7675
7665
  var suspenseCache = override || context.suspenseCache;
7676
- invariant(suspenseCache, 55);
7666
+ invariant(suspenseCache, 54);
7677
7667
  return suspenseCache;
7678
7668
  }
7679
7669
 
@@ -7688,26 +7678,29 @@ function useSuspenseQuery(query, options) {
7688
7678
  var queryRef = suspenseCache.getQueryRef(cacheKey, function () {
7689
7679
  return client.watchQuery(watchQueryOptions);
7690
7680
  });
7691
- var currentFetchPolicy = queryRef.watchQueryOptions.fetchPolicy;
7692
- 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];
7693
7682
  var promise = promiseCache.get(queryRef.key);
7694
- if (currentFetchPolicy === 'standby' && fetchPolicy !== currentFetchPolicy) {
7695
- promise = queryRef.reobserve({ fetchPolicy: fetchPolicy });
7683
+ if (queryRef.didChangeOptions(watchQueryOptions)) {
7684
+ promise = queryRef.applyOptions(watchQueryOptions);
7696
7685
  promiseCache.set(queryRef.key, promise);
7697
7686
  }
7698
7687
  if (!promise) {
7699
7688
  promise = queryRef.promise;
7700
7689
  promiseCache.set(queryRef.key, promise);
7701
7690
  }
7702
- useTrackedQueryRefs(queryRef);
7703
- React.useEffect(function () {
7704
- return queryRef.listen(function (promise) {
7691
+ React__namespace.useEffect(function () {
7692
+ var dispose = queryRef.retain();
7693
+ var removeListener = queryRef.listen(function (promise) {
7705
7694
  setPromiseCache(function (promiseCache) {
7706
7695
  return new Map(promiseCache).set(queryRef.key, promise);
7707
7696
  });
7708
7697
  });
7698
+ return function () {
7699
+ removeListener();
7700
+ dispose();
7701
+ };
7709
7702
  }, [queryRef]);
7710
- var skipResult = React.useMemo(function () {
7703
+ var skipResult = React__namespace.useMemo(function () {
7711
7704
  var error = toApolloError(queryRef.result);
7712
7705
  return {
7713
7706
  loading: false,
@@ -7716,23 +7709,23 @@ function useSuspenseQuery(query, options) {
7716
7709
  error: error,
7717
7710
  };
7718
7711
  }, [queryRef.result]);
7719
- var result = watchQueryOptions.fetchPolicy === 'standby' ? skipResult : __use(promise);
7720
- var fetchMore = React.useCallback(function (options) {
7712
+ var result = fetchPolicy === 'standby' ? skipResult : __use(promise);
7713
+ var fetchMore = React__namespace.useCallback(function (options) {
7721
7714
  var promise = queryRef.fetchMore(options);
7722
7715
  setPromiseCache(function (previousPromiseCache) {
7723
- return new Map(previousPromiseCache).set(queryRef.key, promise);
7716
+ return new Map(previousPromiseCache).set(queryRef.key, queryRef.promise);
7724
7717
  });
7725
7718
  return promise;
7726
7719
  }, [queryRef]);
7727
- var refetch = React.useCallback(function (variables) {
7720
+ var refetch = React__namespace.useCallback(function (variables) {
7728
7721
  var promise = queryRef.refetch(variables);
7729
7722
  setPromiseCache(function (previousPromiseCache) {
7730
- return new Map(previousPromiseCache).set(queryRef.key, promise);
7723
+ return new Map(previousPromiseCache).set(queryRef.key, queryRef.promise);
7731
7724
  });
7732
7725
  return promise;
7733
7726
  }, [queryRef]);
7734
- var subscribeToMore = React.useCallback(function (options) { return queryRef.observable.subscribeToMore(options); }, [queryRef]);
7735
- return React.useMemo(function () {
7727
+ var subscribeToMore = React__namespace.useCallback(function (options) { return queryRef.observable.subscribeToMore(options); }, [queryRef]);
7728
+ return React__namespace.useMemo(function () {
7736
7729
  return {
7737
7730
  client: client,
7738
7731
  data: result.data,
@@ -7758,11 +7751,11 @@ function validateFetchPolicy(fetchPolicy) {
7758
7751
  'no-cache',
7759
7752
  'cache-and-network',
7760
7753
  ];
7761
- invariant(supportedFetchPolicies.includes(fetchPolicy), 56, fetchPolicy);
7754
+ invariant(supportedFetchPolicies.includes(fetchPolicy), 55, fetchPolicy);
7762
7755
  }
7763
7756
  function validatePartialDataReturn(fetchPolicy, returnPartialData) {
7764
7757
  if (fetchPolicy === 'no-cache' && returnPartialData) {
7765
- __DEV__ && invariant.warn(57);
7758
+ globalThis.__DEV__ !== false && invariant.warn(56);
7766
7759
  }
7767
7760
  }
7768
7761
  function toApolloError(result) {
@@ -7770,13 +7763,6 @@ function toApolloError(result) {
7770
7763
  ? new ApolloError({ graphQLErrors: result.errors })
7771
7764
  : result.error;
7772
7765
  }
7773
- function useTrackedQueryRefs(queryRef) {
7774
- var trackedQueryRefs = React.useRef(new Set());
7775
- trackedQueryRefs.current.add(queryRef);
7776
- useStrictModeSafeCleanupEffect(function () {
7777
- trackedQueryRefs.current.forEach(function (sub) { return sub.dispose(); });
7778
- });
7779
- }
7780
7766
  function useWatchQueryOptions(_a) {
7781
7767
  var client = _a.client, query = _a.query, options = _a.options;
7782
7768
  return useDeepMemo(function () {
@@ -7785,7 +7771,7 @@ function useWatchQueryOptions(_a) {
7785
7771
  ((_a = client.defaultOptions.watchQuery) === null || _a === void 0 ? void 0 : _a.fetchPolicy) ||
7786
7772
  'cache-first';
7787
7773
  var watchQueryOptions = tslib.__assign(tslib.__assign({}, options), { fetchPolicy: fetchPolicy, query: query, notifyOnNetworkStatusChange: false, nextFetchPolicy: void 0 });
7788
- if (__DEV__) {
7774
+ if (globalThis.__DEV__ !== false) {
7789
7775
  validateOptions(watchQueryOptions);
7790
7776
  }
7791
7777
  if (options.skip) {
@@ -7796,16 +7782,25 @@ function useWatchQueryOptions(_a) {
7796
7782
  }
7797
7783
 
7798
7784
  var QUERY_REFERENCE_SYMBOL = Symbol();
7785
+ var OBSERVED_CHANGED_OPTIONS = [
7786
+ 'canonizeResults',
7787
+ 'context',
7788
+ 'errorPolicy',
7789
+ 'fetchPolicy',
7790
+ 'refetchWritePolicy',
7791
+ 'returnPartialData',
7792
+ ];
7799
7793
  var InternalQueryReference = (function () {
7800
7794
  function InternalQueryReference(observable, options) {
7801
7795
  var _this = this;
7802
7796
  var _a;
7803
7797
  this.listeners = new Set();
7804
- this.initialized = false;
7805
- this.refetching = false;
7798
+ this.status = 'loading';
7799
+ this.references = 0;
7806
7800
  this.listen = this.listen.bind(this);
7807
7801
  this.handleNext = this.handleNext.bind(this);
7808
7802
  this.handleError = this.handleError.bind(this);
7803
+ this.initiateFetch = this.initiateFetch.bind(this);
7809
7804
  this.dispose = this.dispose.bind(this);
7810
7805
  this.observable = observable;
7811
7806
  this.result = observable.getCurrentResult(false);
@@ -7815,21 +7810,25 @@ var InternalQueryReference = (function () {
7815
7810
  }
7816
7811
  if (isNetworkRequestSettled(this.result.networkStatus) ||
7817
7812
  (this.result.data &&
7818
- (!this.result.partial || this.observable.options.returnPartialData))) {
7813
+ (!this.result.partial || this.watchQueryOptions.returnPartialData))) {
7819
7814
  this.promise = createFulfilledPromise(this.result);
7820
- this.initialized = true;
7821
- this.refetching = false;
7815
+ this.status = 'idle';
7822
7816
  }
7823
- this.subscription = observable.subscribe({
7824
- next: this.handleNext,
7825
- error: this.handleError,
7826
- });
7827
- if (!this.promise) {
7817
+ else {
7828
7818
  this.promise = new Promise(function (resolve, reject) {
7829
7819
  _this.resolve = resolve;
7830
7820
  _this.reject = reject;
7831
7821
  });
7832
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
+ });
7833
7832
  this.autoDisposeTimeoutId = setTimeout(this.dispose, (_a = options.autoDisposeTimeoutMs) !== null && _a !== void 0 ? _a : 30000);
7834
7833
  }
7835
7834
  Object.defineProperty(InternalQueryReference.prototype, "watchQueryOptions", {
@@ -7839,28 +7838,61 @@ var InternalQueryReference = (function () {
7839
7838
  enumerable: false,
7840
7839
  configurable: true
7841
7840
  });
7842
- InternalQueryReference.prototype.listen = function (listener) {
7841
+ InternalQueryReference.prototype.retain = function () {
7843
7842
  var _this = this;
7843
+ this.references++;
7844
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
+ };
7859
+ InternalQueryReference.prototype.didChangeOptions = function (watchQueryOptions) {
7860
+ var _this = this;
7861
+ return OBSERVED_CHANGED_OPTIONS.some(function (option) {
7862
+ return !equal.equal(_this.watchQueryOptions[option], watchQueryOptions[option]);
7863
+ });
7864
+ };
7865
+ InternalQueryReference.prototype.applyOptions = function (watchQueryOptions) {
7866
+ var _a = this.watchQueryOptions, currentFetchPolicy = _a.fetchPolicy, currentCanonizeResults = _a.canonizeResults;
7867
+ if (currentFetchPolicy === 'standby' &&
7868
+ currentFetchPolicy !== watchQueryOptions.fetchPolicy) {
7869
+ this.observable.reobserve(watchQueryOptions);
7870
+ this.initiateFetch();
7871
+ }
7872
+ else {
7873
+ this.observable.silentSetOptions(watchQueryOptions);
7874
+ if (currentCanonizeResults !== watchQueryOptions.canonizeResults) {
7875
+ this.result = tslib.__assign(tslib.__assign({}, this.result), this.observable.getCurrentResult());
7876
+ this.promise = createFulfilledPromise(this.result);
7877
+ }
7878
+ }
7879
+ return this.promise;
7880
+ };
7881
+ InternalQueryReference.prototype.listen = function (listener) {
7882
+ var _this = this;
7845
7883
  this.listeners.add(listener);
7846
7884
  return function () {
7847
7885
  _this.listeners.delete(listener);
7848
7886
  };
7849
7887
  };
7850
7888
  InternalQueryReference.prototype.refetch = function (variables) {
7851
- this.refetching = true;
7852
7889
  var promise = this.observable.refetch(variables);
7853
- this.promise = promise;
7890
+ this.initiateFetch();
7854
7891
  return promise;
7855
7892
  };
7856
7893
  InternalQueryReference.prototype.fetchMore = function (options) {
7857
7894
  var promise = this.observable.fetchMore(options);
7858
- this.promise = promise;
7859
- return promise;
7860
- };
7861
- InternalQueryReference.prototype.reobserve = function (watchQueryOptions) {
7862
- var promise = this.observable.reobserve(watchQueryOptions);
7863
- this.promise = promise;
7895
+ this.initiateFetch();
7864
7896
  return promise;
7865
7897
  };
7866
7898
  InternalQueryReference.prototype.dispose = function () {
@@ -7870,48 +7902,57 @@ var InternalQueryReference = (function () {
7870
7902
  InternalQueryReference.prototype.onDispose = function () {
7871
7903
  };
7872
7904
  InternalQueryReference.prototype.handleNext = function (result) {
7873
- if (!this.initialized || this.refetching) {
7874
- if (!isNetworkRequestSettled(result.networkStatus)) {
7875
- return;
7876
- }
7877
- if (this.result.data && result.data === void 0) {
7878
- 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;
7879
7915
  }
7880
- this.initialized = true;
7881
- this.refetching = false;
7882
- this.result = result;
7883
- if (this.resolve) {
7884
- 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;
7885
7927
  }
7886
- return;
7887
- }
7888
- if (result.data === this.result.data) {
7889
- return;
7890
7928
  }
7891
- this.result = result;
7892
- this.promise = createFulfilledPromise(result);
7893
- this.deliver(this.promise);
7894
7929
  };
7895
7930
  InternalQueryReference.prototype.handleError = function (error) {
7896
- var result = tslib.__assign(tslib.__assign({}, this.result), { error: error, networkStatus: exports.NetworkStatus.error });
7897
- this.result = result;
7898
- if (!this.initialized || this.refetching) {
7899
- this.initialized = true;
7900
- this.refetching = false;
7901
- if (this.reject) {
7902
- 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);
7903
7941
  }
7904
- return;
7905
7942
  }
7906
- this.result = result;
7907
- this.promise = result.data
7908
- ? createFulfilledPromise(result)
7909
- : createRejectedPromise(result);
7910
- this.deliver(this.promise);
7911
7943
  };
7912
7944
  InternalQueryReference.prototype.deliver = function (promise) {
7913
7945
  this.listeners.forEach(function (listener) { return listener(promise); });
7914
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
+ };
7915
7956
  return InternalQueryReference;
7916
7957
  }());
7917
7958
 
@@ -7920,35 +7961,34 @@ function useBackgroundQuery(query, options) {
7920
7961
  var suspenseCache = useSuspenseCache(options.suspenseCache);
7921
7962
  var client = useApolloClient(options.client);
7922
7963
  var watchQueryOptions = useWatchQueryOptions({ client: client, query: query, options: options });
7923
- var fetchPolicy = watchQueryOptions.fetchPolicy, variables = watchQueryOptions.variables;
7964
+ var variables = watchQueryOptions.variables;
7924
7965
  var _a = options.queryKey, queryKey = _a === void 0 ? [] : _a;
7925
7966
  var cacheKey = [client, query, canonicalStringify(variables)].concat(queryKey);
7926
7967
  var queryRef = suspenseCache.getQueryRef(cacheKey, function () {
7927
7968
  return client.watchQuery(watchQueryOptions);
7928
7969
  });
7929
- var currentFetchPolicy = queryRef.watchQueryOptions.fetchPolicy;
7930
- var _b = React.useState(function () { return new Map([[queryRef.key, queryRef.promise]]); }), promiseCache = _b[0], setPromiseCache = _b[1];
7931
- if (currentFetchPolicy === 'standby' && fetchPolicy !== currentFetchPolicy) {
7932
- var promise = queryRef.reobserve({ fetchPolicy: fetchPolicy });
7970
+ var _b = React__namespace.useState(function () { return new Map([[queryRef.key, queryRef.promise]]); }), promiseCache = _b[0], setPromiseCache = _b[1];
7971
+ if (queryRef.didChangeOptions(watchQueryOptions)) {
7972
+ var promise = queryRef.applyOptions(watchQueryOptions);
7933
7973
  promiseCache.set(queryRef.key, promise);
7934
7974
  }
7935
- useTrackedQueryRefs(queryRef);
7936
- var fetchMore = React.useCallback(function (options) {
7975
+ React__namespace.useEffect(function () { return queryRef.retain(); }, [queryRef]);
7976
+ var fetchMore = React__namespace.useCallback(function (options) {
7937
7977
  var promise = queryRef.fetchMore(options);
7938
7978
  setPromiseCache(function (promiseCache) {
7939
- return new Map(promiseCache).set(queryRef.key, promise);
7979
+ return new Map(promiseCache).set(queryRef.key, queryRef.promise);
7940
7980
  });
7941
7981
  return promise;
7942
7982
  }, [queryRef]);
7943
- var refetch = React.useCallback(function (variables) {
7983
+ var refetch = React__namespace.useCallback(function (variables) {
7944
7984
  var promise = queryRef.refetch(variables);
7945
7985
  setPromiseCache(function (promiseCache) {
7946
- return new Map(promiseCache).set(queryRef.key, promise);
7986
+ return new Map(promiseCache).set(queryRef.key, queryRef.promise);
7947
7987
  });
7948
7988
  return promise;
7949
7989
  }, [queryRef]);
7950
7990
  queryRef.promiseCache = promiseCache;
7951
- return React.useMemo(function () {
7991
+ return React__namespace.useMemo(function () {
7952
7992
  var _a;
7953
7993
  return [
7954
7994
  (_a = {}, _a[QUERY_REFERENCE_SYMBOL] = queryRef, _a),
@@ -7961,10 +8001,10 @@ function useBackgroundQuery(query, options) {
7961
8001
  }
7962
8002
 
7963
8003
  function useReadQuery(queryRef) {
7964
- var _a = React.useState(0), forceUpdate = _a[1];
8004
+ var _a = React__namespace.useState(0), forceUpdate = _a[1];
7965
8005
  var internalQueryRef = queryRef[QUERY_REFERENCE_SYMBOL];
7966
- invariant__default(internalQueryRef.promiseCache, 50);
7967
- var skipResult = React.useMemo(function () {
8006
+ invariant__default(internalQueryRef.promiseCache, 49);
8007
+ var skipResult = React__namespace.useMemo(function () {
7968
8008
  var error = toApolloError(internalQueryRef.result);
7969
8009
  return {
7970
8010
  loading: false,
@@ -7978,7 +8018,7 @@ function useReadQuery(queryRef) {
7978
8018
  promise = internalQueryRef.promise;
7979
8019
  internalQueryRef.promiseCache.set(internalQueryRef.key, promise);
7980
8020
  }
7981
- React.useEffect(function () {
8021
+ React__namespace.useEffect(function () {
7982
8022
  return internalQueryRef.listen(function (promise) {
7983
8023
  internalQueryRef.promiseCache.set(internalQueryRef.key, promise);
7984
8024
  forceUpdate(function (prevState) { return prevState + 1; });
@@ -7987,7 +8027,7 @@ function useReadQuery(queryRef) {
7987
8027
  var result = internalQueryRef.watchQueryOptions.fetchPolicy === 'standby'
7988
8028
  ? skipResult
7989
8029
  : __use(promise);
7990
- return React.useMemo(function () {
8030
+ return React__namespace.useMemo(function () {
7991
8031
  return {
7992
8032
  data: result.data,
7993
8033
  networkStatus: result.networkStatus,