@apollo/client 3.8.0 → 3.8.2

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 (443) hide show
  1. package/apollo-client.cjs +715 -587
  2. package/apollo-client.cjs.map +1 -1
  3. package/apollo-client.min.cjs +1 -1
  4. package/cache/cache.cjs +253 -191
  5. package/cache/cache.cjs.map +1 -1
  6. package/cache/cache.cjs.native.js +253 -191
  7. package/cache/core/cache.d.ts +4 -4
  8. package/cache/core/cache.d.ts.map +1 -1
  9. package/cache/core/cache.js +10 -7
  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 +0 -1
  14. package/cache/core/types/Cache.js.map +1 -1
  15. package/cache/core/types/DataProxy.d.ts +6 -6
  16. package/cache/core/types/DataProxy.d.ts.map +1 -1
  17. package/cache/core/types/DataProxy.js.map +1 -1
  18. package/cache/core/types/common.d.ts +3 -3
  19. package/cache/core/types/common.d.ts.map +1 -1
  20. package/cache/core/types/common.js.map +1 -1
  21. package/cache/index.d.ts +20 -20
  22. package/cache/index.d.ts.map +1 -1
  23. package/cache/index.js +13 -13
  24. package/cache/index.js.map +1 -1
  25. package/cache/inmemory/entityStore.d.ts +6 -6
  26. package/cache/inmemory/entityStore.d.ts.map +1 -1
  27. package/cache/inmemory/entityStore.js +38 -30
  28. package/cache/inmemory/entityStore.js.map +1 -1
  29. package/cache/inmemory/fixPolyfills.native.d.ts.map +1 -1
  30. package/cache/inmemory/fixPolyfills.native.js +10 -9
  31. package/cache/inmemory/fixPolyfills.native.js.map +1 -1
  32. package/cache/inmemory/fragmentRegistry.d.ts.map +1 -1
  33. package/cache/inmemory/fragmentRegistry.js +6 -4
  34. package/cache/inmemory/fragmentRegistry.js.map +1 -1
  35. package/cache/inmemory/helpers.d.ts +6 -6
  36. package/cache/inmemory/helpers.d.ts.map +1 -1
  37. package/cache/inmemory/helpers.js +16 -14
  38. package/cache/inmemory/helpers.js.map +1 -1
  39. package/cache/inmemory/inMemoryCache.d.ts +9 -9
  40. package/cache/inmemory/inMemoryCache.d.ts.map +1 -1
  41. package/cache/inmemory/inMemoryCache.js +29 -33
  42. package/cache/inmemory/inMemoryCache.js.map +1 -1
  43. package/cache/inmemory/key-extractor.d.ts.map +1 -1
  44. package/cache/inmemory/key-extractor.js +55 -49
  45. package/cache/inmemory/key-extractor.js.map +1 -1
  46. package/cache/inmemory/object-canon.d.ts.map +1 -1
  47. package/cache/inmemory/object-canon.js +5 -5
  48. package/cache/inmemory/object-canon.js.map +1 -1
  49. package/cache/inmemory/policies.d.ts +6 -6
  50. package/cache/inmemory/policies.d.ts.map +1 -1
  51. package/cache/inmemory/policies.js +74 -45
  52. package/cache/inmemory/policies.js.map +1 -1
  53. package/cache/inmemory/reactiveVars.d.ts +1 -1
  54. package/cache/inmemory/reactiveVars.d.ts.map +1 -1
  55. package/cache/inmemory/reactiveVars.js +5 -5
  56. package/cache/inmemory/reactiveVars.js.map +1 -1
  57. package/cache/inmemory/readFromStore.d.ts +7 -7
  58. package/cache/inmemory/readFromStore.d.ts.map +1 -1
  59. package/cache/inmemory/readFromStore.js +21 -17
  60. package/cache/inmemory/readFromStore.js.map +1 -1
  61. package/cache/inmemory/types.d.ts +7 -7
  62. package/cache/inmemory/types.d.ts.map +1 -1
  63. package/cache/inmemory/types.js +0 -2
  64. package/cache/inmemory/types.js.map +1 -1
  65. package/cache/inmemory/writeToStore.d.ts +7 -7
  66. package/cache/inmemory/writeToStore.d.ts.map +1 -1
  67. package/cache/inmemory/writeToStore.js +40 -30
  68. package/cache/inmemory/writeToStore.js.map +1 -1
  69. package/config/jest/setup.d.ts +2 -2
  70. package/config/jest/setup.js +5 -5
  71. package/config/jest/setup.js.map +1 -1
  72. package/core/ApolloClient.d.ts +11 -11
  73. package/core/ApolloClient.d.ts.map +1 -1
  74. package/core/ApolloClient.js +64 -50
  75. package/core/ApolloClient.js.map +1 -1
  76. package/core/LocalState.d.ts +6 -6
  77. package/core/LocalState.d.ts.map +1 -1
  78. package/core/LocalState.js +17 -16
  79. package/core/LocalState.js.map +1 -1
  80. package/core/ObservableQuery.d.ts +12 -10
  81. package/core/ObservableQuery.d.ts.map +1 -1
  82. package/core/ObservableQuery.js +57 -38
  83. package/core/ObservableQuery.js.map +1 -1
  84. package/core/QueryInfo.d.ts +11 -11
  85. package/core/QueryInfo.d.ts.map +1 -1
  86. package/core/QueryInfo.js +28 -34
  87. package/core/QueryInfo.js.map +1 -1
  88. package/core/QueryManager.d.ts +10 -10
  89. package/core/QueryManager.d.ts.map +1 -1
  90. package/core/QueryManager.js +117 -93
  91. package/core/QueryManager.js.map +1 -1
  92. package/core/core.cjs +255 -199
  93. package/core/core.cjs.map +1 -1
  94. package/core/core.cjs.native.js +255 -199
  95. package/core/networkStatus.js.map +1 -1
  96. package/core/types.d.ts +13 -13
  97. package/core/types.d.ts.map +1 -1
  98. package/core/types.js +0 -1
  99. package/core/types.js.map +1 -1
  100. package/core/watchQueryOptions.d.ts +11 -11
  101. package/core/watchQueryOptions.d.ts.map +1 -1
  102. package/core/watchQueryOptions.js.map +1 -1
  103. package/dev/dev.cjs +44 -40
  104. package/dev/dev.cjs.map +1 -1
  105. package/dev/dev.cjs.native.js +44 -40
  106. package/errors/errors.cjs +7 -5
  107. package/errors/errors.cjs.map +1 -1
  108. package/errors/errors.cjs.native.js +7 -5
  109. package/errors/index.d.ts +4 -4
  110. package/errors/index.d.ts.map +1 -1
  111. package/errors/index.js +9 -7
  112. package/errors/index.js.map +1 -1
  113. package/index.d.ts +2 -2
  114. package/index.js +2 -2
  115. package/index.js.map +1 -1
  116. package/invariantErrorCodes.d.ts.map +1 -1
  117. package/invariantErrorCodes.js +36 -36
  118. package/invariantErrorCodes.js.map +1 -1
  119. package/link/batch/batch.cjs +4 -4
  120. package/link/batch/batch.cjs.map +1 -1
  121. package/link/batch/batch.cjs.native.js +4 -4
  122. package/link/batch/batchLink.d.ts +6 -6
  123. package/link/batch/batchLink.d.ts.map +1 -1
  124. package/link/batch/batchLink.js +4 -4
  125. package/link/batch/batchLink.js.map +1 -1
  126. package/link/batch/batching.d.ts +2 -2
  127. package/link/batch/batching.d.ts.map +1 -1
  128. package/link/batch/batching.js +4 -4
  129. package/link/batch/batching.js.map +1 -1
  130. package/link/batch/index.d.ts +1 -1
  131. package/link/batch/index.js +1 -1
  132. package/link/batch/index.js.map +1 -1
  133. package/link/batch-http/batch-http.cjs +13 -11
  134. package/link/batch-http/batch-http.cjs.map +1 -1
  135. package/link/batch-http/batch-http.cjs.native.js +13 -11
  136. package/link/batch-http/batchHttpLink.d.ts +6 -6
  137. package/link/batch-http/batchHttpLink.d.ts.map +1 -1
  138. package/link/batch-http/batchHttpLink.js +17 -15
  139. package/link/batch-http/batchHttpLink.js.map +1 -1
  140. package/link/batch-http/index.d.ts +1 -1
  141. package/link/batch-http/index.js +1 -1
  142. package/link/batch-http/index.js.map +1 -1
  143. package/link/context/context.cjs.map +1 -1
  144. package/link/context/index.d.ts +3 -3
  145. package/link/context/index.js +2 -2
  146. package/link/context/index.js.map +1 -1
  147. package/link/core/ApolloLink.d.ts +3 -3
  148. package/link/core/ApolloLink.js +4 -4
  149. package/link/core/ApolloLink.js.map +1 -1
  150. package/link/core/concat.d.ts +1 -1
  151. package/link/core/concat.js +1 -1
  152. package/link/core/concat.js.map +1 -1
  153. package/link/core/core.cjs +1 -1
  154. package/link/core/core.cjs.map +1 -1
  155. package/link/core/core.cjs.native.js +1 -1
  156. package/link/core/empty.d.ts +1 -1
  157. package/link/core/empty.js +1 -1
  158. package/link/core/empty.js.map +1 -1
  159. package/link/core/execute.d.ts +1 -1
  160. package/link/core/execute.js +1 -1
  161. package/link/core/execute.js.map +1 -1
  162. package/link/core/from.d.ts +1 -1
  163. package/link/core/from.js +1 -1
  164. package/link/core/from.js.map +1 -1
  165. package/link/core/index.d.ts +8 -8
  166. package/link/core/index.js +8 -8
  167. package/link/core/index.js.map +1 -1
  168. package/link/core/split.d.ts +1 -1
  169. package/link/core/split.js +1 -1
  170. package/link/core/split.js.map +1 -1
  171. package/link/core/types.js.map +1 -1
  172. package/link/error/error.cjs.map +1 -1
  173. package/link/error/index.d.ts +5 -5
  174. package/link/error/index.js +2 -2
  175. package/link/error/index.js.map +1 -1
  176. package/link/http/HttpLink.d.ts +3 -3
  177. package/link/http/HttpLink.js +2 -2
  178. package/link/http/HttpLink.js.map +1 -1
  179. package/link/http/checkFetcher.d.ts +1 -1
  180. package/link/http/checkFetcher.d.ts.map +1 -1
  181. package/link/http/checkFetcher.js +2 -2
  182. package/link/http/checkFetcher.js.map +1 -1
  183. package/link/http/createHttpLink.d.ts +2 -2
  184. package/link/http/createHttpLink.d.ts.map +1 -1
  185. package/link/http/createHttpLink.js +27 -26
  186. package/link/http/createHttpLink.js.map +1 -1
  187. package/link/http/createSignalIfSupported.js +1 -1
  188. package/link/http/createSignalIfSupported.js.map +1 -1
  189. package/link/http/http.cjs +64 -41
  190. package/link/http/http.cjs.map +1 -1
  191. package/link/http/http.cjs.native.js +64 -41
  192. package/link/http/index.d.ts +13 -13
  193. package/link/http/index.js +10 -10
  194. package/link/http/index.js.map +1 -1
  195. package/link/http/iterators/nodeStream.d.ts.map +1 -1
  196. package/link/http/iterators/nodeStream.js.map +1 -1
  197. package/link/http/parseAndCheckHttpResponse.d.ts.map +1 -1
  198. package/link/http/parseAndCheckHttpResponse.js +2 -2
  199. package/link/http/parseAndCheckHttpResponse.js.map +1 -1
  200. package/link/http/responseIterator.d.ts.map +1 -1
  201. package/link/http/responseIterator.js +20 -1
  202. package/link/http/responseIterator.js.map +1 -1
  203. package/link/http/rewriteURIForGET.d.ts +1 -1
  204. package/link/http/rewriteURIForGET.js +12 -12
  205. package/link/http/rewriteURIForGET.js.map +1 -1
  206. package/link/http/selectHttpOptionsAndBody.d.ts +5 -5
  207. package/link/http/selectHttpOptionsAndBody.d.ts.map +1 -1
  208. package/link/http/selectHttpOptionsAndBody.js +8 -7
  209. package/link/http/selectHttpOptionsAndBody.js.map +1 -1
  210. package/link/http/selectURI.d.ts +1 -1
  211. package/link/http/selectURI.js +2 -2
  212. package/link/http/selectURI.js.map +1 -1
  213. package/link/http/serializeFetchParameter.d.ts +1 -1
  214. package/link/http/serializeFetchParameter.js +1 -1
  215. package/link/http/serializeFetchParameter.js.map +1 -1
  216. package/link/persisted-queries/index.d.ts +4 -4
  217. package/link/persisted-queries/index.d.ts.map +1 -1
  218. package/link/persisted-queries/index.js +26 -25
  219. package/link/persisted-queries/index.js.map +1 -1
  220. package/link/persisted-queries/persisted-queries.cjs +22 -17
  221. package/link/persisted-queries/persisted-queries.cjs.map +1 -1
  222. package/link/persisted-queries/persisted-queries.cjs.native.js +22 -17
  223. package/link/retry/delayFunction.d.ts +1 -1
  224. package/link/retry/delayFunction.js.map +1 -1
  225. package/link/retry/index.d.ts +1 -1
  226. package/link/retry/index.js +1 -1
  227. package/link/retry/index.js.map +1 -1
  228. package/link/retry/retry.cjs +2 -2
  229. package/link/retry/retry.cjs.map +1 -1
  230. package/link/retry/retry.cjs.native.js +2 -2
  231. package/link/retry/retryFunction.d.ts +1 -1
  232. package/link/retry/retryFunction.js.map +1 -1
  233. package/link/retry/retryLink.d.ts +5 -5
  234. package/link/retry/retryLink.d.ts.map +1 -1
  235. package/link/retry/retryLink.js +6 -6
  236. package/link/retry/retryLink.js.map +1 -1
  237. package/link/schema/index.d.ts +4 -4
  238. package/link/schema/index.d.ts.map +1 -1
  239. package/link/schema/index.js +13 -8
  240. package/link/schema/index.js.map +1 -1
  241. package/link/schema/schema.cjs +10 -5
  242. package/link/schema/schema.cjs.map +1 -1
  243. package/link/schema/schema.cjs.native.js +10 -5
  244. package/link/subscriptions/index.js +1 -1
  245. package/link/subscriptions/index.js.map +1 -1
  246. package/link/subscriptions/subscriptions.cjs.map +1 -1
  247. package/link/utils/createOperation.d.ts +1 -1
  248. package/link/utils/createOperation.js +3 -3
  249. package/link/utils/createOperation.js.map +1 -1
  250. package/link/utils/filterOperationVariables.d.ts +1 -1
  251. package/link/utils/filterOperationVariables.js +2 -2
  252. package/link/utils/filterOperationVariables.js.map +1 -1
  253. package/link/utils/fromError.d.ts +1 -1
  254. package/link/utils/fromError.js +1 -1
  255. package/link/utils/fromError.js.map +1 -1
  256. package/link/utils/fromPromise.d.ts +1 -1
  257. package/link/utils/fromPromise.js +1 -1
  258. package/link/utils/fromPromise.js.map +1 -1
  259. package/link/utils/index.d.ts +10 -10
  260. package/link/utils/index.js +9 -9
  261. package/link/utils/index.js.map +1 -1
  262. package/link/utils/throwServerError.js +1 -1
  263. package/link/utils/throwServerError.js.map +1 -1
  264. package/link/utils/toPromise.d.ts +1 -1
  265. package/link/utils/toPromise.js +1 -1
  266. package/link/utils/toPromise.js.map +1 -1
  267. package/link/utils/transformOperation.d.ts +1 -1
  268. package/link/utils/transformOperation.js +3 -3
  269. package/link/utils/transformOperation.js.map +1 -1
  270. package/link/utils/utils.cjs +12 -12
  271. package/link/utils/utils.cjs.map +1 -1
  272. package/link/utils/utils.cjs.native.js +12 -12
  273. package/link/utils/validateOperation.d.ts +1 -1
  274. package/link/utils/validateOperation.js +6 -6
  275. package/link/utils/validateOperation.js.map +1 -1
  276. package/link/ws/index.d.ts +5 -5
  277. package/link/ws/index.js +2 -2
  278. package/link/ws/index.js.map +1 -1
  279. package/link/ws/ws.cjs.map +1 -1
  280. package/package.json +27 -27
  281. package/react/cache/QueryReference.d.ts +1 -1
  282. package/react/cache/QueryReference.d.ts.map +1 -1
  283. package/react/cache/QueryReference.js +2 -0
  284. package/react/cache/QueryReference.js.map +1 -1
  285. package/react/hooks/constants.js +1 -1
  286. package/react/hooks/constants.js.map +1 -1
  287. package/react/hooks/hooks.cjs +10 -21
  288. package/react/hooks/hooks.cjs.map +1 -1
  289. package/react/hooks/hooks.cjs.native.js +10 -21
  290. package/react/hooks/useBackgroundQuery.d.ts +1 -1
  291. package/react/hooks/useBackgroundQuery.d.ts.map +1 -1
  292. package/react/hooks/useBackgroundQuery.js.map +1 -1
  293. package/react/hooks/useQuery.d.ts.map +1 -1
  294. package/react/hooks/useQuery.js +1 -8
  295. package/react/hooks/useQuery.js.map +1 -1
  296. package/react/hooks/useReactiveVar.d.ts.map +1 -1
  297. package/react/hooks/useReactiveVar.js +7 -12
  298. package/react/hooks/useReactiveVar.js.map +1 -1
  299. package/react/hooks/useReadQuery.d.ts +1 -1
  300. package/react/hooks/useReadQuery.d.ts.map +1 -1
  301. package/react/hooks/useReadQuery.js +1 -1
  302. package/react/hooks/useReadQuery.js.map +1 -1
  303. package/react/hooks/useSuspenseQuery.d.ts +1 -1
  304. package/react/hooks/useSuspenseQuery.d.ts.map +1 -1
  305. package/react/hooks/useSuspenseQuery.js.map +1 -1
  306. package/react/react.cjs +2 -0
  307. package/react/react.cjs.map +1 -1
  308. package/react/react.cjs.native.js +2 -0
  309. package/react/types/types.js.map +1 -1
  310. package/testing/core/core.cjs +37 -28
  311. package/testing/core/core.cjs.map +1 -1
  312. package/testing/core/core.cjs.native.js +37 -28
  313. package/testing/core/itAsync.d.ts.map +1 -1
  314. package/testing/core/itAsync.js +8 -4
  315. package/testing/core/itAsync.js.map +1 -1
  316. package/testing/core/mocking/mockClient.d.ts +3 -3
  317. package/testing/core/mocking/mockClient.d.ts.map +1 -1
  318. package/testing/core/mocking/mockClient.js +6 -4
  319. package/testing/core/mocking/mockClient.js.map +1 -1
  320. package/testing/core/mocking/mockFetch.d.ts +1 -1
  321. package/testing/core/mocking/mockFetch.d.ts.map +1 -1
  322. package/testing/core/mocking/mockFetch.js +3 -3
  323. package/testing/core/mocking/mockFetch.js.map +1 -1
  324. package/testing/core/mocking/mockLink.d.ts +3 -3
  325. package/testing/core/mocking/mockLink.d.ts.map +1 -1
  326. package/testing/core/mocking/mockLink.js +24 -23
  327. package/testing/core/mocking/mockLink.js.map +1 -1
  328. package/testing/core/mocking/mockQueryManager.d.ts +2 -2
  329. package/testing/core/mocking/mockQueryManager.js +3 -3
  330. package/testing/core/mocking/mockQueryManager.js.map +1 -1
  331. package/testing/core/mocking/mockSubscriptionLink.d.ts +3 -3
  332. package/testing/core/mocking/mockSubscriptionLink.js +4 -4
  333. package/testing/core/mocking/mockSubscriptionLink.js.map +1 -1
  334. package/testing/core/mocking/mockWatchQuery.d.ts +2 -2
  335. package/testing/core/mocking/mockWatchQuery.js +2 -2
  336. package/testing/core/mocking/mockWatchQuery.js.map +1 -1
  337. package/testing/core/observableToPromise.d.ts +3 -3
  338. package/testing/core/observableToPromise.d.ts.map +1 -1
  339. package/testing/core/observableToPromise.js +8 -4
  340. package/testing/core/observableToPromise.js.map +1 -1
  341. package/testing/core/subscribeAndCount.d.ts +1 -1
  342. package/testing/core/subscribeAndCount.d.ts.map +1 -1
  343. package/testing/core/subscribeAndCount.js +5 -3
  344. package/testing/core/subscribeAndCount.js.map +1 -1
  345. package/testing/core/wait.js.map +1 -1
  346. package/testing/core/withConsoleSpy.d.ts.map +1 -1
  347. package/testing/core/withConsoleSpy.js.map +1 -1
  348. package/testing/core/wrap.d.ts.map +1 -1
  349. package/testing/core/wrap.js +14 -12
  350. package/testing/core/wrap.js.map +1 -1
  351. package/testing/index.d.ts +4 -4
  352. package/testing/index.js +3 -3
  353. package/testing/index.js.map +1 -1
  354. package/testing/react/MockedProvider.d.ts +7 -7
  355. package/testing/react/MockedProvider.d.ts.map +1 -1
  356. package/testing/react/MockedProvider.js +10 -11
  357. package/testing/react/MockedProvider.js.map +1 -1
  358. package/testing/testing.cjs +3 -5
  359. package/testing/testing.cjs.map +1 -1
  360. package/testing/testing.cjs.native.js +3 -5
  361. package/utilities/common/canUse.d.ts.map +1 -1
  362. package/utilities/common/canUse.js +4 -5
  363. package/utilities/common/canUse.js.map +1 -1
  364. package/utilities/common/cloneDeep.js +2 -2
  365. package/utilities/common/cloneDeep.js.map +1 -1
  366. package/utilities/common/compact.d.ts +1 -1
  367. package/utilities/common/compact.js.map +1 -1
  368. package/utilities/common/filterInPlace.js.map +1 -1
  369. package/utilities/common/maybeDeepFreeze.js +1 -1
  370. package/utilities/common/maybeDeepFreeze.js.map +1 -1
  371. package/utilities/common/mergeDeep.d.ts.map +1 -1
  372. package/utilities/common/mergeDeep.js +3 -1
  373. package/utilities/common/mergeDeep.js.map +1 -1
  374. package/utilities/common/mergeOptions.d.ts.map +1 -1
  375. package/utilities/common/mergeOptions.js.map +1 -1
  376. package/utilities/common/objects.js +2 -2
  377. package/utilities/common/objects.js.map +1 -1
  378. package/utilities/common/stringifyForDisplay.d.ts.map +1 -1
  379. package/utilities/common/stringifyForDisplay.js +3 -1
  380. package/utilities/common/stringifyForDisplay.js.map +1 -1
  381. package/utilities/globals/global.d.ts.map +1 -1
  382. package/utilities/globals/global.js +3 -1
  383. package/utilities/globals/global.js.map +1 -1
  384. package/utilities/globals/globals.cjs +8 -4
  385. package/utilities/globals/globals.cjs.map +1 -1
  386. package/utilities/globals/globals.cjs.native.js +8 -4
  387. package/utilities/globals/index.d.ts.map +1 -1
  388. package/utilities/globals/index.js +1 -1
  389. package/utilities/globals/index.js.map +1 -1
  390. package/utilities/globals/invariantWrappers.js +1 -1
  391. package/utilities/globals/invariantWrappers.js.map +1 -1
  392. package/utilities/globals/maybe.d.ts.map +1 -1
  393. package/utilities/globals/maybe.js.map +1 -1
  394. package/utilities/graphql/directives.d.ts +1 -1
  395. package/utilities/graphql/directives.d.ts.map +1 -1
  396. package/utilities/graphql/directives.js +17 -13
  397. package/utilities/graphql/directives.js.map +1 -1
  398. package/utilities/graphql/fragments.d.ts +1 -1
  399. package/utilities/graphql/fragments.d.ts.map +1 -1
  400. package/utilities/graphql/fragments.js +12 -12
  401. package/utilities/graphql/fragments.js.map +1 -1
  402. package/utilities/graphql/getFromAST.d.ts +1 -1
  403. package/utilities/graphql/getFromAST.js +16 -16
  404. package/utilities/graphql/getFromAST.js.map +1 -1
  405. package/utilities/graphql/storeUtils.d.ts +2 -2
  406. package/utilities/graphql/storeUtils.d.ts.map +1 -1
  407. package/utilities/graphql/storeUtils.js +36 -34
  408. package/utilities/graphql/storeUtils.js.map +1 -1
  409. package/utilities/graphql/transform.d.ts +1 -1
  410. package/utilities/graphql/transform.d.ts.map +1 -1
  411. package/utilities/graphql/transform.js +48 -32
  412. package/utilities/graphql/transform.js.map +1 -1
  413. package/utilities/index.d.ts +0 -1
  414. package/utilities/index.d.ts.map +1 -1
  415. package/utilities/index.js +0 -1
  416. package/utilities/index.js.map +1 -1
  417. package/utilities/observables/Concast.d.ts.map +1 -1
  418. package/utilities/observables/Concast.js +5 -9
  419. package/utilities/observables/Concast.js.map +1 -1
  420. package/utilities/observables/Observable.d.ts +4 -4
  421. package/utilities/observables/Observable.d.ts.map +1 -1
  422. package/utilities/observables/Observable.js +6 -4
  423. package/utilities/observables/Observable.js.map +1 -1
  424. package/utilities/observables/asyncMap.d.ts.map +1 -1
  425. package/utilities/observables/asyncMap.js +5 -2
  426. package/utilities/observables/asyncMap.js.map +1 -1
  427. package/utilities/observables/iteration.js.map +1 -1
  428. package/utilities/policies/pagination.d.ts +1 -1
  429. package/utilities/policies/pagination.d.ts.map +1 -1
  430. package/utilities/policies/pagination.js +9 -7
  431. package/utilities/policies/pagination.js.map +1 -1
  432. package/utilities/types/IsStrictlyAny.d.ts +2 -2
  433. package/utilities/types/IsStrictlyAny.d.ts.map +1 -1
  434. package/utilities/types/IsStrictlyAny.js.map +1 -1
  435. package/utilities/utilities.cjs +147 -147
  436. package/utilities/utilities.cjs.map +1 -1
  437. package/utilities/utilities.cjs.native.js +147 -147
  438. package/version.js +1 -1
  439. package/version.js.map +1 -1
  440. package/utilities/common/responseIterator.d.ts +0 -10
  441. package/utilities/common/responseIterator.d.ts.map +0 -1
  442. package/utilities/common/responseIterator.js +0 -21
  443. package/utilities/common/responseIterator.js.map +0 -1
package/apollo-client.cjs CHANGED
@@ -31,7 +31,7 @@ function _interopNamespace(e) {
31
31
  var equal__default = /*#__PURE__*/_interopDefaultLegacy(equal);
32
32
  var React__namespace = /*#__PURE__*/_interopNamespace(React);
33
33
 
34
- var version = '3.8.0';
34
+ var version = "3.8.2";
35
35
 
36
36
  function maybe(thunk) {
37
37
  try {
@@ -43,7 +43,9 @@ function maybe(thunk) {
43
43
  var global$1 = (maybe(function () { return globalThis; }) ||
44
44
  maybe(function () { return window; }) ||
45
45
  maybe(function () { return self; }) ||
46
- maybe(function () { return global; }) || maybe(function () { return maybe.constructor("return this")(); }));
46
+ maybe(function () { return global; }) || maybe(function () {
47
+ return maybe.constructor("return this")();
48
+ }));
47
49
 
48
50
  var prefixCounts = new Map();
49
51
  function makeUniqueId(prefix) {
@@ -57,7 +59,9 @@ function stringifyForDisplay(value, space) {
57
59
  var undefId = makeUniqueId("stringifyForDisplay");
58
60
  return JSON.stringify(value, function (key, value) {
59
61
  return value === void 0 ? undefId : value;
60
- }, space).split(JSON.stringify(undefId)).join("<undefined>");
62
+ }, space)
63
+ .split(JSON.stringify(undefId))
64
+ .join("<undefined>");
61
65
  }
62
66
 
63
67
  function wrap(fn) {
@@ -100,7 +104,7 @@ function getErrorMsg(message, messageArgs) {
100
104
  });
101
105
  return ((global$1[ApolloErrorMessageHandler] &&
102
106
  global$1[ApolloErrorMessageHandler](message, args)) ||
103
- "An error occured! For more details, see the full error text at https://go.apollo.dev/c/err#".concat(encodeURIComponent(JSON.stringify({
107
+ "An error occurred! For more details, see the full error text at https://go.apollo.dev/c/err#".concat(encodeURIComponent(JSON.stringify({
104
108
  version: version,
105
109
  message: message,
106
110
  args: args,
@@ -115,14 +119,15 @@ function shouldInclude(_a, variables) {
115
119
  return getInclusionDirectives(directives).every(function (_a) {
116
120
  var directive = _a.directive, ifArgument = _a.ifArgument;
117
121
  var evaledValue = false;
118
- if (ifArgument.value.kind === 'Variable') {
119
- evaledValue = variables && variables[ifArgument.value.name.value];
122
+ if (ifArgument.value.kind === "Variable") {
123
+ evaledValue =
124
+ variables && variables[ifArgument.value.name.value];
120
125
  invariant(evaledValue !== void 0, 64, directive.name.value);
121
126
  }
122
127
  else {
123
128
  evaledValue = ifArgument.value.value;
124
129
  }
125
- return directive.name.value === 'skip' ? !evaledValue : evaledValue;
130
+ return directive.name.value === "skip" ? !evaledValue : evaledValue;
126
131
  });
127
132
  }
128
133
  function hasDirectives(names, root, all) {
@@ -130,8 +135,7 @@ function hasDirectives(names, root, all) {
130
135
  var uniqueCount = nameSet.size;
131
136
  graphql.visit(root, {
132
137
  Directive: function (node) {
133
- if (nameSet.delete(node.name.value) &&
134
- (!all || !nameSet.size)) {
138
+ if (nameSet.delete(node.name.value) && (!all || !nameSet.size)) {
135
139
  return graphql.BREAK;
136
140
  }
137
141
  },
@@ -139,11 +143,11 @@ function hasDirectives(names, root, all) {
139
143
  return all ? !nameSet.size : nameSet.size < uniqueCount;
140
144
  }
141
145
  function hasClientExports(document) {
142
- return document && hasDirectives(['client', 'export'], document, true);
146
+ return document && hasDirectives(["client", "export"], document, true);
143
147
  }
144
148
  function isInclusionDirective(_a) {
145
149
  var value = _a.name.value;
146
- return value === 'skip' || value === 'include';
150
+ return value === "skip" || value === "include";
147
151
  }
148
152
  function getInclusionDirectives(directives) {
149
153
  var result = [];
@@ -155,60 +159,59 @@ function getInclusionDirectives(directives) {
155
159
  var directiveName = directive.name.value;
156
160
  invariant(directiveArguments && directiveArguments.length === 1, 65, directiveName);
157
161
  var ifArgument = directiveArguments[0];
158
- invariant(ifArgument.name && ifArgument.name.value === 'if', 66, directiveName);
162
+ invariant(ifArgument.name && ifArgument.name.value === "if", 66, directiveName);
159
163
  var ifValue = ifArgument.value;
160
164
  invariant(ifValue &&
161
- (ifValue.kind === 'Variable' || ifValue.kind === 'BooleanValue'), 67, directiveName);
165
+ (ifValue.kind === "Variable" || ifValue.kind === "BooleanValue"), 67, directiveName);
162
166
  result.push({ directive: directive, ifArgument: ifArgument });
163
167
  });
164
168
  }
165
169
  return result;
166
170
  }
167
171
 
168
- var canUseWeakMap = typeof WeakMap === 'function' &&
169
- maybe(function () { return navigator.product; }) !== 'ReactNative';
170
- var canUseWeakSet = typeof WeakSet === 'function';
171
- var canUseSymbol = typeof Symbol === 'function' &&
172
- typeof Symbol.for === 'function';
172
+ var canUseWeakMap = typeof WeakMap === "function" &&
173
+ maybe(function () { return navigator.product; }) !== "ReactNative";
174
+ var canUseWeakSet = typeof WeakSet === "function";
175
+ var canUseSymbol = typeof Symbol === "function" && typeof Symbol.for === "function";
173
176
  var canUseAsyncIteratorSymbol = canUseSymbol && Symbol.asyncIterator;
174
177
  var canUseDOM = typeof maybe(function () { return window.document.createElement; }) === "function";
175
178
  var usingJSDOM = maybe(function () { return navigator.userAgent.indexOf("jsdom") >= 0; }) || false;
176
179
  var canUseLayoutEffect = canUseDOM && !usingJSDOM;
177
180
 
178
181
  function isNonNullObject(obj) {
179
- return obj !== null && typeof obj === 'object';
182
+ return obj !== null && typeof obj === "object";
180
183
  }
181
184
 
182
185
  function getFragmentQueryDocument(document, fragmentName) {
183
186
  var actualFragmentName = fragmentName;
184
187
  var fragments = [];
185
188
  document.definitions.forEach(function (definition) {
186
- if (definition.kind === 'OperationDefinition') {
189
+ if (definition.kind === "OperationDefinition") {
187
190
  throw newInvariantError(
188
191
  68,
189
192
  definition.operation,
190
- definition.name ? " named '".concat(definition.name.value, "'") : ''
193
+ definition.name ? " named '".concat(definition.name.value, "'") : ""
191
194
  );
192
195
  }
193
- if (definition.kind === 'FragmentDefinition') {
196
+ if (definition.kind === "FragmentDefinition") {
194
197
  fragments.push(definition);
195
198
  }
196
199
  });
197
- if (typeof actualFragmentName === 'undefined') {
200
+ if (typeof actualFragmentName === "undefined") {
198
201
  invariant(fragments.length === 1, 69, fragments.length);
199
202
  actualFragmentName = fragments[0].name.value;
200
203
  }
201
204
  var query = tslib.__assign(tslib.__assign({}, document), { definitions: tslib.__spreadArray([
202
205
  {
203
- kind: 'OperationDefinition',
204
- operation: 'query',
206
+ kind: "OperationDefinition",
207
+ operation: "query",
205
208
  selectionSet: {
206
- kind: 'SelectionSet',
209
+ kind: "SelectionSet",
207
210
  selections: [
208
211
  {
209
- kind: 'FragmentSpread',
212
+ kind: "FragmentSpread",
210
213
  name: {
211
- kind: 'Name',
214
+ kind: "Name",
212
215
  value: actualFragmentName,
213
216
  },
214
217
  },
@@ -228,9 +231,9 @@ function createFragmentMap(fragments) {
228
231
  }
229
232
  function getFragmentFromSelection(selection, fragmentMap) {
230
233
  switch (selection.kind) {
231
- case 'InlineFragment':
234
+ case "InlineFragment":
232
235
  return selection;
233
- case 'FragmentSpread': {
236
+ case "FragmentSpread": {
234
237
  var fragmentName = selection.name.value;
235
238
  if (typeof fragmentMap === "function") {
236
239
  return fragmentMap(fragmentName);
@@ -248,7 +251,7 @@ function makeReference(id) {
248
251
  return { __ref: String(id) };
249
252
  }
250
253
  function isReference(obj) {
251
- return Boolean(obj && typeof obj === 'object' && typeof obj.__ref === 'string');
254
+ return Boolean(obj && typeof obj === "object" && typeof obj.__ref === "string");
252
255
  }
253
256
  function isDocumentNode(value) {
254
257
  return (isNonNullObject(value) &&
@@ -256,31 +259,31 @@ function isDocumentNode(value) {
256
259
  Array.isArray(value.definitions));
257
260
  }
258
261
  function isStringValue(value) {
259
- return value.kind === 'StringValue';
262
+ return value.kind === "StringValue";
260
263
  }
261
264
  function isBooleanValue(value) {
262
- return value.kind === 'BooleanValue';
265
+ return value.kind === "BooleanValue";
263
266
  }
264
267
  function isIntValue(value) {
265
- return value.kind === 'IntValue';
268
+ return value.kind === "IntValue";
266
269
  }
267
270
  function isFloatValue(value) {
268
- return value.kind === 'FloatValue';
271
+ return value.kind === "FloatValue";
269
272
  }
270
273
  function isVariable(value) {
271
- return value.kind === 'Variable';
274
+ return value.kind === "Variable";
272
275
  }
273
276
  function isObjectValue(value) {
274
- return value.kind === 'ObjectValue';
277
+ return value.kind === "ObjectValue";
275
278
  }
276
279
  function isListValue(value) {
277
- return value.kind === 'ListValue';
280
+ return value.kind === "ListValue";
278
281
  }
279
282
  function isEnumValue(value) {
280
- return value.kind === 'EnumValue';
283
+ return value.kind === "EnumValue";
281
284
  }
282
285
  function isNullValue(value) {
283
- return value.kind === 'NullValue';
286
+ return value.kind === "NullValue";
284
287
  }
285
288
  function valueToObjectRepresentation(argObj, name, value, variables) {
286
289
  if (isIntValue(value) || isFloatValue(value)) {
@@ -342,33 +345,33 @@ function storeKeyNameFromField(field, variables) {
342
345
  return getStoreKeyName(field.name.value, argObj, directivesObj);
343
346
  }
344
347
  var KNOWN_DIRECTIVES = [
345
- 'connection',
346
- 'include',
347
- 'skip',
348
- 'client',
349
- 'rest',
350
- 'export',
351
- 'nonreactive',
348
+ "connection",
349
+ "include",
350
+ "skip",
351
+ "client",
352
+ "rest",
353
+ "export",
354
+ "nonreactive",
352
355
  ];
353
356
  var getStoreKeyName = Object.assign(function (fieldName, args, directives) {
354
357
  if (args &&
355
358
  directives &&
356
- directives['connection'] &&
357
- directives['connection']['key']) {
358
- if (directives['connection']['filter'] &&
359
- directives['connection']['filter'].length > 0) {
360
- var filterKeys = directives['connection']['filter']
361
- ? directives['connection']['filter']
359
+ directives["connection"] &&
360
+ directives["connection"]["key"]) {
361
+ if (directives["connection"]["filter"] &&
362
+ directives["connection"]["filter"].length > 0) {
363
+ var filterKeys = directives["connection"]["filter"]
364
+ ? directives["connection"]["filter"]
362
365
  : [];
363
366
  filterKeys.sort();
364
367
  var filteredArgs_1 = {};
365
368
  filterKeys.forEach(function (key) {
366
369
  filteredArgs_1[key] = args[key];
367
370
  });
368
- return "".concat(directives['connection']['key'], "(").concat(stringify(filteredArgs_1), ")");
371
+ return "".concat(directives["connection"]["key"], "(").concat(stringify(filteredArgs_1), ")");
369
372
  }
370
373
  else {
371
- return directives['connection']['key'];
374
+ return directives["connection"]["key"];
372
375
  }
373
376
  }
374
377
  var completeFieldName = fieldName;
@@ -401,7 +404,9 @@ var stringify = function defaultStringify(value) {
401
404
  };
402
405
  function stringifyReplacer(_key, value) {
403
406
  if (isNonNullObject(value) && !Array.isArray(value)) {
404
- value = Object.keys(value).sort().reduce(function (copy, key) {
407
+ value = Object.keys(value)
408
+ .sort()
409
+ .reduce(function (copy, key) {
405
410
  copy[key] = value[key];
406
411
  return copy;
407
412
  }, {});
@@ -427,7 +432,7 @@ function getTypenameFromResult(result, selectionSet, fragmentMap) {
427
432
  for (var _i = 0, _a = selectionSet.selections; _i < _a.length; _i++) {
428
433
  var selection = _a[_i];
429
434
  if (isField(selection)) {
430
- if (selection.name.value === '__typename') {
435
+ if (selection.name.value === "__typename") {
431
436
  return result[resultKeyNameFromField(selection)];
432
437
  }
433
438
  }
@@ -438,32 +443,32 @@ function getTypenameFromResult(result, selectionSet, fragmentMap) {
438
443
  fragments = [selection];
439
444
  }
440
445
  }
441
- if (typeof result.__typename === 'string') {
446
+ if (typeof result.__typename === "string") {
442
447
  return result.__typename;
443
448
  }
444
449
  if (fragments) {
445
450
  for (var _b = 0, fragments_1 = fragments; _b < fragments_1.length; _b++) {
446
451
  var selection = fragments_1[_b];
447
452
  var typename = getTypenameFromResult(result, getFragmentFromSelection(selection, fragmentMap).selectionSet, fragmentMap);
448
- if (typeof typename === 'string') {
453
+ if (typeof typename === "string") {
449
454
  return typename;
450
455
  }
451
456
  }
452
457
  }
453
458
  }
454
459
  function isField(selection) {
455
- return selection.kind === 'Field';
460
+ return selection.kind === "Field";
456
461
  }
457
462
  function isInlineFragment(selection) {
458
- return selection.kind === 'InlineFragment';
463
+ return selection.kind === "InlineFragment";
459
464
  }
460
465
 
461
466
  function checkDocument(doc) {
462
- invariant(doc && doc.kind === 'Document', 71);
467
+ invariant(doc && doc.kind === "Document", 71);
463
468
  var operations = doc.definitions
464
- .filter(function (d) { return d.kind !== 'FragmentDefinition'; })
469
+ .filter(function (d) { return d.kind !== "FragmentDefinition"; })
465
470
  .map(function (definition) {
466
- if (definition.kind !== 'OperationDefinition') {
471
+ if (definition.kind !== "OperationDefinition") {
467
472
  throw newInvariantError(72, definition.kind);
468
473
  }
469
474
  return definition;
@@ -474,31 +479,31 @@ function checkDocument(doc) {
474
479
  function getOperationDefinition(doc) {
475
480
  checkDocument(doc);
476
481
  return doc.definitions.filter(function (definition) {
477
- return definition.kind === 'OperationDefinition';
482
+ return definition.kind === "OperationDefinition";
478
483
  })[0];
479
484
  }
480
485
  function getOperationName(doc) {
481
486
  return (doc.definitions
482
487
  .filter(function (definition) {
483
- return definition.kind === 'OperationDefinition' && !!definition.name;
488
+ return definition.kind === "OperationDefinition" && !!definition.name;
484
489
  })
485
490
  .map(function (x) { return x.name.value; })[0] || null);
486
491
  }
487
492
  function getFragmentDefinitions(doc) {
488
493
  return doc.definitions.filter(function (definition) {
489
- return definition.kind === 'FragmentDefinition';
494
+ return definition.kind === "FragmentDefinition";
490
495
  });
491
496
  }
492
497
  function getQueryDefinition(doc) {
493
498
  var queryDef = getOperationDefinition(doc);
494
- invariant(queryDef && queryDef.operation === 'query', 74);
499
+ invariant(queryDef && queryDef.operation === "query", 74);
495
500
  return queryDef;
496
501
  }
497
502
  function getFragmentDefinition(doc) {
498
- invariant(doc.kind === 'Document', 75);
503
+ invariant(doc.kind === "Document", 75);
499
504
  invariant(doc.definitions.length <= 1, 76);
500
505
  var fragmentDef = doc.definitions[0];
501
- invariant(fragmentDef.kind === 'FragmentDefinition', 77);
506
+ invariant(fragmentDef.kind === "FragmentDefinition", 77);
502
507
  return fragmentDef;
503
508
  }
504
509
  function getMainDefinition(queryDoc) {
@@ -506,15 +511,15 @@ function getMainDefinition(queryDoc) {
506
511
  var fragmentDefinition;
507
512
  for (var _i = 0, _a = queryDoc.definitions; _i < _a.length; _i++) {
508
513
  var definition = _a[_i];
509
- if (definition.kind === 'OperationDefinition') {
514
+ if (definition.kind === "OperationDefinition") {
510
515
  var operation = definition.operation;
511
- if (operation === 'query' ||
512
- operation === 'mutation' ||
513
- operation === 'subscription') {
516
+ if (operation === "query" ||
517
+ operation === "mutation" ||
518
+ operation === "subscription") {
514
519
  return definition;
515
520
  }
516
521
  }
517
- if (definition.kind === 'FragmentDefinition' && !fragmentDefinition) {
522
+ if (definition.kind === "FragmentDefinition" && !fragmentDefinition) {
518
523
  fragmentDefinition = definition;
519
524
  }
520
525
  }
@@ -620,12 +625,15 @@ var TYPENAME_FIELD = {
620
625
  kind: graphql.Kind.FIELD,
621
626
  name: {
622
627
  kind: graphql.Kind.NAME,
623
- value: '__typename',
628
+ value: "__typename",
624
629
  },
625
630
  };
626
631
  function isEmpty(op, fragmentMap) {
627
- return !op || op.selectionSet.selections.every(function (selection) { return selection.kind === graphql.Kind.FRAGMENT_SPREAD &&
628
- isEmpty(fragmentMap[selection.name.value], fragmentMap); });
632
+ return (!op ||
633
+ op.selectionSet.selections.every(function (selection) {
634
+ return selection.kind === graphql.Kind.FRAGMENT_SPREAD &&
635
+ isEmpty(fragmentMap[selection.name.value], fragmentMap);
636
+ }));
629
637
  }
630
638
  function nullIfDocIsEmpty(doc) {
631
639
  return isEmpty(getOperationDefinition(doc) || getFragmentDefinition(doc), createFragmentMap(getFragmentDefinitions(doc)))
@@ -663,10 +671,10 @@ function makeInUseGetterFunction(defaultKey) {
663
671
  if (key === void 0) { key = defaultKey; }
664
672
  var inUse = map.get(key);
665
673
  if (!inUse) {
666
- map.set(key, inUse = {
667
- variables: new Set,
668
- fragmentSpreads: new Set,
669
- });
674
+ map.set(key, (inUse = {
675
+ variables: new Set(),
676
+ fragmentSpreads: new Set(),
677
+ }));
670
678
  }
671
679
  return inUse;
672
680
  };
@@ -696,8 +704,12 @@ function removeDirectivesFromDocument(directives, doc) {
696
704
  }
697
705
  }
698
706
  var directiveMatcher = getDirectiveMatcher(directives);
699
- var shouldRemoveField = function (nodeDirectives) { return (isNonEmptyArray(nodeDirectives) &&
700
- nodeDirectives.map(directiveMatcher).some(function (config) { return config && config.remove; })); };
707
+ var shouldRemoveField = function (nodeDirectives) {
708
+ return isNonEmptyArray(nodeDirectives) &&
709
+ nodeDirectives
710
+ .map(directiveMatcher)
711
+ .some(function (config) { return config && config.remove; });
712
+ };
701
713
  var originalFragmentDefsByPath = new Map();
702
714
  var firstVisitMadeChanges = false;
703
715
  var fieldOrInlineFragmentVisitor = {
@@ -746,8 +758,10 @@ function removeDirectivesFromDocument(directives, doc) {
746
758
  return node;
747
759
  }
748
760
  if (operationCount > 0 &&
749
- node.selectionSet.selections.every(function (selection) { return (selection.kind === graphql.Kind.FIELD &&
750
- selection.name.value === '__typename'); })) {
761
+ node.selectionSet.selections.every(function (selection) {
762
+ return selection.kind === graphql.Kind.FIELD &&
763
+ selection.name.value === "__typename";
764
+ })) {
751
765
  getInUseByFragmentName(node.name.value).removed = true;
752
766
  firstVisitMadeChanges = true;
753
767
  return null;
@@ -797,8 +811,10 @@ function removeDirectivesFromDocument(directives, doc) {
797
811
  allFragmentNamesUsed.add(childFragmentName);
798
812
  });
799
813
  });
800
- var fragmentWillBeRemoved = function (fragmentName) { return !!(!allFragmentNamesUsed.has(fragmentName) ||
801
- getInUseByFragmentName(fragmentName).removed); };
814
+ var fragmentWillBeRemoved = function (fragmentName) {
815
+ return !!((!allFragmentNamesUsed.has(fragmentName) ||
816
+ getInUseByFragmentName(fragmentName).removed));
817
+ };
802
818
  var enterVisitor = {
803
819
  enter: function (node) {
804
820
  if (fragmentWillBeRemoved(node.name.value)) {
@@ -814,7 +830,9 @@ function removeDirectivesFromDocument(directives, doc) {
814
830
  if (node.variableDefinitions) {
815
831
  var usedVariableNames_1 = populateTransitiveVars(getInUseByOperationName(node.name && node.name.value)).transitiveVars;
816
832
  if (usedVariableNames_1.size < node.variableDefinitions.length) {
817
- return tslib.__assign(tslib.__assign({}, node), { variableDefinitions: node.variableDefinitions.filter(function (varDef) { return usedVariableNames_1.has(varDef.variable.name.value); }) });
833
+ return tslib.__assign(tslib.__assign({}, node), { variableDefinitions: node.variableDefinitions.filter(function (varDef) {
834
+ return usedVariableNames_1.has(varDef.variable.name.value);
835
+ }) });
818
836
  }
819
837
  }
820
838
  },
@@ -826,7 +844,8 @@ var addTypenameToDocument = Object.assign(function (doc) {
826
844
  SelectionSet: {
827
845
  enter: function (node, _key, parent) {
828
846
  if (parent &&
829
- parent.kind === graphql.Kind.OPERATION_DEFINITION) {
847
+ parent.kind ===
848
+ graphql.Kind.OPERATION_DEFINITION) {
830
849
  return;
831
850
  }
832
851
  var selections = node.selections;
@@ -835,8 +854,8 @@ var addTypenameToDocument = Object.assign(function (doc) {
835
854
  }
836
855
  var skip = selections.some(function (selection) {
837
856
  return (isField(selection) &&
838
- (selection.name.value === '__typename' ||
839
- selection.name.value.lastIndexOf('__', 0) === 0));
857
+ (selection.name.value === "__typename" ||
858
+ selection.name.value.lastIndexOf("__", 0) === 0));
840
859
  });
841
860
  if (skip) {
842
861
  return;
@@ -844,7 +863,7 @@ var addTypenameToDocument = Object.assign(function (doc) {
844
863
  var field = parent;
845
864
  if (isField(field) &&
846
865
  field.directives &&
847
- field.directives.some(function (d) { return d.name.value === 'export'; })) {
866
+ field.directives.some(function (d) { return d.name.value === "export"; })) {
848
867
  return;
849
868
  }
850
869
  return tslib.__assign(tslib.__assign({}, node), { selections: tslib.__spreadArray(tslib.__spreadArray([], selections, true), [TYPENAME_FIELD], false) });
@@ -859,13 +878,13 @@ var addTypenameToDocument = Object.assign(function (doc) {
859
878
  function buildQueryFromSelectionSet(document) {
860
879
  var definition = getMainDefinition(document);
861
880
  var definitionOperation = definition.operation;
862
- if (definitionOperation === 'query') {
881
+ if (definitionOperation === "query") {
863
882
  return document;
864
883
  }
865
884
  var modifiedDoc = graphql.visit(document, {
866
885
  OperationDefinition: {
867
886
  enter: function (node) {
868
- return tslib.__assign(tslib.__assign({}, node), { operation: 'query' });
887
+ return tslib.__assign(tslib.__assign({}, node), { operation: "query" });
869
888
  },
870
889
  },
871
890
  });
@@ -875,7 +894,7 @@ function removeClientSetsFromDocument(document) {
875
894
  checkDocument(document);
876
895
  var modifiedDoc = removeDirectivesFromDocument([
877
896
  {
878
- test: function (directive) { return directive.name.value === 'client'; },
897
+ test: function (directive) { return directive.name.value === "client"; },
879
898
  remove: true,
880
899
  },
881
900
  ], document);
@@ -922,7 +941,9 @@ var DeepMerger = (function () {
922
941
  if (hasOwnProperty$4.call(target, sourceKey)) {
923
942
  var targetValue = target[sourceKey];
924
943
  if (source[sourceKey] !== targetValue) {
925
- var result = _this.reconciler.apply(_this, tslib.__spreadArray([target, source, sourceKey], context, false));
944
+ var result = _this.reconciler.apply(_this, tslib.__spreadArray([target,
945
+ source,
946
+ sourceKey], context, false));
926
947
  if (result !== targetValue) {
927
948
  target = _this.shallowCopyForMerge(target);
928
949
  target[sourceKey] = result;
@@ -1000,7 +1021,7 @@ function cloneDeep(value) {
1000
1021
  function cloneDeepHelper(val, seen) {
1001
1022
  switch (toString.call(val)) {
1002
1023
  case "[object Array]": {
1003
- seen = seen || new Map;
1024
+ seen = seen || new Map();
1004
1025
  if (seen.has(val))
1005
1026
  return seen.get(val);
1006
1027
  var copy_1 = val.slice(0);
@@ -1011,7 +1032,7 @@ function cloneDeepHelper(val, seen) {
1011
1032
  return copy_1;
1012
1033
  }
1013
1034
  case "[object Object]": {
1014
- seen = seen || new Map;
1035
+ seen = seen || new Map();
1015
1036
  if (seen.has(val))
1016
1037
  return seen.get(val);
1017
1038
  var copy_2 = Object.create(Object.getPrototypeOf(val));
@@ -1079,7 +1100,9 @@ function asyncMap(observable, mapFn, catchFn) {
1079
1100
  return function (arg) {
1080
1101
  ++activeCallbackCount;
1081
1102
  var both = function () { return examiner(arg); };
1082
- promiseQueue = promiseQueue.then(both, both).then(function (result) {
1103
+ promiseQueue = promiseQueue
1104
+ .then(both, both)
1105
+ .then(function (result) {
1083
1106
  --activeCallbackCount;
1084
1107
  next && next.call(observer, result);
1085
1108
  if (completed) {
@@ -1088,7 +1111,8 @@ function asyncMap(observable, mapFn, catchFn) {
1088
1111
  }, function (error) {
1089
1112
  --activeCallbackCount;
1090
1113
  throw error;
1091
- }).catch(function (caught) {
1114
+ })
1115
+ .catch(function (caught) {
1092
1116
  error && error.call(observer, caught);
1093
1117
  });
1094
1118
  };
@@ -1166,8 +1190,7 @@ var Concast = (function (_super) {
1166
1190
  if (sub)
1167
1191
  setTimeout(function () { return sub.unsubscribe(); });
1168
1192
  _this.sub = null;
1169
- if (_this.latest &&
1170
- _this.latest[0] === "next") {
1193
+ if (_this.latest && _this.latest[0] === "next") {
1171
1194
  _this.resolve(_this.latest[1]);
1172
1195
  }
1173
1196
  else {
@@ -1177,7 +1200,7 @@ var Concast = (function (_super) {
1177
1200
  iterateObserversSafely(_this.observers, "complete");
1178
1201
  }
1179
1202
  else if (isPromiseLike(value)) {
1180
- value.then(function (obs) { return _this.sub = obs.subscribe(_this.handlers); });
1203
+ value.then(function (obs) { return (_this.sub = obs.subscribe(_this.handlers)); });
1181
1204
  }
1182
1205
  else {
1183
1206
  _this.sub = value.subscribe(_this.handlers);
@@ -1216,9 +1239,7 @@ var Concast = (function (_super) {
1216
1239
  if (method) {
1217
1240
  method.call(observer, this.latest[1]);
1218
1241
  }
1219
- if (this.sub === null &&
1220
- nextOrError === "next" &&
1221
- observer.complete) {
1242
+ if (this.sub === null && nextOrError === "next" && observer.complete) {
1222
1243
  observer.complete();
1223
1244
  }
1224
1245
  }
@@ -1230,15 +1251,14 @@ var Concast = (function (_super) {
1230
1251
  }
1231
1252
  };
1232
1253
  Concast.prototype.removeObserver = function (observer) {
1233
- if (this.observers.delete(observer) &&
1234
- this.observers.size < 1) {
1254
+ if (this.observers.delete(observer) && this.observers.size < 1) {
1235
1255
  this.handlers.complete();
1236
1256
  }
1237
1257
  };
1238
1258
  Concast.prototype.notify = function (method, arg) {
1239
1259
  var nextResultListeners = this.nextResultListeners;
1240
1260
  if (nextResultListeners.size) {
1241
- this.nextResultListeners = new Set;
1261
+ this.nextResultListeners = new Set();
1242
1262
  nextResultListeners.forEach(function (listener) { return listener(method, arg); });
1243
1263
  }
1244
1264
  };
@@ -1332,26 +1352,6 @@ function mergeOptions(defaults, options) {
1332
1352
  });
1333
1353
  }
1334
1354
 
1335
- function isNodeResponse(value) {
1336
- return !!value.body;
1337
- }
1338
- function isReadableStream(value) {
1339
- return !!value.getReader;
1340
- }
1341
- function isAsyncIterableIterator(value) {
1342
- return !!(canUseAsyncIteratorSymbol &&
1343
- value[Symbol.asyncIterator]);
1344
- }
1345
- function isStreamableBlob(value) {
1346
- return !!value.stream;
1347
- }
1348
- function isBlob(value) {
1349
- return !!value.arrayBuffer;
1350
- }
1351
- function isNodeReadableStream(value) {
1352
- return !!value.pipe;
1353
- }
1354
-
1355
1355
  function fromError(errorValue) {
1356
1356
  return new zenObservableTs.Observable(function (observer) {
1357
1357
  observer.error(errorValue);
@@ -1389,7 +1389,7 @@ function fromPromise(promise) {
1389
1389
 
1390
1390
  var throwServerError = function (response, result, message) {
1391
1391
  var error = new Error(message);
1392
- error.name = 'ServerError';
1392
+ error.name = "ServerError";
1393
1393
  error.response = response;
1394
1394
  error.statusCode = response.status;
1395
1395
  error.result = result;
@@ -1398,11 +1398,11 @@ var throwServerError = function (response, result, message) {
1398
1398
 
1399
1399
  function validateOperation(operation) {
1400
1400
  var OPERATION_FIELDS = [
1401
- 'query',
1402
- 'operationName',
1403
- 'variables',
1404
- 'extensions',
1405
- 'context',
1401
+ "query",
1402
+ "operationName",
1403
+ "variables",
1404
+ "extensions",
1405
+ "context",
1406
1406
  ];
1407
1407
  for (var _i = 0, _a = Object.keys(operation); _i < _a.length; _i++) {
1408
1408
  var key = _a[_i];
@@ -1416,7 +1416,7 @@ function validateOperation(operation) {
1416
1416
  function createOperation(starting, operation) {
1417
1417
  var context = tslib.__assign({}, starting);
1418
1418
  var setContext = function (next) {
1419
- if (typeof next === 'function') {
1419
+ if (typeof next === "function") {
1420
1420
  context = tslib.__assign(tslib.__assign({}, context), next(context));
1421
1421
  }
1422
1422
  else {
@@ -1424,11 +1424,11 @@ function createOperation(starting, operation) {
1424
1424
  }
1425
1425
  };
1426
1426
  var getContext = function () { return (tslib.__assign({}, context)); };
1427
- Object.defineProperty(operation, 'setContext', {
1427
+ Object.defineProperty(operation, "setContext", {
1428
1428
  enumerable: false,
1429
1429
  value: setContext,
1430
1430
  });
1431
- Object.defineProperty(operation, 'getContext', {
1431
+ Object.defineProperty(operation, "getContext", {
1432
1432
  enumerable: false,
1433
1433
  value: getContext,
1434
1434
  });
@@ -1444,9 +1444,9 @@ function transformOperation(operation) {
1444
1444
  };
1445
1445
  if (!transformedOperation.operationName) {
1446
1446
  transformedOperation.operationName =
1447
- typeof transformedOperation.query !== 'string'
1447
+ typeof transformedOperation.query !== "string"
1448
1448
  ? getOperationName(transformedOperation.query) || undefined
1449
- : '';
1449
+ : "";
1450
1450
  }
1451
1451
  return transformedOperation;
1452
1452
  }
@@ -1457,7 +1457,7 @@ function filterOperationVariables(variables, query) {
1457
1457
  graphql.visit(query, {
1458
1458
  Variable: function (node, _key, parent) {
1459
1459
  if (parent &&
1460
- parent.kind !== 'VariableDefinition') {
1460
+ parent.kind !== "VariableDefinition") {
1461
1461
  unusedNames.delete(node.name.value);
1462
1462
  }
1463
1463
  },
@@ -1472,7 +1472,7 @@ function passthrough(op, forward) {
1472
1472
  return (forward ? forward(op) : zenObservableTs.Observable.of());
1473
1473
  }
1474
1474
  function toLink(handler) {
1475
- return typeof handler === 'function' ? new ApolloLink(handler) : handler;
1475
+ return typeof handler === "function" ? new ApolloLink(handler) : handler;
1476
1476
  }
1477
1477
  function isTerminating(link) {
1478
1478
  return link.request.length <= 1;
@@ -1689,6 +1689,25 @@ function readerIterator(reader) {
1689
1689
  return iterator;
1690
1690
  }
1691
1691
 
1692
+ function isNodeResponse(value) {
1693
+ return !!value.body;
1694
+ }
1695
+ function isReadableStream(value) {
1696
+ return !!value.getReader;
1697
+ }
1698
+ function isAsyncIterableIterator(value) {
1699
+ return !!(canUseAsyncIteratorSymbol &&
1700
+ value[Symbol.asyncIterator]);
1701
+ }
1702
+ function isStreamableBlob(value) {
1703
+ return !!value.stream;
1704
+ }
1705
+ function isBlob(value) {
1706
+ return !!value.arrayBuffer;
1707
+ }
1708
+ function isNodeReadableStream(value) {
1709
+ return !!value.pipe;
1710
+ }
1692
1711
  function responseIterator(response) {
1693
1712
  var body = response;
1694
1713
  if (isNodeResponse(response))
@@ -1715,22 +1734,24 @@ function graphQLResultHasProtocolErrors(result) {
1715
1734
  return false;
1716
1735
  }
1717
1736
  function isApolloError(err) {
1718
- return err.hasOwnProperty('graphQLErrors');
1737
+ return err.hasOwnProperty("graphQLErrors");
1719
1738
  }
1720
1739
  var generateErrorMessage = function (err) {
1721
1740
  var errors = tslib.__spreadArray(tslib.__spreadArray(tslib.__spreadArray([], err.graphQLErrors, true), err.clientErrors, true), err.protocolErrors, true);
1722
1741
  if (err.networkError)
1723
1742
  errors.push(err.networkError);
1724
- return errors
1725
- .map(function (err) { return isNonNullObject(err) && err.message || 'Error message not found.'; })
1726
- .join('\n');
1743
+ return (errors
1744
+ .map(function (err) {
1745
+ return (isNonNullObject(err) && err.message) || "Error message not found.";
1746
+ })
1747
+ .join("\n"));
1727
1748
  };
1728
1749
  var ApolloError = (function (_super) {
1729
1750
  tslib.__extends(ApolloError, _super);
1730
1751
  function ApolloError(_a) {
1731
1752
  var graphQLErrors = _a.graphQLErrors, protocolErrors = _a.protocolErrors, clientErrors = _a.clientErrors, networkError = _a.networkError, errorMessage = _a.errorMessage, extraInfo = _a.extraInfo;
1732
1753
  var _this = _super.call(this, errorMessage) || this;
1733
- _this.name = 'ApolloError';
1754
+ _this.name = "ApolloError";
1734
1755
  _this.graphQLErrors = graphQLErrors || [];
1735
1756
  _this.protocolErrors = protocolErrors || [];
1736
1757
  _this.clientErrors = clientErrors || [];
@@ -1907,11 +1928,11 @@ var defaultHttpOptions = {
1907
1928
  preserveHeaderCase: false,
1908
1929
  };
1909
1930
  var defaultHeaders = {
1910
- accept: '*/*',
1911
- 'content-type': 'application/json',
1931
+ accept: "*/*",
1932
+ "content-type": "application/json",
1912
1933
  };
1913
1934
  var defaultOptions = {
1914
- method: 'POST',
1935
+ method: "POST",
1915
1936
  };
1916
1937
  var fallbackHttpConfig = {
1917
1938
  http: defaultHttpOptions,
@@ -1966,7 +1987,10 @@ function removeDuplicateHeaders(headers, preserveHeaderCase) {
1966
1987
  }
1967
1988
  var headerData = Object.create(null);
1968
1989
  Object.keys(Object(headers)).forEach(function (name) {
1969
- headerData[name.toLowerCase()] = { originalName: name, value: headers[name] };
1990
+ headerData[name.toLowerCase()] = {
1991
+ originalName: name,
1992
+ value: headers[name],
1993
+ };
1970
1994
  });
1971
1995
  var normalizedHeaders = Object.create(null);
1972
1996
  Object.keys(headerData).forEach(function (name) {
@@ -1976,13 +2000,13 @@ function removeDuplicateHeaders(headers, preserveHeaderCase) {
1976
2000
  }
1977
2001
 
1978
2002
  var checkFetcher = function (fetcher) {
1979
- if (!fetcher && typeof fetch === 'undefined') {
2003
+ if (!fetcher && typeof fetch === "undefined") {
1980
2004
  throw newInvariantError(35);
1981
2005
  }
1982
2006
  };
1983
2007
 
1984
2008
  var createSignalIfSupported = function () {
1985
- if (typeof AbortController === 'undefined')
2009
+ if (typeof AbortController === "undefined")
1986
2010
  return { controller: false, signal: false };
1987
2011
  var controller = new AbortController();
1988
2012
  var signal = controller.signal;
@@ -1995,11 +2019,11 @@ var selectURI = function (operation, fallbackURI) {
1995
2019
  if (contextURI) {
1996
2020
  return contextURI;
1997
2021
  }
1998
- else if (typeof fallbackURI === 'function') {
2022
+ else if (typeof fallbackURI === "function") {
1999
2023
  return fallbackURI(operation);
2000
2024
  }
2001
2025
  else {
2002
- return fallbackURI || '/graphql';
2026
+ return fallbackURI || "/graphql";
2003
2027
  }
2004
2028
  };
2005
2029
 
@@ -2008,47 +2032,47 @@ function rewriteURIForGET(chosenURI, body) {
2008
2032
  var addQueryParam = function (key, value) {
2009
2033
  queryParams.push("".concat(key, "=").concat(encodeURIComponent(value)));
2010
2034
  };
2011
- if ('query' in body) {
2012
- addQueryParam('query', body.query);
2035
+ if ("query" in body) {
2036
+ addQueryParam("query", body.query);
2013
2037
  }
2014
2038
  if (body.operationName) {
2015
- addQueryParam('operationName', body.operationName);
2039
+ addQueryParam("operationName", body.operationName);
2016
2040
  }
2017
2041
  if (body.variables) {
2018
2042
  var serializedVariables = void 0;
2019
2043
  try {
2020
- serializedVariables = serializeFetchParameter(body.variables, 'Variables map');
2044
+ serializedVariables = serializeFetchParameter(body.variables, "Variables map");
2021
2045
  }
2022
2046
  catch (parseError) {
2023
2047
  return { parseError: parseError };
2024
2048
  }
2025
- addQueryParam('variables', serializedVariables);
2049
+ addQueryParam("variables", serializedVariables);
2026
2050
  }
2027
2051
  if (body.extensions) {
2028
2052
  var serializedExtensions = void 0;
2029
2053
  try {
2030
- serializedExtensions = serializeFetchParameter(body.extensions, 'Extensions map');
2054
+ serializedExtensions = serializeFetchParameter(body.extensions, "Extensions map");
2031
2055
  }
2032
2056
  catch (parseError) {
2033
2057
  return { parseError: parseError };
2034
2058
  }
2035
- addQueryParam('extensions', serializedExtensions);
2059
+ addQueryParam("extensions", serializedExtensions);
2036
2060
  }
2037
- var fragment = '', preFragment = chosenURI;
2038
- var fragmentStart = chosenURI.indexOf('#');
2061
+ var fragment = "", preFragment = chosenURI;
2062
+ var fragmentStart = chosenURI.indexOf("#");
2039
2063
  if (fragmentStart !== -1) {
2040
2064
  fragment = chosenURI.substr(fragmentStart);
2041
2065
  preFragment = chosenURI.substr(0, fragmentStart);
2042
2066
  }
2043
- var queryParamsPrefix = preFragment.indexOf('?') === -1 ? '?' : '&';
2044
- var newURI = preFragment + queryParamsPrefix + queryParams.join('&') + fragment;
2067
+ var queryParamsPrefix = preFragment.indexOf("?") === -1 ? "?" : "&";
2068
+ var newURI = preFragment + queryParamsPrefix + queryParams.join("&") + fragment;
2045
2069
  return { newURI: newURI };
2046
2070
  }
2047
2071
 
2048
2072
  var backupFetch = maybe(function () { return fetch; });
2049
2073
  var createHttpLink = function (linkOptions) {
2050
2074
  if (linkOptions === void 0) { linkOptions = {}; }
2051
- 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"]);
2075
+ 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"]);
2052
2076
  if (globalThis.__DEV__ !== false) {
2053
2077
  checkFetcher(preferredFetch || backupFetch);
2054
2078
  }
@@ -2065,10 +2089,10 @@ var createHttpLink = function (linkOptions) {
2065
2089
  if (context.clientAwareness) {
2066
2090
  var _a = context.clientAwareness, name_1 = _a.name, version = _a.version;
2067
2091
  if (name_1) {
2068
- clientAwarenessHeaders['apollographql-client-name'] = name_1;
2092
+ clientAwarenessHeaders["apollographql-client-name"] = name_1;
2069
2093
  }
2070
2094
  if (version) {
2071
- clientAwarenessHeaders['apollographql-client-version'] = version;
2095
+ clientAwarenessHeaders["apollographql-client-version"] = version;
2072
2096
  }
2073
2097
  }
2074
2098
  var contextHeaders = tslib.__assign(tslib.__assign({}, clientAwarenessHeaders), context.headers);
@@ -2078,10 +2102,10 @@ var createHttpLink = function (linkOptions) {
2078
2102
  credentials: context.credentials,
2079
2103
  headers: contextHeaders,
2080
2104
  };
2081
- if (hasDirectives(['client'], operation.query)) {
2105
+ if (hasDirectives(["client"], operation.query)) {
2082
2106
  var transformedQuery = removeClientSetsFromDocument(operation.query);
2083
2107
  if (!transformedQuery) {
2084
- return fromError(new Error('HttpLink: Trying to send a client-only query to the server. To send to the server, ensure a non-client field is added to the query or set the `transformOptions.removeClientFields` option to `true`.'));
2108
+ return fromError(new Error("HttpLink: Trying to send a client-only query to the server. To send to the server, ensure a non-client field is added to the query or set the `transformOptions.removeClientFields` option to `true`."));
2085
2109
  }
2086
2110
  operation.query = transformedQuery;
2087
2111
  }
@@ -2090,21 +2114,21 @@ var createHttpLink = function (linkOptions) {
2090
2114
  body.variables = filterOperationVariables(body.variables, operation.query);
2091
2115
  }
2092
2116
  var controller;
2093
- if (!options.signal && typeof AbortController !== 'undefined') {
2117
+ if (!options.signal && typeof AbortController !== "undefined") {
2094
2118
  controller = new AbortController();
2095
2119
  options.signal = controller.signal;
2096
2120
  }
2097
2121
  var definitionIsMutation = function (d) {
2098
- return d.kind === 'OperationDefinition' && d.operation === 'mutation';
2122
+ return d.kind === "OperationDefinition" && d.operation === "mutation";
2099
2123
  };
2100
2124
  var definitionIsSubscription = function (d) {
2101
- return d.kind === 'OperationDefinition' && d.operation === 'subscription';
2125
+ return d.kind === "OperationDefinition" && d.operation === "subscription";
2102
2126
  };
2103
2127
  var isSubscription = definitionIsSubscription(getMainDefinition(operation.query));
2104
- var hasDefer = hasDirectives(['defer'], operation.query);
2128
+ var hasDefer = hasDirectives(["defer"], operation.query);
2105
2129
  if (useGETForQueries &&
2106
2130
  !operation.query.definitions.some(definitionIsMutation)) {
2107
- options.method = 'GET';
2131
+ options.method = "GET";
2108
2132
  }
2109
2133
  if (hasDefer || isSubscription) {
2110
2134
  options.headers = options.headers || {};
@@ -2113,14 +2137,15 @@ var createHttpLink = function (linkOptions) {
2113
2137
  globalThis.__DEV__ !== false && invariant.warn(36);
2114
2138
  }
2115
2139
  if (isSubscription) {
2116
- acceptHeader += 'boundary=graphql;subscriptionSpec=1.0,application/json';
2140
+ acceptHeader +=
2141
+ "boundary=graphql;subscriptionSpec=1.0,application/json";
2117
2142
  }
2118
2143
  else if (hasDefer) {
2119
- acceptHeader += 'deferSpec=20220824,application/json';
2144
+ acceptHeader += "deferSpec=20220824,application/json";
2120
2145
  }
2121
2146
  options.headers.accept = acceptHeader;
2122
2147
  }
2123
- if (options.method === 'GET') {
2148
+ if (options.method === "GET") {
2124
2149
  var _c = rewriteURIForGET(chosenURI, body), newURI = _c.newURI, parseError = _c.parseError;
2125
2150
  if (parseError) {
2126
2151
  return fromError(parseError);
@@ -2129,7 +2154,7 @@ var createHttpLink = function (linkOptions) {
2129
2154
  }
2130
2155
  else {
2131
2156
  try {
2132
- options.body = serializeFetchParameter(body, 'Payload');
2157
+ options.body = serializeFetchParameter(body, "Payload");
2133
2158
  }
2134
2159
  catch (parseError) {
2135
2160
  return fromError(parseError);
@@ -2142,7 +2167,7 @@ var createHttpLink = function (linkOptions) {
2142
2167
  .then(function (response) {
2143
2168
  var _a;
2144
2169
  operation.setContext({ response: response });
2145
- var ctype = (_a = response.headers) === null || _a === void 0 ? void 0 : _a.get('content-type');
2170
+ var ctype = (_a = response.headers) === null || _a === void 0 ? void 0 : _a.get("content-type");
2146
2171
  if (ctype !== null && /^multipart\/mixed/i.test(ctype)) {
2147
2172
  return readMultipartBody(response, observerNext);
2148
2173
  }
@@ -2184,10 +2209,13 @@ var ApolloCache = (function () {
2184
2209
  }
2185
2210
  ApolloCache.prototype.batch = function (options) {
2186
2211
  var _this = this;
2187
- var optimisticId = typeof options.optimistic === "string" ? options.optimistic :
2188
- options.optimistic === false ? null : void 0;
2212
+ var optimisticId = typeof options.optimistic === "string"
2213
+ ? options.optimistic
2214
+ : options.optimistic === false
2215
+ ? null
2216
+ : void 0;
2189
2217
  var updateResult;
2190
- this.performTransaction(function () { return updateResult = options.update(_this); }, optimisticId);
2218
+ this.performTransaction(function () { return (updateResult = options.update(_this)); }, optimisticId);
2191
2219
  return updateResult;
2192
2220
  };
2193
2221
  ApolloCache.prototype.recordOptimisticTransaction = function (transaction, optimisticId) {
@@ -2210,7 +2238,7 @@ var ApolloCache = (function () {
2210
2238
  };
2211
2239
  ApolloCache.prototype.readQuery = function (options, optimistic) {
2212
2240
  if (optimistic === void 0) { optimistic = !!options.optimistic; }
2213
- return this.read(tslib.__assign(tslib.__assign({}, options), { rootId: options.id || 'ROOT_QUERY', optimistic: optimistic }));
2241
+ return this.read(tslib.__assign(tslib.__assign({}, options), { rootId: options.id || "ROOT_QUERY", optimistic: optimistic }));
2214
2242
  };
2215
2243
  ApolloCache.prototype.readFragment = function (options, optimistic) {
2216
2244
  if (optimistic === void 0) { optimistic = !!options.optimistic; }
@@ -2219,7 +2247,7 @@ var ApolloCache = (function () {
2219
2247
  ApolloCache.prototype.writeQuery = function (_a) {
2220
2248
  var id = _a.id, data = _a.data, options = tslib.__rest(_a, ["id", "data"]);
2221
2249
  return this.write(Object.assign(options, {
2222
- dataId: id || 'ROOT_QUERY',
2250
+ dataId: id || "ROOT_QUERY",
2223
2251
  result: data,
2224
2252
  }));
2225
2253
  };
@@ -2294,17 +2322,19 @@ function defaultDataIdFromObject(_a, context) {
2294
2322
  var __typename = _a.__typename, id = _a.id, _id = _a._id;
2295
2323
  if (typeof __typename === "string") {
2296
2324
  if (context) {
2297
- context.keyObject =
2298
- !isNullish(id) ? { id: id } :
2299
- !isNullish(_id) ? { _id: _id } :
2300
- void 0;
2325
+ context.keyObject = !isNullish(id)
2326
+ ? { id: id }
2327
+ : !isNullish(_id)
2328
+ ? { _id: _id }
2329
+ : void 0;
2301
2330
  }
2302
2331
  if (isNullish(id) && !isNullish(_id)) {
2303
2332
  id = _id;
2304
2333
  }
2305
2334
  if (!isNullish(id)) {
2306
- return "".concat(__typename, ":").concat((typeof id === "number" ||
2307
- typeof id === "string") ? id : JSON.stringify(id));
2335
+ return "".concat(__typename, ":").concat(typeof id === "number" || typeof id === "string"
2336
+ ? id
2337
+ : JSON.stringify(id));
2308
2338
  }
2309
2339
  }
2310
2340
  }
@@ -2334,13 +2364,15 @@ function fieldNameFromStoreName(storeFieldName) {
2334
2364
  function selectionSetMatchesResult(selectionSet, result, variables) {
2335
2365
  if (isNonNullObject(result)) {
2336
2366
  return isArray(result)
2337
- ? result.every(function (item) { return selectionSetMatchesResult(selectionSet, item, variables); })
2367
+ ? result.every(function (item) {
2368
+ return selectionSetMatchesResult(selectionSet, item, variables);
2369
+ })
2338
2370
  : selectionSet.selections.every(function (field) {
2339
2371
  if (isField(field) && shouldInclude(field, variables)) {
2340
2372
  var key = resultKeyNameFromField(field);
2341
- return hasOwn.call(result, key) &&
2373
+ return (hasOwn.call(result, key) &&
2342
2374
  (!field.selectionSet ||
2343
- selectionSetMatchesResult(field.selectionSet, result[key], variables));
2375
+ selectionSetMatchesResult(field.selectionSet, result[key], variables)));
2344
2376
  }
2345
2377
  return true;
2346
2378
  });
@@ -2348,12 +2380,10 @@ function selectionSetMatchesResult(selectionSet, result, variables) {
2348
2380
  return false;
2349
2381
  }
2350
2382
  function storeValueIsStoreObject(value) {
2351
- return isNonNullObject(value) &&
2352
- !isReference(value) &&
2353
- !isArray(value);
2383
+ return isNonNullObject(value) && !isReference(value) && !isArray(value);
2354
2384
  }
2355
2385
  function makeProcessedFieldsMerger() {
2356
- return new DeepMerger;
2386
+ return new DeepMerger();
2357
2387
  }
2358
2388
  function extractFragmentContext(document, fragments) {
2359
2389
  var fragmentMap = createFragmentMap(getFragmentDefinitions(document));
@@ -2380,9 +2410,11 @@ var EntityStore = (function () {
2380
2410
  this.data = Object.create(null);
2381
2411
  this.rootIds = Object.create(null);
2382
2412
  this.refs = Object.create(null);
2383
- this.getFieldValue = function (objectOrReference, storeFieldName) { return maybeDeepFreeze(isReference(objectOrReference)
2384
- ? _this.get(objectOrReference.__ref, storeFieldName)
2385
- : objectOrReference && objectOrReference[storeFieldName]); };
2413
+ this.getFieldValue = function (objectOrReference, storeFieldName) {
2414
+ return maybeDeepFreeze(isReference(objectOrReference)
2415
+ ? _this.get(objectOrReference.__ref, storeFieldName)
2416
+ : objectOrReference && objectOrReference[storeFieldName]);
2417
+ };
2386
2418
  this.canRead = function (objOrRef) {
2387
2419
  return isReference(objOrRef)
2388
2420
  ? _this.has(objOrRef.__ref)
@@ -2447,12 +2479,8 @@ var EntityStore = (function () {
2447
2479
  older = older.__ref;
2448
2480
  if (isReference(newer))
2449
2481
  newer = newer.__ref;
2450
- var existing = typeof older === "string"
2451
- ? this.lookup(dataId = older)
2452
- : older;
2453
- var incoming = typeof newer === "string"
2454
- ? this.lookup(dataId = newer)
2455
- : newer;
2482
+ var existing = typeof older === "string" ? this.lookup((dataId = older)) : older;
2483
+ var incoming = typeof newer === "string" ? this.lookup((dataId = newer)) : newer;
2456
2484
  if (!incoming)
2457
2485
  return;
2458
2486
  invariant(typeof dataId === "string", 1);
@@ -2465,7 +2493,8 @@ var EntityStore = (function () {
2465
2493
  if (!existing)
2466
2494
  fieldsToDirty_1.__exists = 1;
2467
2495
  Object.keys(incoming).forEach(function (storeFieldName) {
2468
- if (!existing || existing[storeFieldName] !== merged[storeFieldName]) {
2496
+ if (!existing ||
2497
+ existing[storeFieldName] !== merged[storeFieldName]) {
2469
2498
  fieldsToDirty_1[storeFieldName] = 1;
2470
2499
  var fieldName = fieldNameFromStoreName(storeFieldName);
2471
2500
  if (fieldName !== storeFieldName &&
@@ -2482,7 +2511,9 @@ var EntityStore = (function () {
2482
2511
  this.policies.rootTypenamesById[dataId] === merged.__typename) {
2483
2512
  delete fieldsToDirty_1.__typename;
2484
2513
  }
2485
- Object.keys(fieldsToDirty_1).forEach(function (fieldName) { return _this.group.dirty(dataId, fieldName); });
2514
+ Object.keys(fieldsToDirty_1).forEach(function (fieldName) {
2515
+ return _this.group.dirty(dataId, fieldName);
2516
+ });
2486
2517
  }
2487
2518
  }
2488
2519
  };
@@ -2499,10 +2530,14 @@ var EntityStore = (function () {
2499
2530
  isReference: isReference,
2500
2531
  toReference: this.toReference,
2501
2532
  canRead: this.canRead,
2502
- readField: function (fieldNameOrOptions, from) { return _this.policies.readField(typeof fieldNameOrOptions === "string" ? {
2503
- fieldName: fieldNameOrOptions,
2504
- from: from || makeReference(dataId),
2505
- } : fieldNameOrOptions, { store: _this }); },
2533
+ readField: function (fieldNameOrOptions, from) {
2534
+ return _this.policies.readField(typeof fieldNameOrOptions === "string"
2535
+ ? {
2536
+ fieldName: fieldNameOrOptions,
2537
+ from: from || makeReference(dataId),
2538
+ }
2539
+ : fieldNameOrOptions, { store: _this });
2540
+ },
2506
2541
  };
2507
2542
  Object.keys(storeObject).forEach(function (storeFieldName) {
2508
2543
  var fieldName = fieldNameFromStoreName(storeFieldName);
@@ -2513,8 +2548,9 @@ var EntityStore = (function () {
2513
2548
  ? fields
2514
2549
  : fields[storeFieldName] || fields[fieldName];
2515
2550
  if (modify) {
2516
- var newValue = modify === delModifier ? DELETE :
2517
- modify(maybeDeepFreeze(fieldValue), tslib.__assign(tslib.__assign({}, sharedDetails_1), { fieldName: fieldName, storeFieldName: storeFieldName, storage: _this.getStorage(dataId, storeFieldName) }));
2551
+ var newValue = modify === delModifier
2552
+ ? DELETE
2553
+ : modify(maybeDeepFreeze(fieldValue), tslib.__assign(tslib.__assign({}, sharedDetails_1), { fieldName: fieldName, storeFieldName: storeFieldName, storage: _this.getStorage(dataId, storeFieldName) }));
2518
2554
  if (newValue === INVALIDATE) {
2519
2555
  _this.group.dirty(dataId, storeFieldName);
2520
2556
  }
@@ -2556,9 +2592,10 @@ var EntityStore = (function () {
2556
2592
  var storeFieldName = fieldName && args
2557
2593
  ? this.policies.getStoreFieldName({ typename: typename, fieldName: fieldName, args: args })
2558
2594
  : fieldName;
2559
- return this.modify(dataId, storeFieldName ? (_a = {},
2560
- _a[storeFieldName] = delModifier,
2561
- _a) : delModifier);
2595
+ return this.modify(dataId, storeFieldName
2596
+ ? (_a = {},
2597
+ _a[storeFieldName] = delModifier,
2598
+ _a) : delModifier);
2562
2599
  }
2563
2600
  return false;
2564
2601
  };
@@ -2612,7 +2649,7 @@ var EntityStore = (function () {
2612
2649
  }
2613
2650
  };
2614
2651
  EntityStore.prototype.retain = function (rootId) {
2615
- return this.rootIds[rootId] = (this.rootIds[rootId] || 0) + 1;
2652
+ return (this.rootIds[rootId] = (this.rootIds[rootId] || 0) + 1);
2616
2653
  };
2617
2654
  EntityStore.prototype.release = function (rootId) {
2618
2655
  if (this.rootIds[rootId] > 0) {
@@ -2655,7 +2692,7 @@ var EntityStore = (function () {
2655
2692
  };
2656
2693
  EntityStore.prototype.findChildRefIds = function (dataId) {
2657
2694
  if (!hasOwn.call(this.refs, dataId)) {
2658
- var found_1 = this.refs[dataId] = Object.create(null);
2695
+ var found_1 = (this.refs[dataId] = Object.create(null));
2659
2696
  var root = this.data[dataId];
2660
2697
  if (!root)
2661
2698
  return found_1;
@@ -2713,7 +2750,7 @@ var CacheGroup = (function () {
2713
2750
  return CacheGroup;
2714
2751
  }());
2715
2752
  function makeDepKey(dataId, storeFieldName) {
2716
- return storeFieldName + '#' + dataId;
2753
+ return storeFieldName + "#" + dataId;
2717
2754
  }
2718
2755
  function maybeDependOnExistenceOfEntity(store, entityId) {
2719
2756
  if (supportsResultCaching(store)) {
@@ -2796,7 +2833,8 @@ var Layer = (function (_super) {
2796
2833
  };
2797
2834
  Layer.prototype.findChildRefIds = function (dataId) {
2798
2835
  var fromParent = this.parent.findChildRefIds(dataId);
2799
- return hasOwn.call(this.data, dataId) ? tslib.__assign(tslib.__assign({}, fromParent), _super.prototype.findChildRefIds.call(this, dataId)) : fromParent;
2836
+ return hasOwn.call(this.data, dataId)
2837
+ ? tslib.__assign(tslib.__assign({}, fromParent), _super.prototype.findChildRefIds.call(this, dataId)) : fromParent;
2800
2838
  };
2801
2839
  Layer.prototype.getStorage = function () {
2802
2840
  var p = this.parent;
@@ -2869,7 +2907,7 @@ var ObjectCanon = (function () {
2869
2907
  var array = value.map(this.admit, this);
2870
2908
  var node = this.pool.lookupArray(array);
2871
2909
  if (!node.array) {
2872
- this.known.add(node.array = array);
2910
+ this.known.add((node.array = array));
2873
2911
  if (globalThis.__DEV__ !== false) {
2874
2912
  Object.freeze(array);
2875
2913
  }
@@ -2890,7 +2928,7 @@ var ObjectCanon = (function () {
2890
2928
  });
2891
2929
  var node = this.pool.lookupArray(array_1);
2892
2930
  if (!node.object) {
2893
- var obj_1 = node.object = Object.create(proto_1);
2931
+ var obj_1 = (node.object = Object.create(proto_1));
2894
2932
  this.known.add(obj_1);
2895
2933
  keys.sorted.forEach(function (key, i) {
2896
2934
  obj_1[key] = array_1[firstValueIndex_1 + i];
@@ -2912,7 +2950,7 @@ var ObjectCanon = (function () {
2912
2950
  keys.sort();
2913
2951
  var json = JSON.stringify(keys);
2914
2952
  if (!(node.keys = this.keysByJSON.get(json))) {
2915
- this.keysByJSON.set(json, node.keys = { sorted: keys, json: json });
2953
+ this.keysByJSON.set(json, (node.keys = { sorted: keys, json: json }));
2916
2954
  }
2917
2955
  }
2918
2956
  return node.keys;
@@ -2927,7 +2965,7 @@ var canonicalStringify = Object.assign(function (value) {
2927
2965
  var canonical = stringifyCanon.admit(value);
2928
2966
  var json = stringifyCache.get(canonical);
2929
2967
  if (json === void 0) {
2930
- stringifyCache.set(canonical, json = JSON.stringify(canonical));
2968
+ stringifyCache.set(canonical, (json = JSON.stringify(canonical)));
2931
2969
  }
2932
2970
  return json;
2933
2971
  }
@@ -2938,7 +2976,7 @@ var canonicalStringify = Object.assign(function (value) {
2938
2976
  var stringifyCanon;
2939
2977
  var stringifyCache;
2940
2978
  function resetCanonicalStringify() {
2941
- stringifyCanon = new ObjectCanon;
2979
+ stringifyCanon = new ObjectCanon();
2942
2980
  stringifyCache = new (canUseWeakMap ? WeakMap : Map)();
2943
2981
  }
2944
2982
 
@@ -2958,7 +2996,7 @@ var StoreReader = (function () {
2958
2996
  addTypename: config.addTypename !== false,
2959
2997
  canonizeResults: shouldCanonizeResults(config),
2960
2998
  });
2961
- this.canon = config.canon || new ObjectCanon;
2999
+ this.canon = config.canon || new ObjectCanon();
2962
3000
  this.executeSelectionSet = optimism.wrap(function (options) {
2963
3001
  var _a;
2964
3002
  var canonizeResults = options.context.canonizeResults;
@@ -2980,7 +3018,7 @@ var StoreReader = (function () {
2980
3018
  if (supportsResultCaching(context.store)) {
2981
3019
  return context.store.makeCacheKey(selectionSet, isReference(parent) ? parent.__ref : parent, context.varString, canonizeResults);
2982
3020
  }
2983
- }
3021
+ },
2984
3022
  });
2985
3023
  this.executeSubSelectedArray = optimism.wrap(function (options) {
2986
3024
  maybeDependOnExistenceOfEntity(options.context.store, options.enclosingRef.__ref);
@@ -2992,14 +3030,14 @@ var StoreReader = (function () {
2992
3030
  if (supportsResultCaching(context.store)) {
2993
3031
  return context.store.makeCacheKey(field, array, context.varString);
2994
3032
  }
2995
- }
3033
+ },
2996
3034
  });
2997
3035
  }
2998
3036
  StoreReader.prototype.resetCanon = function () {
2999
- this.canon = new ObjectCanon;
3037
+ this.canon = new ObjectCanon();
3000
3038
  };
3001
3039
  StoreReader.prototype.diffQueryAgainstStore = function (_a) {
3002
- var store = _a.store, query = _a.query, _b = _a.rootId, rootId = _b === void 0 ? 'ROOT_QUERY' : _b, variables = _a.variables, _c = _a.returnPartialData, returnPartialData = _c === void 0 ? true : _c, _d = _a.canonizeResults, canonizeResults = _d === void 0 ? this.config.canonizeResults : _d;
3040
+ var store = _a.store, query = _a.query, _b = _a.rootId, rootId = _b === void 0 ? "ROOT_QUERY" : _b, variables = _a.variables, _c = _a.returnPartialData, returnPartialData = _c === void 0 ? true : _c, _d = _a.canonizeResults, canonizeResults = _d === void 0 ? this.config.canonizeResults : _d;
3003
3041
  var policies = this.config.cache.policies;
3004
3042
  variables = tslib.__assign(tslib.__assign({}, getDefaultValues(getQueryDefinition(query))), variables);
3005
3043
  var rootRef = makeReference(rootId);
@@ -3011,7 +3049,9 @@ var StoreReader = (function () {
3011
3049
  });
3012
3050
  var missing;
3013
3051
  if (execResult.missing) {
3014
- missing = [new MissingFieldError(firstMissing(execResult.missing), execResult.missing, query, variables)];
3052
+ missing = [
3053
+ new MissingFieldError(firstMissing(execResult.missing), execResult.missing, query, variables),
3054
+ ];
3015
3055
  if (!returnPartialData) {
3016
3056
  throw missing[0];
3017
3057
  }
@@ -3056,7 +3096,9 @@ var StoreReader = (function () {
3056
3096
  function handleMissing(result, resultName) {
3057
3097
  var _a;
3058
3098
  if (result.missing) {
3059
- missing = missingMerger.merge(missing, (_a = {}, _a[resultName] = result.missing, _a));
3099
+ missing = missingMerger.merge(missing, (_a = {},
3100
+ _a[resultName] = result.missing,
3101
+ _a));
3060
3102
  }
3061
3103
  return result.result;
3062
3104
  }
@@ -3121,7 +3163,8 @@ var StoreReader = (function () {
3121
3163
  var finalResult = { result: result, missing: missing };
3122
3164
  var frozen = context.canonizeResults
3123
3165
  ? this.canon.admit(finalResult)
3124
- : maybeDeepFreeze(finalResult);
3166
+ :
3167
+ maybeDeepFreeze(finalResult);
3125
3168
  if (frozen.result) {
3126
3169
  this.knownResults.set(frozen.result, selectionSet);
3127
3170
  }
@@ -3208,10 +3251,10 @@ var cacheInfoMap = new WeakMap();
3208
3251
  function getCacheInfo(cache) {
3209
3252
  var info = cacheInfoMap.get(cache);
3210
3253
  if (!info) {
3211
- cacheInfoMap.set(cache, info = {
3212
- vars: new Set,
3254
+ cacheInfoMap.set(cache, (info = {
3255
+ vars: new Set(),
3213
3256
  dep: optimism.dep(),
3214
- });
3257
+ }));
3215
3258
  }
3216
3259
  return info;
3217
3260
  }
@@ -3252,11 +3295,11 @@ function makeVar(value) {
3252
3295
  listeners.delete(listener);
3253
3296
  };
3254
3297
  };
3255
- var attach = rv.attachCache = function (cache) {
3298
+ var attach = (rv.attachCache = function (cache) {
3256
3299
  caches.add(cache);
3257
3300
  getCacheInfo(cache).vars.add(rv);
3258
3301
  return rv;
3259
- };
3302
+ });
3260
3303
  rv.forgetCache = function (cache) { return caches.delete(cache); };
3261
3304
  return rv;
3262
3305
  }
@@ -3269,64 +3312,68 @@ function broadcast(cache) {
3269
3312
  var specifierInfoCache = Object.create(null);
3270
3313
  function lookupSpecifierInfo(spec) {
3271
3314
  var cacheKey = JSON.stringify(spec);
3272
- return specifierInfoCache[cacheKey] ||
3273
- (specifierInfoCache[cacheKey] = Object.create(null));
3315
+ return (specifierInfoCache[cacheKey] ||
3316
+ (specifierInfoCache[cacheKey] = Object.create(null)));
3274
3317
  }
3275
3318
  function keyFieldsFnFromSpecifier(specifier) {
3276
3319
  var info = lookupSpecifierInfo(specifier);
3277
- return info.keyFieldsFn || (info.keyFieldsFn = function (object, context) {
3278
- var extract = function (from, key) { return context.readField(key, from); };
3279
- var keyObject = context.keyObject = collectSpecifierPaths(specifier, function (schemaKeyPath) {
3280
- var extracted = extractKeyPath(context.storeObject, schemaKeyPath, extract);
3281
- if (extracted === void 0 &&
3282
- object !== context.storeObject &&
3283
- hasOwn.call(object, schemaKeyPath[0])) {
3284
- extracted = extractKeyPath(object, schemaKeyPath, extractKey);
3285
- }
3286
- invariant(extracted !== void 0, 2, schemaKeyPath.join('.'), object);
3287
- return extracted;
3288
- });
3289
- return "".concat(context.typename, ":").concat(JSON.stringify(keyObject));
3290
- });
3320
+ return (info.keyFieldsFn || (info.keyFieldsFn = function (object, context) {
3321
+ var extract = function (from, key) {
3322
+ return context.readField(key, from);
3323
+ };
3324
+ var keyObject = (context.keyObject = collectSpecifierPaths(specifier, function (schemaKeyPath) {
3325
+ var extracted = extractKeyPath(context.storeObject, schemaKeyPath, extract);
3326
+ if (extracted === void 0 &&
3327
+ object !== context.storeObject &&
3328
+ hasOwn.call(object, schemaKeyPath[0])) {
3329
+ extracted = extractKeyPath(object, schemaKeyPath, extractKey);
3330
+ }
3331
+ invariant(extracted !== void 0, 2, schemaKeyPath.join("."), object);
3332
+ return extracted;
3333
+ }));
3334
+ return "".concat(context.typename, ":").concat(JSON.stringify(keyObject));
3335
+ }));
3291
3336
  }
3292
3337
  function keyArgsFnFromSpecifier(specifier) {
3293
3338
  var info = lookupSpecifierInfo(specifier);
3294
- return info.keyArgsFn || (info.keyArgsFn = function (args, _a) {
3295
- var field = _a.field, variables = _a.variables, fieldName = _a.fieldName;
3296
- var collected = collectSpecifierPaths(specifier, function (keyPath) {
3297
- var firstKey = keyPath[0];
3298
- var firstChar = firstKey.charAt(0);
3299
- if (firstChar === "@") {
3300
- if (field && isNonEmptyArray(field.directives)) {
3301
- var directiveName_1 = firstKey.slice(1);
3302
- var d = field.directives.find(function (d) { return d.name.value === directiveName_1; });
3303
- var directiveArgs = d && argumentsObjectFromField(d, variables);
3304
- return directiveArgs && extractKeyPath(directiveArgs, keyPath.slice(1));
3339
+ return (info.keyArgsFn ||
3340
+ (info.keyArgsFn = function (args, _a) {
3341
+ var field = _a.field, variables = _a.variables, fieldName = _a.fieldName;
3342
+ var collected = collectSpecifierPaths(specifier, function (keyPath) {
3343
+ var firstKey = keyPath[0];
3344
+ var firstChar = firstKey.charAt(0);
3345
+ if (firstChar === "@") {
3346
+ if (field && isNonEmptyArray(field.directives)) {
3347
+ var directiveName_1 = firstKey.slice(1);
3348
+ var d = field.directives.find(function (d) { return d.name.value === directiveName_1; });
3349
+ var directiveArgs = d && argumentsObjectFromField(d, variables);
3350
+ return (directiveArgs &&
3351
+ extractKeyPath(directiveArgs, keyPath.slice(1)));
3352
+ }
3353
+ return;
3305
3354
  }
3306
- return;
3307
- }
3308
- if (firstChar === "$") {
3309
- var variableName = firstKey.slice(1);
3310
- if (variables && hasOwn.call(variables, variableName)) {
3311
- var varKeyPath = keyPath.slice(0);
3312
- varKeyPath[0] = variableName;
3313
- return extractKeyPath(variables, varKeyPath);
3355
+ if (firstChar === "$") {
3356
+ var variableName = firstKey.slice(1);
3357
+ if (variables && hasOwn.call(variables, variableName)) {
3358
+ var varKeyPath = keyPath.slice(0);
3359
+ varKeyPath[0] = variableName;
3360
+ return extractKeyPath(variables, varKeyPath);
3361
+ }
3362
+ return;
3314
3363
  }
3315
- return;
3316
- }
3317
- if (args) {
3318
- return extractKeyPath(args, keyPath);
3364
+ if (args) {
3365
+ return extractKeyPath(args, keyPath);
3366
+ }
3367
+ });
3368
+ var suffix = JSON.stringify(collected);
3369
+ if (args || suffix !== "{}") {
3370
+ fieldName += ":" + suffix;
3319
3371
  }
3320
- });
3321
- var suffix = JSON.stringify(collected);
3322
- if (args || suffix !== "{}") {
3323
- fieldName += ":" + suffix;
3324
- }
3325
- return fieldName;
3326
- });
3372
+ return fieldName;
3373
+ }));
3327
3374
  }
3328
3375
  function collectSpecifierPaths(specifier, extractor) {
3329
- var merger = new DeepMerger;
3376
+ var merger = new DeepMerger();
3330
3377
  return getSpecifierPaths(specifier).reduce(function (collected, path) {
3331
3378
  var _a;
3332
3379
  var toMerge = extractor(path);
@@ -3342,7 +3389,7 @@ function collectSpecifierPaths(specifier, extractor) {
3342
3389
  function getSpecifierPaths(spec) {
3343
3390
  var info = lookupSpecifierInfo(spec);
3344
3391
  if (!info.paths) {
3345
- var paths_1 = info.paths = [];
3392
+ var paths_1 = (info.paths = []);
3346
3393
  var currentPath_1 = [];
3347
3394
  spec.forEach(function (s, i) {
3348
3395
  if (isArray(s)) {
@@ -3376,15 +3423,20 @@ function normalize(value) {
3376
3423
  if (isArray(value)) {
3377
3424
  return value.map(normalize);
3378
3425
  }
3379
- return collectSpecifierPaths(Object.keys(value).sort(), function (path) { return extractKeyPath(value, path); });
3426
+ return collectSpecifierPaths(Object.keys(value).sort(), function (path) {
3427
+ return extractKeyPath(value, path);
3428
+ });
3380
3429
  }
3381
3430
  return value;
3382
3431
  }
3383
3432
 
3384
3433
  getStoreKeyName.setStringify(canonicalStringify);
3385
3434
  function argsFromFieldSpecifier(spec) {
3386
- return spec.args !== void 0 ? spec.args :
3387
- spec.field ? argumentsObjectFromField(spec.field, spec.variables) : null;
3435
+ return spec.args !== void 0
3436
+ ? spec.args
3437
+ : spec.field
3438
+ ? argumentsObjectFromField(spec.field, spec.variables)
3439
+ : null;
3388
3440
  }
3389
3441
  var nullKeyFieldsFn = function () { return void 0; };
3390
3442
  var simpleKeyArgsFn = function (_args, context) { return context.fieldName; };
@@ -3418,22 +3470,24 @@ var Policies = (function () {
3418
3470
  Policies.prototype.identify = function (object, partialContext) {
3419
3471
  var _a;
3420
3472
  var policies = this;
3421
- var typename = partialContext && (partialContext.typename ||
3422
- ((_a = partialContext.storeObject) === null || _a === void 0 ? void 0 : _a.__typename)) || object.__typename;
3473
+ var typename = (partialContext &&
3474
+ (partialContext.typename || ((_a = partialContext.storeObject) === null || _a === void 0 ? void 0 : _a.__typename))) ||
3475
+ object.__typename;
3423
3476
  if (typename === this.rootTypenamesById.ROOT_QUERY) {
3424
3477
  return ["ROOT_QUERY"];
3425
3478
  }
3426
- var storeObject = partialContext && partialContext.storeObject || object;
3427
- var context = tslib.__assign(tslib.__assign({}, partialContext), { typename: typename, storeObject: storeObject, readField: partialContext && partialContext.readField || function () {
3428
- var options = normalizeReadFieldOptions(arguments, storeObject);
3429
- return policies.readField(options, {
3430
- store: policies.cache["data"],
3431
- variables: options.variables,
3432
- });
3433
- } });
3479
+ var storeObject = (partialContext && partialContext.storeObject) || object;
3480
+ var context = tslib.__assign(tslib.__assign({}, partialContext), { typename: typename, storeObject: storeObject, readField: (partialContext && partialContext.readField) ||
3481
+ function () {
3482
+ var options = normalizeReadFieldOptions(arguments, storeObject);
3483
+ return policies.readField(options, {
3484
+ store: policies.cache["data"],
3485
+ variables: options.variables,
3486
+ });
3487
+ } });
3434
3488
  var id;
3435
3489
  var policy = typename && this.getTypePolicy(typename);
3436
- var keyFn = policy && policy.keyFn || this.config.dataIdFromObject;
3490
+ var keyFn = (policy && policy.keyFn) || this.config.dataIdFromObject;
3437
3491
  while (keyFn) {
3438
3492
  var specifierOrId = keyFn(tslib.__assign(tslib.__assign({}, object), storeObject), context);
3439
3493
  if (isArray(specifierOrId)) {
@@ -3471,17 +3525,28 @@ var Policies = (function () {
3471
3525
  var keyFields = incoming.keyFields, fields = incoming.fields;
3472
3526
  function setMerge(existing, merge) {
3473
3527
  existing.merge =
3474
- typeof merge === "function" ? merge :
3475
- merge === true ? mergeTrueFn :
3476
- merge === false ? mergeFalseFn :
3477
- existing.merge;
3528
+ typeof merge === "function"
3529
+ ? merge
3530
+ :
3531
+ merge === true
3532
+ ? mergeTrueFn
3533
+ :
3534
+ merge === false
3535
+ ? mergeFalseFn
3536
+ : existing.merge;
3478
3537
  }
3479
3538
  setMerge(existing, incoming.merge);
3480
3539
  existing.keyFn =
3481
- keyFields === false ? nullKeyFieldsFn :
3482
- isArray(keyFields) ? keyFieldsFnFromSpecifier(keyFields) :
3483
- typeof keyFields === "function" ? keyFields :
3484
- existing.keyFn;
3540
+ keyFields === false
3541
+ ? nullKeyFieldsFn
3542
+ :
3543
+ isArray(keyFields)
3544
+ ? keyFieldsFnFromSpecifier(keyFields)
3545
+ :
3546
+ typeof keyFields === "function"
3547
+ ? keyFields
3548
+ :
3549
+ existing.keyFn;
3485
3550
  if (fields) {
3486
3551
  Object.keys(fields).forEach(function (fieldName) {
3487
3552
  var existing = _this.getFieldPolicy(typename, fieldName, true);
@@ -3492,10 +3557,16 @@ var Policies = (function () {
3492
3557
  else {
3493
3558
  var keyArgs = incoming.keyArgs, read = incoming.read, merge = incoming.merge;
3494
3559
  existing.keyFn =
3495
- keyArgs === false ? simpleKeyArgsFn :
3496
- isArray(keyArgs) ? keyArgsFnFromSpecifier(keyArgs) :
3497
- typeof keyArgs === "function" ? keyArgs :
3498
- existing.keyFn;
3560
+ keyArgs === false
3561
+ ? simpleKeyArgsFn
3562
+ :
3563
+ isArray(keyArgs)
3564
+ ? keyArgsFnFromSpecifier(keyArgs)
3565
+ :
3566
+ typeof keyArgs === "function"
3567
+ ? keyArgs
3568
+ :
3569
+ existing.keyFn;
3499
3570
  if (typeof read === "function") {
3500
3571
  existing.read = read;
3501
3572
  }
@@ -3536,7 +3607,7 @@ var Policies = (function () {
3536
3607
  Policies.prototype.getTypePolicy = function (typename) {
3537
3608
  var _this = this;
3538
3609
  if (!hasOwn.call(this.typePolicies, typename)) {
3539
- var policy_1 = this.typePolicies[typename] = Object.create(null);
3610
+ var policy_1 = (this.typePolicies[typename] = Object.create(null));
3540
3611
  policy_1.fields = Object.create(null);
3541
3612
  var supertypes_1 = this.supertypeMap.get(typename);
3542
3613
  if (!supertypes_1 && this.fuzzySubtypes.size) {
@@ -3545,7 +3616,9 @@ var Policies = (function () {
3545
3616
  if (regExp.test(typename)) {
3546
3617
  var fuzzySupertypes = _this.supertypeMap.get(fuzzy);
3547
3618
  if (fuzzySupertypes) {
3548
- fuzzySupertypes.forEach(function (supertype) { return supertypes_1.add(supertype); });
3619
+ fuzzySupertypes.forEach(function (supertype) {
3620
+ return supertypes_1.add(supertype);
3621
+ });
3549
3622
  }
3550
3623
  }
3551
3624
  });
@@ -3569,13 +3642,14 @@ var Policies = (function () {
3569
3642
  Policies.prototype.getFieldPolicy = function (typename, fieldName, createIfMissing) {
3570
3643
  if (typename) {
3571
3644
  var fieldPolicies = this.getTypePolicy(typename).fields;
3572
- return fieldPolicies[fieldName] || (createIfMissing && (fieldPolicies[fieldName] = Object.create(null)));
3645
+ return (fieldPolicies[fieldName] ||
3646
+ (createIfMissing && (fieldPolicies[fieldName] = Object.create(null))));
3573
3647
  }
3574
3648
  };
3575
3649
  Policies.prototype.getSupertypeSet = function (subtype, createIfMissing) {
3576
3650
  var supertypeSet = this.supertypeMap.get(subtype);
3577
3651
  if (!supertypeSet && createIfMissing) {
3578
- this.supertypeMap.set(subtype, supertypeSet = new Set());
3652
+ this.supertypeMap.set(subtype, (supertypeSet = new Set()));
3579
3653
  }
3580
3654
  return supertypeSet;
3581
3655
  };
@@ -3588,8 +3662,7 @@ var Policies = (function () {
3588
3662
  var supertype = fragment.typeCondition.name.value;
3589
3663
  if (typename === supertype)
3590
3664
  return true;
3591
- if (this.usingPossibleTypes &&
3592
- this.supertypeMap.has(supertype)) {
3665
+ if (this.usingPossibleTypes && this.supertypeMap.has(supertype)) {
3593
3666
  var typenameSupertypeSet = this.getSupertypeSet(typename, true);
3594
3667
  var workQueue_1 = [typenameSupertypeSet];
3595
3668
  var maybeEnqueue_1 = function (subtype) {
@@ -3691,7 +3764,10 @@ var Policies = (function () {
3691
3764
  var readOptions = makeFieldFunctionOptions(this, objectOrReference, options, context, context.store.getStorage(isReference(objectOrReference)
3692
3765
  ? objectOrReference.__ref
3693
3766
  : objectOrReference, storeFieldName));
3694
- return cacheSlot.withValue(this.cache, read, [existing, readOptions]);
3767
+ return cacheSlot.withValue(this.cache, read, [
3768
+ existing,
3769
+ readOptions,
3770
+ ]);
3695
3771
  }
3696
3772
  return existing;
3697
3773
  };
@@ -3719,7 +3795,12 @@ var Policies = (function () {
3719
3795
  if (context.overwrite) {
3720
3796
  existing = void 0;
3721
3797
  }
3722
- return merge(existing, incoming, makeFieldFunctionOptions(this, void 0, { typename: typename, fieldName: field.name.value, field: field, variables: context.variables }, context, storage || Object.create(null)));
3798
+ return merge(existing, incoming, makeFieldFunctionOptions(this, void 0, {
3799
+ typename: typename,
3800
+ fieldName: field.name.value,
3801
+ field: field,
3802
+ variables: context.variables,
3803
+ }, context, storage || Object.create(null)));
3723
3804
  };
3724
3805
  return Policies;
3725
3806
  }());
@@ -3773,21 +3854,18 @@ function makeMergeObjectsFunction(store) {
3773
3854
  if (isArray(existing) || isArray(incoming)) {
3774
3855
  throw newInvariantError(6);
3775
3856
  }
3776
- if (isNonNullObject(existing) &&
3777
- isNonNullObject(incoming)) {
3857
+ if (isNonNullObject(existing) && isNonNullObject(incoming)) {
3778
3858
  var eType = store.getFieldValue(existing, "__typename");
3779
3859
  var iType = store.getFieldValue(incoming, "__typename");
3780
3860
  var typesDiffer = eType && iType && eType !== iType;
3781
3861
  if (typesDiffer) {
3782
3862
  return incoming;
3783
3863
  }
3784
- if (isReference(existing) &&
3785
- storeValueIsStoreObject(incoming)) {
3864
+ if (isReference(existing) && storeValueIsStoreObject(incoming)) {
3786
3865
  store.merge(existing.__ref, incoming);
3787
3866
  return existing;
3788
3867
  }
3789
- if (storeValueIsStoreObject(existing) &&
3790
- isReference(incoming)) {
3868
+ if (storeValueIsStoreObject(existing) && isReference(incoming)) {
3791
3869
  store.merge(existing, incoming.__ref);
3792
3870
  return incoming;
3793
3871
  }
@@ -3804,8 +3882,10 @@ function getContextFlavor(context, clientOnly, deferred) {
3804
3882
  var key = "".concat(clientOnly).concat(deferred);
3805
3883
  var flavored = context.flavors.get(key);
3806
3884
  if (!flavored) {
3807
- context.flavors.set(key, flavored = (context.clientOnly === clientOnly &&
3808
- context.deferred === deferred) ? context : tslib.__assign(tslib.__assign({}, context), { clientOnly: clientOnly, deferred: deferred }));
3885
+ context.flavors.set(key, (flavored =
3886
+ context.clientOnly === clientOnly && context.deferred === deferred
3887
+ ? context
3888
+ : tslib.__assign(tslib.__assign({}, context), { clientOnly: clientOnly, deferred: deferred })));
3809
3889
  }
3810
3890
  return flavored;
3811
3891
  }
@@ -3823,12 +3903,12 @@ var StoreWriter = (function () {
3823
3903
  variables = tslib.__assign(tslib.__assign({}, getDefaultValues(operationDefinition)), variables);
3824
3904
  var context = tslib.__assign(tslib.__assign({ store: store, written: Object.create(null), merge: function (existing, incoming) {
3825
3905
  return merger.merge(existing, incoming);
3826
- }, variables: variables, varString: canonicalStringify(variables) }, extractFragmentContext(query, this.fragments)), { overwrite: !!overwrite, incomingById: new Map, clientOnly: false, deferred: false, flavors: new Map });
3906
+ }, variables: variables, varString: canonicalStringify(variables) }, extractFragmentContext(query, this.fragments)), { overwrite: !!overwrite, incomingById: new Map(), clientOnly: false, deferred: false, flavors: new Map() });
3827
3907
  var ref = this.processSelectionSet({
3828
3908
  result: result || Object.create(null),
3829
3909
  dataId: dataId,
3830
3910
  selectionSet: operationDefinition.selectionSet,
3831
- mergeTree: { map: new Map },
3911
+ mergeTree: { map: new Map() },
3832
3912
  context: context,
3833
3913
  });
3834
3914
  if (!isReference(ref)) {
@@ -3852,7 +3932,8 @@ var StoreWriter = (function () {
3852
3932
  }
3853
3933
  });
3854
3934
  var hasSelectionSet_1 = function (storeFieldName) {
3855
- return fieldsWithSelectionSets_1[fieldNameFromStoreName(storeFieldName)] === true;
3935
+ return fieldsWithSelectionSets_1[fieldNameFromStoreName(storeFieldName)] ===
3936
+ true;
3856
3937
  };
3857
3938
  var hasMergeFunction_1 = function (storeFieldName) {
3858
3939
  var childTree = mergeTree && mergeTree.map.get(storeFieldName);
@@ -3913,8 +3994,7 @@ var StoreWriter = (function () {
3913
3994
  : context, childTree);
3914
3995
  var childTypename = void 0;
3915
3996
  if (field.selectionSet &&
3916
- (isReference(incomingValue) ||
3917
- storeValueIsStoreObject(incomingValue))) {
3997
+ (isReference(incomingValue) || storeValueIsStoreObject(incomingValue))) {
3918
3998
  childTypename = readField("__typename", incomingValue);
3919
3999
  }
3920
4000
  var merge = policies.getMergeFunction(typename, field.name.value, childTypename);
@@ -3963,7 +4043,8 @@ var StoreWriter = (function () {
3963
4043
  if (sets.indexOf(selectionSet) >= 0)
3964
4044
  return dataRef;
3965
4045
  sets.push(selectionSet);
3966
- if (this.reader && this.reader.isFresh(result, dataRef, selectionSet, context)) {
4046
+ if (this.reader &&
4047
+ this.reader.isFresh(result, dataRef, selectionSet, context)) {
3967
4048
  return dataRef;
3968
4049
  }
3969
4050
  var previous_1 = context.incomingById.get(dataId);
@@ -4056,8 +4137,10 @@ var StoreWriter = (function () {
4056
4137
  var _a;
4057
4138
  var _this = this;
4058
4139
  if (mergeTree.map.size && !isReference(incoming)) {
4059
- var e_1 = (!isArray(incoming) &&
4060
- (isReference(existing) || storeValueIsStoreObject(existing))) ? existing : void 0;
4140
+ var e_1 = !isArray(incoming) &&
4141
+ (isReference(existing) || storeValueIsStoreObject(existing))
4142
+ ? existing
4143
+ : void 0;
4061
4144
  var i_1 = incoming;
4062
4145
  if (e_1 && !getStorageArgs) {
4063
4146
  getStorageArgs = [isReference(e_1) ? e_1.__ref : e_1];
@@ -4065,7 +4148,9 @@ var StoreWriter = (function () {
4065
4148
  var changedFields_1;
4066
4149
  var getValue_1 = function (from, name) {
4067
4150
  return isArray(from)
4068
- ? (typeof name === "number" ? from[name] : void 0)
4151
+ ? typeof name === "number"
4152
+ ? from[name]
4153
+ : void 0
4069
4154
  : context.store.getFieldValue(from, String(name));
4070
4155
  };
4071
4156
  mergeTree.map.forEach(function (childTree, storeFieldName) {
@@ -4078,7 +4163,7 @@ var StoreWriter = (function () {
4078
4163
  }
4079
4164
  var aVal = _this.applyMerges(childTree, eVal, iVal, context, getStorageArgs);
4080
4165
  if (aVal !== iVal) {
4081
- changedFields_1 = changedFields_1 || new Map;
4166
+ changedFields_1 = changedFields_1 || new Map();
4082
4167
  changedFields_1.set(storeFieldName, aVal);
4083
4168
  }
4084
4169
  if (getStorageArgs) {
@@ -4103,7 +4188,7 @@ var emptyMergeTreePool = [];
4103
4188
  function getChildMergeTree(_a, name) {
4104
4189
  var map = _a.map;
4105
4190
  if (!map.has(name)) {
4106
- map.set(name, emptyMergeTreePool.pop() || { map: new Map });
4191
+ map.set(name, emptyMergeTreePool.pop() || { map: new Map() });
4107
4192
  }
4108
4193
  return map.get(name);
4109
4194
  }
@@ -4112,10 +4197,14 @@ function mergeMergeTrees(left, right) {
4112
4197
  return left;
4113
4198
  if (!left || mergeTreeIsEmpty(left))
4114
4199
  return right;
4115
- var info = left.info && right.info ? tslib.__assign(tslib.__assign({}, left.info), right.info) : left.info || right.info;
4200
+ var info = left.info && right.info
4201
+ ? tslib.__assign(tslib.__assign({}, left.info), right.info) : left.info || right.info;
4116
4202
  var needToMergeMaps = left.map.size && right.map.size;
4117
- var map = needToMergeMaps ? new Map :
4118
- left.map.size ? left.map : right.map;
4203
+ var map = needToMergeMaps
4204
+ ? new Map()
4205
+ : left.map.size
4206
+ ? left.map
4207
+ : right.map;
4119
4208
  var merged = { info: info, map: map };
4120
4209
  if (needToMergeMaps) {
4121
4210
  var remainingRightKeys_1 = new Set(right.map.keys());
@@ -4167,18 +4256,18 @@ function warnAboutDataLoss(existingRef, incomingObj, storeFieldName, store) {
4167
4256
  return;
4168
4257
  warnings.add(typeDotName);
4169
4258
  var childTypenames = [];
4170
- if (!isArray(existing) &&
4171
- !isArray(incoming)) {
4259
+ if (!isArray(existing) && !isArray(incoming)) {
4172
4260
  [existing, incoming].forEach(function (child) {
4173
4261
  var typename = store.getFieldValue(child, "__typename");
4174
- if (typeof typename === "string" &&
4175
- !childTypenames.includes(typename)) {
4262
+ if (typeof typename === "string" && !childTypenames.includes(typename)) {
4176
4263
  childTypenames.push(typename);
4177
4264
  }
4178
4265
  });
4179
4266
  }
4180
4267
  globalThis.__DEV__ !== false && invariant.warn(12, fieldName, parentType, childTypenames.length
4181
- ? "either ensure all objects of type " + childTypenames.join(" and ") + " have an ID or a custom merge function, or "
4268
+ ? "either ensure all objects of type " +
4269
+ childTypenames.join(" and ") +
4270
+ " have an ID or a custom merge function, or "
4182
4271
  : "", typeDotName, existing, incoming);
4183
4272
  }
4184
4273
 
@@ -4204,10 +4293,10 @@ var InMemoryCache = (function (_super) {
4204
4293
  return _this;
4205
4294
  }
4206
4295
  InMemoryCache.prototype.init = function () {
4207
- var rootStore = this.data = new EntityStore.Root({
4296
+ var rootStore = (this.data = new EntityStore.Root({
4208
4297
  policies: this.policies,
4209
4298
  resultCaching: this.config.resultCaching,
4210
- });
4299
+ }));
4211
4300
  this.optimisticData = rootStore.stump;
4212
4301
  this.resetResultCache();
4213
4302
  };
@@ -4215,7 +4304,7 @@ var InMemoryCache = (function (_super) {
4215
4304
  var _this = this;
4216
4305
  var previousReader = this.storeReader;
4217
4306
  var fragments = this.config.fragments;
4218
- this.storeWriter = new StoreWriter(this, this.storeReader = new StoreReader({
4307
+ this.storeWriter = new StoreWriter(this, (this.storeReader = new StoreReader({
4219
4308
  cache: this,
4220
4309
  addTypename: this.addTypename,
4221
4310
  resultCacheMaxSize: this.config.resultCacheMaxSize,
@@ -4224,7 +4313,7 @@ var InMemoryCache = (function (_super) {
4224
4313
  ? void 0
4225
4314
  : previousReader && previousReader.canon,
4226
4315
  fragments: fragments,
4227
- }), fragments);
4316
+ })), fragments);
4228
4317
  this.maybeBroadcastWatch = optimism.wrap(function (c, options) {
4229
4318
  return _this.broadcastWatch(c, options);
4230
4319
  }, {
@@ -4235,12 +4324,11 @@ var InMemoryCache = (function (_super) {
4235
4324
  var optimistic = c.optimistic, id = c.id, variables = c.variables;
4236
4325
  return store.makeCacheKey(c.query, c.callback, canonicalStringify({ optimistic: optimistic, id: id, variables: variables }));
4237
4326
  }
4238
- }
4327
+ },
4328
+ });
4329
+ new Set([this.data.group, this.optimisticData.group]).forEach(function (group) {
4330
+ return group.resetCaching();
4239
4331
  });
4240
- new Set([
4241
- this.data.group,
4242
- this.optimisticData.group,
4243
- ]).forEach(function (group) { return group.resetCaching(); });
4244
4332
  };
4245
4333
  InMemoryCache.prototype.restore = function (data) {
4246
4334
  this.init();
@@ -4255,7 +4343,7 @@ var InMemoryCache = (function (_super) {
4255
4343
  InMemoryCache.prototype.read = function (options) {
4256
4344
  var _a = options.returnPartialData, returnPartialData = _a === void 0 ? false : _a;
4257
4345
  try {
4258
- return this.storeReader.diffQueryAgainstStore(tslib.__assign(tslib.__assign({}, options), { store: options.optimistic ? this.optimisticData : this.data, config: this.config, returnPartialData: returnPartialData })).result || null;
4346
+ return (this.storeReader.diffQueryAgainstStore(tslib.__assign(tslib.__assign({}, options), { store: options.optimistic ? this.optimisticData : this.data, config: this.config, returnPartialData: returnPartialData })).result || null);
4259
4347
  }
4260
4348
  catch (e) {
4261
4349
  if (e instanceof MissingFieldError) {
@@ -4389,7 +4477,7 @@ var InMemoryCache = (function (_super) {
4389
4477
  _this.data = _this.optimisticData = layer;
4390
4478
  }
4391
4479
  try {
4392
- return updateResult = update(_this);
4480
+ return (updateResult = update(_this));
4393
4481
  }
4394
4482
  finally {
4395
4483
  --_this.txCount;
@@ -4404,7 +4492,7 @@ var InMemoryCache = (function (_super) {
4404
4492
  return false;
4405
4493
  } }));
4406
4494
  }
4407
- if (typeof optimistic === 'string') {
4495
+ if (typeof optimistic === "string") {
4408
4496
  this.optimisticData = this.optimisticData.addLayer(optimistic, perform);
4409
4497
  }
4410
4498
  else if (optimistic === false) {
@@ -4436,7 +4524,7 @@ var InMemoryCache = (function (_super) {
4436
4524
  InMemoryCache.prototype.performTransaction = function (update, optimisticId) {
4437
4525
  return this.batch({
4438
4526
  update: update,
4439
- optimistic: optimisticId || (optimisticId !== null),
4527
+ optimistic: optimisticId || optimisticId !== null,
4440
4528
  });
4441
4529
  };
4442
4530
  InMemoryCache.prototype.transformDocument = function (document) {
@@ -4450,9 +4538,7 @@ var InMemoryCache = (function (_super) {
4450
4538
  };
4451
4539
  InMemoryCache.prototype.addFragmentsToDocument = function (document) {
4452
4540
  var fragments = this.config.fragments;
4453
- return fragments
4454
- ? fragments.transform(document)
4455
- : document;
4541
+ return fragments ? fragments.transform(document) : document;
4456
4542
  };
4457
4543
  InMemoryCache.prototype.addTypenameToDocument = function (document) {
4458
4544
  if (this.addTypename) {
@@ -4464,8 +4550,7 @@ var InMemoryCache = (function (_super) {
4464
4550
  var lastDiff = c.lastDiff;
4465
4551
  var diff = this.diff(c);
4466
4552
  if (options) {
4467
- if (c.optimistic &&
4468
- typeof options.optimistic === "string") {
4553
+ if (c.optimistic && typeof options.optimistic === "string") {
4469
4554
  diff.fromOptimisticTransaction = true;
4470
4555
  }
4471
4556
  if (options.onWatchUpdated &&
@@ -4474,7 +4559,7 @@ var InMemoryCache = (function (_super) {
4474
4559
  }
4475
4560
  }
4476
4561
  if (!lastDiff || !equal.equal(lastDiff.result, diff.result)) {
4477
- c.callback(c.lastDiff = diff, lastDiff);
4562
+ c.callback((c.lastDiff = diff), lastDiff);
4478
4563
  }
4479
4564
  };
4480
4565
  return InMemoryCache;
@@ -4600,7 +4685,9 @@ var ObservableQuery = (function (_super) {
4600
4685
  _this.waitForOwnResult = skipCacheDataFor(options.fetchPolicy);
4601
4686
  _this.isTornDown = false;
4602
4687
  var _b = queryManager.defaultOptions.watchQuery, _c = _b === void 0 ? {} : _b, _d = _c.fetchPolicy, defaultFetchPolicy = _d === void 0 ? "cache-first" : _d;
4603
- var _e = options.fetchPolicy, fetchPolicy = _e === void 0 ? defaultFetchPolicy : _e, _f = options.initialFetchPolicy, initialFetchPolicy = _f === void 0 ? (fetchPolicy === "standby" ? defaultFetchPolicy : fetchPolicy) : _f;
4688
+ var _e = options.fetchPolicy, fetchPolicy = _e === void 0 ? defaultFetchPolicy : _e, _f = options.initialFetchPolicy, initialFetchPolicy = _f === void 0 ? fetchPolicy === "standby"
4689
+ ? defaultFetchPolicy
4690
+ : fetchPolicy : _f;
4604
4691
  _this.options = tslib.__assign(tslib.__assign({}, options), { initialFetchPolicy: initialFetchPolicy, fetchPolicy: fetchPolicy });
4605
4692
  _this.queryId = queryInfo.queryId || queryManager.generateQueryId();
4606
4693
  var opDef = getOperationDefinition(_this.query);
@@ -4651,7 +4738,7 @@ var ObservableQuery = (function (_super) {
4651
4738
  if (skipCacheDataFor(fetchPolicy) ||
4652
4739
  this.queryManager.getDocumentInfo(this.query).hasForcedResolvers) ;
4653
4740
  else if (this.waitForOwnResult) {
4654
- this.queryInfo['updateWatch']();
4741
+ this.queryInfo["updateWatch"]();
4655
4742
  }
4656
4743
  else {
4657
4744
  var diff = this.queryInfo.getDiff();
@@ -4665,8 +4752,7 @@ var ObservableQuery = (function (_super) {
4665
4752
  delete result.partial;
4666
4753
  if (diff.complete &&
4667
4754
  result.networkStatus === exports.NetworkStatus.loading &&
4668
- (fetchPolicy === 'cache-first' ||
4669
- fetchPolicy === 'cache-only')) {
4755
+ (fetchPolicy === "cache-first" || fetchPolicy === "cache-only")) {
4670
4756
  result.networkStatus = exports.NetworkStatus.ready;
4671
4757
  result.loading = false;
4672
4758
  }
@@ -4692,11 +4778,11 @@ var ObservableQuery = (function (_super) {
4692
4778
  if (!this.last) {
4693
4779
  return true;
4694
4780
  }
4695
- var resultIsDifferent = this.queryManager.getDocumentInfo(this.query).hasNonreactiveDirective
4781
+ var resultIsDifferent = this.queryManager.getDocumentInfo(this.query)
4782
+ .hasNonreactiveDirective
4696
4783
  ? !equalByQuery(this.query, this.last.result, newResult, this.variables)
4697
4784
  : !equal.equal(this.last.result, newResult);
4698
- return (resultIsDifferent ||
4699
- (variables && !equal.equal(this.last.variables, variables)));
4785
+ return (resultIsDifferent || (variables && !equal.equal(this.last.variables, variables)));
4700
4786
  };
4701
4787
  ObservableQuery.prototype.getLast = function (key, variablesMustMatch) {
4702
4788
  var last = this.last;
@@ -4725,14 +4811,14 @@ var ObservableQuery = (function (_super) {
4725
4811
  pollInterval: 0,
4726
4812
  };
4727
4813
  var fetchPolicy = this.options.fetchPolicy;
4728
- if (fetchPolicy === 'cache-and-network') {
4814
+ if (fetchPolicy === "cache-and-network") {
4729
4815
  reobserveOptions.fetchPolicy = fetchPolicy;
4730
4816
  }
4731
- else if (fetchPolicy === 'no-cache') {
4732
- reobserveOptions.fetchPolicy = 'no-cache';
4817
+ else if (fetchPolicy === "no-cache") {
4818
+ reobserveOptions.fetchPolicy = "no-cache";
4733
4819
  }
4734
4820
  else {
4735
- reobserveOptions.fetchPolicy = 'network-only';
4821
+ reobserveOptions.fetchPolicy = "network-only";
4736
4822
  }
4737
4823
  if (globalThis.__DEV__ !== false && variables && hasOwnProperty$2.call(variables, "variables")) {
4738
4824
  var queryDef = getQueryDefinition(this.query);
@@ -4753,7 +4839,9 @@ var ObservableQuery = (function (_super) {
4753
4839
  };
4754
4840
  ObservableQuery.prototype.fetchMore = function (fetchMoreOptions) {
4755
4841
  var _this = this;
4756
- var combinedOptions = tslib.__assign(tslib.__assign({}, (fetchMoreOptions.query ? fetchMoreOptions : tslib.__assign(tslib.__assign(tslib.__assign(tslib.__assign({}, this.options), { query: this.options.query }), fetchMoreOptions), { variables: tslib.__assign(tslib.__assign({}, this.options.variables), fetchMoreOptions.variables) }))), { fetchPolicy: "no-cache" });
4842
+ var combinedOptions = tslib.__assign(tslib.__assign({}, (fetchMoreOptions.query
4843
+ ? fetchMoreOptions
4844
+ : tslib.__assign(tslib.__assign(tslib.__assign(tslib.__assign({}, this.options), { query: this.options.query }), fetchMoreOptions), { variables: tslib.__assign(tslib.__assign({}, this.options.variables), fetchMoreOptions.variables) }))), { fetchPolicy: "no-cache" });
4757
4845
  combinedOptions.query = this.transformDocument(combinedOptions.query);
4758
4846
  var qid = this.queryManager.generateQueryId();
4759
4847
  this.lastQuery = fetchMoreOptions.query
@@ -4766,7 +4854,9 @@ var ObservableQuery = (function (_super) {
4766
4854
  this.observe();
4767
4855
  }
4768
4856
  var updatedQuerySet = new Set();
4769
- return this.queryManager.fetchQuery(qid, combinedOptions, exports.NetworkStatus.fetchMore).then(function (fetchMoreResult) {
4857
+ return this.queryManager
4858
+ .fetchQuery(qid, combinedOptions, exports.NetworkStatus.fetchMore)
4859
+ .then(function (fetchMoreResult) {
4770
4860
  _this.queryManager.removeQuery(qid);
4771
4861
  if (queryInfo.networkStatus === exports.NetworkStatus.fetchMore) {
4772
4862
  queryInfo.networkStatus = originalNetworkStatus;
@@ -4780,10 +4870,12 @@ var ObservableQuery = (function (_super) {
4780
4870
  variables: _this.variables,
4781
4871
  returnPartialData: true,
4782
4872
  optimistic: false,
4783
- }, function (previous) { return updateQuery(previous, {
4784
- fetchMoreResult: fetchMoreResult.data,
4785
- variables: combinedOptions.variables,
4786
- }); });
4873
+ }, function (previous) {
4874
+ return updateQuery(previous, {
4875
+ fetchMoreResult: fetchMoreResult.data,
4876
+ variables: combinedOptions.variables,
4877
+ });
4878
+ });
4787
4879
  }
4788
4880
  else {
4789
4881
  cache.writeQuery({
@@ -4798,7 +4890,8 @@ var ObservableQuery = (function (_super) {
4798
4890
  },
4799
4891
  });
4800
4892
  return fetchMoreResult;
4801
- }).finally(function () {
4893
+ })
4894
+ .finally(function () {
4802
4895
  if (!updatedQuerySet.has(_this.query)) {
4803
4896
  reobserveCacheFirst(_this);
4804
4897
  }
@@ -4849,9 +4942,7 @@ var ObservableQuery = (function (_super) {
4849
4942
  };
4850
4943
  ObservableQuery.prototype.setVariables = function (variables) {
4851
4944
  if (equal.equal(this.variables, variables)) {
4852
- return this.observers.size
4853
- ? this.result()
4854
- : Promise.resolve();
4945
+ return this.observers.size ? this.result() : Promise.resolve();
4855
4946
  }
4856
4947
  this.options.variables = variables;
4857
4948
  if (!this.observers.size) {
@@ -4913,7 +5004,7 @@ var ObservableQuery = (function (_super) {
4913
5004
  };
4914
5005
  ObservableQuery.prototype.fetch = function (options, newNetworkStatus) {
4915
5006
  this.queryManager.setObservableQuery(this);
4916
- return this.queryManager['fetchConcastWithInfo'](this.queryId, options, newNetworkStatus);
5007
+ return this.queryManager["fetchConcastWithInfo"](this.queryId, options, newNetworkStatus);
4917
5008
  };
4918
5009
  ObservableQuery.prototype.updatePolling = function () {
4919
5010
  var _this = this;
@@ -4928,8 +5019,7 @@ var ObservableQuery = (function (_super) {
4928
5019
  }
4929
5020
  return;
4930
5021
  }
4931
- if (pollingInfo &&
4932
- pollingInfo.interval === pollInterval) {
5022
+ if (pollingInfo && pollingInfo.interval === pollInterval) {
4933
5023
  return;
4934
5024
  }
4935
5025
  invariant(pollInterval, 20);
@@ -4939,7 +5029,9 @@ var ObservableQuery = (function (_super) {
4939
5029
  if (_this.pollingInfo) {
4940
5030
  if (!isNetworkRequestInFlight(_this.queryInfo.networkStatus)) {
4941
5031
  _this.reobserve({
4942
- fetchPolicy: _this.options.initialFetchPolicy === 'no-cache' ? 'no-cache' : 'network-only',
5032
+ fetchPolicy: _this.options.initialFetchPolicy === "no-cache"
5033
+ ? "no-cache"
5034
+ : "network-only",
4943
5035
  }, exports.NetworkStatus.poll).then(poll, poll);
4944
5036
  }
4945
5037
  else {
@@ -4962,9 +5054,9 @@ var ObservableQuery = (function (_super) {
4962
5054
  if (error && this.last && !equal.equal(variables, this.last.variables)) {
4963
5055
  error = void 0;
4964
5056
  }
4965
- return this.last = tslib.__assign({ result: this.queryManager.assumeImmutableResults
5057
+ return (this.last = tslib.__assign({ result: this.queryManager.assumeImmutableResults
4966
5058
  ? newResult
4967
- : cloneDeep(newResult), variables: variables }, (error ? { error: error } : null));
5059
+ : cloneDeep(newResult), variables: variables }, (error ? { error: error } : null)));
4968
5060
  };
4969
5061
  ObservableQuery.prototype.reobserveAsConcast = function (newOptions, newNetworkStatus) {
4970
5062
  var _this = this;
@@ -4976,7 +5068,8 @@ var ObservableQuery = (function (_super) {
4976
5068
  var oldFetchPolicy = this.options.fetchPolicy;
4977
5069
  var mergedOptions = compact(this.options, newOptions || {});
4978
5070
  var options = useDisposableConcast
4979
- ? mergedOptions
5071
+ ?
5072
+ mergedOptions
4980
5073
  : assign(this.options, mergedOptions);
4981
5074
  var query = this.transformDocument(options.query);
4982
5075
  this.lastQuery = query;
@@ -5025,6 +5118,17 @@ var ObservableQuery = (function (_super) {
5025
5118
  ObservableQuery.prototype.reobserve = function (newOptions, newNetworkStatus) {
5026
5119
  return this.reobserveAsConcast(newOptions, newNetworkStatus).promise;
5027
5120
  };
5121
+ ObservableQuery.prototype.resubscribeAfterError = function () {
5122
+ var args = [];
5123
+ for (var _i = 0; _i < arguments.length; _i++) {
5124
+ args[_i] = arguments[_i];
5125
+ }
5126
+ var last = this.last;
5127
+ this.resetLastResults();
5128
+ var subscription = this.subscribe.apply(this, args);
5129
+ this.last = last;
5130
+ return subscription;
5131
+ };
5028
5132
  ObservableQuery.prototype.observe = function () {
5029
5133
  this.reportResult(this.getCurrentResult(false), this.variables);
5030
5134
  };
@@ -5041,7 +5145,7 @@ var ObservableQuery = (function (_super) {
5041
5145
  ObservableQuery.prototype.reportError = function (error, variables) {
5042
5146
  var errorResult = tslib.__assign(tslib.__assign({}, this.getLastResult()), { error: error, errors: error.graphQLErrors, networkStatus: exports.NetworkStatus.error, loading: false });
5043
5147
  this.updateLastResult(errorResult, variables);
5044
- iterateObserversSafely(this.observers, 'error', this.last.error = error);
5148
+ iterateObserversSafely(this.observers, "error", (this.last.error = error));
5045
5149
  };
5046
5150
  ObservableQuery.prototype.hasObservers = function () {
5047
5151
  return this.observers.size > 0;
@@ -5069,8 +5173,7 @@ var ObservableQuery = (function (_super) {
5069
5173
  fixObservableSubclass(ObservableQuery);
5070
5174
  function reobserveCacheFirst(obsQuery) {
5071
5175
  var _a = obsQuery.options, fetchPolicy = _a.fetchPolicy, nextFetchPolicy = _a.nextFetchPolicy;
5072
- if (fetchPolicy === "cache-and-network" ||
5073
- fetchPolicy === "network-only") {
5176
+ if (fetchPolicy === "cache-and-network" || fetchPolicy === "network-only") {
5074
5177
  return obsQuery.reobserve({
5075
5178
  fetchPolicy: "cache-first",
5076
5179
  nextFetchPolicy: function () {
@@ -5093,7 +5196,9 @@ function logMissingFieldErrors(missing) {
5093
5196
  }
5094
5197
  }
5095
5198
  function skipCacheDataFor(fetchPolicy) {
5096
- return fetchPolicy === "network-only" || fetchPolicy === "no-cache" || fetchPolicy === "standby";
5199
+ return (fetchPolicy === "network-only" ||
5200
+ fetchPolicy === "no-cache" ||
5201
+ fetchPolicy === "standby");
5097
5202
  }
5098
5203
 
5099
5204
  var LocalState = (function () {
@@ -5148,7 +5253,7 @@ var LocalState = (function () {
5148
5253
  return this.fragmentMatcher;
5149
5254
  };
5150
5255
  LocalState.prototype.clientQuery = function (document) {
5151
- if (hasDirectives(['client'], document)) {
5256
+ if (hasDirectives(["client"], document)) {
5152
5257
  if (this.resolvers) {
5153
5258
  return document;
5154
5259
  }
@@ -5181,10 +5286,10 @@ var LocalState = (function () {
5181
5286
  graphql.visit(document, {
5182
5287
  Directive: {
5183
5288
  enter: function (node) {
5184
- if (node.name.value === 'client' && node.arguments) {
5289
+ if (node.name.value === "client" && node.arguments) {
5185
5290
  forceResolvers = node.arguments.some(function (arg) {
5186
- return arg.name.value === 'always' &&
5187
- arg.value.kind === 'BooleanValue' &&
5291
+ return arg.name.value === "always" &&
5292
+ arg.value.kind === "BooleanValue" &&
5188
5293
  arg.value.value === true;
5189
5294
  });
5190
5295
  if (forceResolvers) {
@@ -5220,7 +5325,7 @@ var LocalState = (function () {
5220
5325
  defaultOperationType = definitionOperation
5221
5326
  ? definitionOperation.charAt(0).toUpperCase() +
5222
5327
  definitionOperation.slice(1)
5223
- : 'Query';
5328
+ : "Query";
5224
5329
  _a = this, cache = _a.cache, client = _a.client;
5225
5330
  execContext = {
5226
5331
  fragmentMap: fragmentMap,
@@ -5250,7 +5355,8 @@ var LocalState = (function () {
5250
5355
  execute = function (selection) { return tslib.__awaiter(_this, void 0, void 0, function () {
5251
5356
  var fragment, typeCondition;
5252
5357
  return tslib.__generator(this, function (_a) {
5253
- if (!isClientFieldDescendant && !execContext.selectionsToResolve.has(selection)) {
5358
+ if (!isClientFieldDescendant &&
5359
+ !execContext.selectionsToResolve.has(selection)) {
5254
5360
  return [2];
5255
5361
  }
5256
5362
  if (!shouldInclude(selection, variables)) {
@@ -5259,7 +5365,7 @@ var LocalState = (function () {
5259
5365
  if (isField(selection)) {
5260
5366
  return [2, this.resolveField(selection, isClientFieldDescendant, rootValue, execContext).then(function (fieldResult) {
5261
5367
  var _a;
5262
- if (typeof fieldResult !== 'undefined') {
5368
+ if (typeof fieldResult !== "undefined") {
5263
5369
  resultsToMerge.push((_a = {},
5264
5370
  _a[resultKeyNameFromField(selection)] = fieldResult,
5265
5371
  _a));
@@ -5325,9 +5431,9 @@ var LocalState = (function () {
5325
5431
  if (result === void 0) { result = defaultResult; }
5326
5432
  if (field.directives) {
5327
5433
  field.directives.forEach(function (directive) {
5328
- if (directive.name.value === 'export' && directive.arguments) {
5434
+ if (directive.name.value === "export" && directive.arguments) {
5329
5435
  directive.arguments.forEach(function (arg) {
5330
- if (arg.name.value === 'as' && arg.value.kind === 'StringValue') {
5436
+ if (arg.name.value === "as" && arg.value.kind === "StringValue") {
5331
5437
  execContext.exportedVariables[arg.value.value] = result;
5332
5438
  }
5333
5439
  });
@@ -5340,7 +5446,7 @@ var LocalState = (function () {
5340
5446
  if (result == null) {
5341
5447
  return result;
5342
5448
  }
5343
- var isClientField = (_b = (_a = field.directives) === null || _a === void 0 ? void 0 : _a.some(function (d) { return d.name.value === 'client'; })) !== null && _b !== void 0 ? _b : false;
5449
+ var isClientField = (_b = (_a = field.directives) === null || _a === void 0 ? void 0 : _a.some(function (d) { return d.name.value === "client"; })) !== null && _b !== void 0 ? _b : false;
5344
5450
  if (Array.isArray(result)) {
5345
5451
  return _this.resolveSubSelectedArray(field, isClientFieldDescendant || isClientField, result, execContext);
5346
5452
  }
@@ -5374,7 +5480,7 @@ var LocalState = (function () {
5374
5480
  selectionsToResolveCache.set(definitionNode, matches_1);
5375
5481
  graphql.visit(definitionNode, {
5376
5482
  Directive: function (node, _, __, ___, ancestors) {
5377
- if (node.name.value === 'client') {
5483
+ if (node.name.value === "client") {
5378
5484
  ancestors.forEach(function (node) {
5379
5485
  if (isSingleASTNode(node) && graphql.isSelectionNode(node)) {
5380
5486
  matches_1.add(node);
@@ -5397,7 +5503,7 @@ var LocalState = (function () {
5397
5503
  matches_1.add(selection);
5398
5504
  });
5399
5505
  }
5400
- }
5506
+ },
5401
5507
  });
5402
5508
  }
5403
5509
  return selectionsToResolveCache.get(definitionNode);
@@ -5434,7 +5540,7 @@ var QueryInfo = (function () {
5434
5540
  this.stopped = false;
5435
5541
  this.dirty = false;
5436
5542
  this.observableQuery = null;
5437
- var cache = this.cache = queryManager.cache;
5543
+ var cache = (this.cache = queryManager.cache);
5438
5544
  if (!destructiveMethodCounts.has(cache)) {
5439
5545
  destructiveMethodCounts.set(cache, 0);
5440
5546
  wrapDestructiveCacheMethod(cache, "evict");
@@ -5471,13 +5577,12 @@ var QueryInfo = (function () {
5471
5577
  cancelNotifyTimeout(this);
5472
5578
  this.dirty = false;
5473
5579
  };
5474
- QueryInfo.prototype.getDiff = function (variables) {
5475
- if (variables === void 0) { variables = this.variables; }
5476
- var options = this.getDiffOptions(variables);
5580
+ QueryInfo.prototype.getDiff = function () {
5581
+ var options = this.getDiffOptions();
5477
5582
  if (this.lastDiff && equal.equal(options, this.lastDiff.options)) {
5478
5583
  return this.lastDiff.diff;
5479
5584
  }
5480
- this.updateWatch(this.variables = variables);
5585
+ this.updateWatch(this.variables);
5481
5586
  var oq = this.observableQuery;
5482
5587
  if (oq && oq.options.fetchPolicy === "no-cache") {
5483
5588
  return { complete: false };
@@ -5487,10 +5592,12 @@ var QueryInfo = (function () {
5487
5592
  return diff;
5488
5593
  };
5489
5594
  QueryInfo.prototype.updateLastDiff = function (diff, options) {
5490
- this.lastDiff = diff ? {
5491
- diff: diff,
5492
- options: options || this.getDiffOptions(),
5493
- } : void 0;
5595
+ this.lastDiff = diff
5596
+ ? {
5597
+ diff: diff,
5598
+ options: options || this.getDiffOptions(),
5599
+ }
5600
+ : void 0;
5494
5601
  };
5495
5602
  QueryInfo.prototype.getDiffOptions = function (variables) {
5496
5603
  var _a;
@@ -5507,8 +5614,7 @@ var QueryInfo = (function () {
5507
5614
  var _this = this;
5508
5615
  var oldDiff = this.lastDiff && this.lastDiff.diff;
5509
5616
  this.updateLastDiff(diff);
5510
- if (!this.dirty &&
5511
- !equal.equal(oldDiff && oldDiff.result, diff && diff.result)) {
5617
+ if (!this.dirty && !equal.equal(oldDiff && oldDiff.result, diff && diff.result)) {
5512
5618
  this.dirty = true;
5513
5619
  if (!this.notifyTimeout) {
5514
5620
  this.notifyTimeout = setTimeout(function () { return _this.notify(); }, 0);
@@ -5525,7 +5631,7 @@ var QueryInfo = (function () {
5525
5631
  this.observableQuery = oq;
5526
5632
  if (oq) {
5527
5633
  oq["queryInfo"] = this;
5528
- this.listeners.add(this.oqListener = function () {
5634
+ this.listeners.add((this.oqListener = function () {
5529
5635
  var diff = _this.getDiff();
5530
5636
  if (diff.fromOptimisticTransaction) {
5531
5637
  oq["observe"]();
@@ -5533,7 +5639,7 @@ var QueryInfo = (function () {
5533
5639
  else {
5534
5640
  reobserveCacheFirst(oq);
5535
5641
  }
5536
- });
5642
+ }));
5537
5643
  }
5538
5644
  else {
5539
5645
  delete this.oqListener;
@@ -5551,11 +5657,9 @@ var QueryInfo = (function () {
5551
5657
  if (!this.dirty || !this.listeners.size) {
5552
5658
  return false;
5553
5659
  }
5554
- if (isNetworkRequestInFlight(this.networkStatus) &&
5555
- this.observableQuery) {
5660
+ if (isNetworkRequestInFlight(this.networkStatus) && this.observableQuery) {
5556
5661
  var fetchPolicy = this.observableQuery.options.fetchPolicy;
5557
- if (fetchPolicy !== "cache-only" &&
5558
- fetchPolicy !== "cache-and-network") {
5662
+ if (fetchPolicy !== "cache-only" && fetchPolicy !== "cache-and-network") {
5559
5663
  return false;
5560
5664
  }
5561
5665
  }
@@ -5582,10 +5686,9 @@ var QueryInfo = (function () {
5582
5686
  return;
5583
5687
  }
5584
5688
  var watchOptions = tslib.__assign(tslib.__assign({}, this.getDiffOptions(variables)), { watcher: this, callback: function (diff) { return _this.setDiff(diff); } });
5585
- if (!this.lastWatch ||
5586
- !equal.equal(watchOptions, this.lastWatch)) {
5689
+ if (!this.lastWatch || !equal.equal(watchOptions, this.lastWatch)) {
5587
5690
  this.cancel();
5588
- this.cancel = this.cache.watch(this.lastWatch = watchOptions);
5691
+ this.cancel = this.cache.watch((this.lastWatch = watchOptions));
5589
5692
  }
5590
5693
  };
5591
5694
  QueryInfo.prototype.resetLastWrite = function () {
@@ -5605,16 +5708,16 @@ var QueryInfo = (function () {
5605
5708
  ? result.errors.slice(0)
5606
5709
  : [];
5607
5710
  this.reset();
5608
- if ('incremental' in result && isNonEmptyArray(result.incremental)) {
5711
+ if ("incremental" in result && isNonEmptyArray(result.incremental)) {
5609
5712
  var mergedData = mergeIncrementalData(this.getDiff().result, result);
5610
5713
  result.data = mergedData;
5611
5714
  }
5612
- else if ('hasNext' in result && result.hasNext) {
5715
+ else if ("hasNext" in result && result.hasNext) {
5613
5716
  var diff = this.getDiff();
5614
5717
  result.data = merger.merge(diff.result, result.data);
5615
5718
  }
5616
5719
  this.graphQLErrors = graphQLErrors;
5617
- if (options.fetchPolicy === 'no-cache') {
5720
+ if (options.fetchPolicy === "no-cache") {
5618
5721
  this.updateLastDiff({ result: result.data, complete: true }, this.getDiffOptions(options.variables));
5619
5722
  }
5620
5723
  else if (cacheWriteBehavior !== 0) {
@@ -5634,15 +5737,14 @@ var QueryInfo = (function () {
5634
5737
  };
5635
5738
  }
5636
5739
  else {
5637
- if (_this.lastDiff &&
5638
- _this.lastDiff.diff.complete) {
5740
+ if (_this.lastDiff && _this.lastDiff.diff.complete) {
5639
5741
  result.data = _this.lastDiff.diff.result;
5640
5742
  return;
5641
5743
  }
5642
5744
  }
5643
5745
  var diffOptions = _this.getDiffOptions(options.variables);
5644
5746
  var diff = cache.diff(diffOptions);
5645
- if (!_this.stopped) {
5747
+ if (!_this.stopped && equal.equal(_this.variables, options.variables)) {
5646
5748
  _this.updateWatch(options.variables);
5647
5749
  }
5648
5750
  _this.updateLastDiff(diff, diffOptions);
@@ -5658,7 +5760,7 @@ var QueryInfo = (function () {
5658
5760
  };
5659
5761
  QueryInfo.prototype.markReady = function () {
5660
5762
  this.networkError = null;
5661
- return this.networkStatus = exports.NetworkStatus.ready;
5763
+ return (this.networkStatus = exports.NetworkStatus.ready);
5662
5764
  };
5663
5765
  QueryInfo.prototype.markError = function (error) {
5664
5766
  this.networkStatus = exports.NetworkStatus.error;
@@ -5676,8 +5778,7 @@ var QueryInfo = (function () {
5676
5778
  }());
5677
5779
  function shouldWriteResult(result, errorPolicy) {
5678
5780
  if (errorPolicy === void 0) { errorPolicy = "none"; }
5679
- var ignoreErrors = errorPolicy === "ignore" ||
5680
- errorPolicy === "all";
5781
+ var ignoreErrors = errorPolicy === "ignore" || errorPolicy === "all";
5681
5782
  var writeWithErrors = !graphQLResultHasError(result);
5682
5783
  if (!writeWithErrors && ignoreErrors && result.data) {
5683
5784
  writeWithErrors = true;
@@ -5688,8 +5789,8 @@ function shouldWriteResult(result, errorPolicy) {
5688
5789
  var hasOwnProperty$1 = Object.prototype.hasOwnProperty;
5689
5790
  var QueryManager = (function () {
5690
5791
  function QueryManager(_a) {
5691
- var cache = _a.cache, link = _a.link, defaultOptions = _a.defaultOptions, documentTransform = _a.documentTransform, _b = _a.queryDeduplication, queryDeduplication = _b === void 0 ? false : _b, onBroadcast = _a.onBroadcast, _c = _a.ssrMode, ssrMode = _c === void 0 ? false : _c, _d = _a.clientAwareness, clientAwareness = _d === void 0 ? {} : _d, localState = _a.localState, _e = _a.assumeImmutableResults, assumeImmutableResults = _e === void 0 ? !!cache.assumeImmutableResults : _e;
5692
5792
  var _this = this;
5793
+ var cache = _a.cache, link = _a.link, defaultOptions = _a.defaultOptions, documentTransform = _a.documentTransform, _b = _a.queryDeduplication, queryDeduplication = _b === void 0 ? false : _b, onBroadcast = _a.onBroadcast, _c = _a.ssrMode, ssrMode = _c === void 0 ? false : _c, _d = _a.clientAwareness, clientAwareness = _d === void 0 ? {} : _d, localState = _a.localState, _e = _a.assumeImmutableResults, assumeImmutableResults = _e === void 0 ? !!cache.assumeImmutableResults : _e;
5693
5794
  this.clientAwareness = {};
5694
5795
  this.queries = new Map();
5695
5796
  this.fetchCancelFns = new Map();
@@ -5736,8 +5837,7 @@ var QueryManager = (function () {
5736
5837
  switch (_h.label) {
5737
5838
  case 0:
5738
5839
  invariant(mutation, 24);
5739
- invariant(fetchPolicy === 'network-only' ||
5740
- fetchPolicy === 'no-cache', 25);
5840
+ invariant(fetchPolicy === "network-only" || fetchPolicy === "no-cache", 25);
5741
5841
  mutationId = this.generateMutationId();
5742
5842
  mutation = this.cache.transformForLink(this.transform(mutation));
5743
5843
  hasClientExports = this.getDocumentInfo(mutation).hasClientExports;
@@ -5772,7 +5872,7 @@ var QueryManager = (function () {
5772
5872
  self = this;
5773
5873
  return [2, new Promise(function (resolve, reject) {
5774
5874
  return asyncMap(self.getObservableFromLink(mutation, tslib.__assign(tslib.__assign({}, context), { optimisticResponse: optimisticResponse }), variables, false), function (result) {
5775
- if (graphQLResultHasError(result) && errorPolicy === 'none') {
5875
+ if (graphQLResultHasError(result) && errorPolicy === "none") {
5776
5876
  throw new ApolloError({
5777
5877
  graphQLErrors: getGraphQLErrorsFromResult(result),
5778
5878
  });
@@ -5785,8 +5885,7 @@ var QueryManager = (function () {
5785
5885
  if (typeof refetchQueries === "function") {
5786
5886
  refetchQueries = refetchQueries(storeResult);
5787
5887
  }
5788
- if (errorPolicy === 'ignore' &&
5789
- graphQLResultHasError(storeResult)) {
5888
+ if (errorPolicy === "ignore" && graphQLResultHasError(storeResult)) {
5790
5889
  delete storeResult.errors;
5791
5890
  }
5792
5891
  return self.markMutationResult({
@@ -5808,7 +5907,7 @@ var QueryManager = (function () {
5808
5907
  }).subscribe({
5809
5908
  next: function (storeResult) {
5810
5909
  self.broadcastQueries();
5811
- if (!('hasNext' in storeResult) || storeResult.hasNext === false) {
5910
+ if (!("hasNext" in storeResult) || storeResult.hasNext === false) {
5812
5911
  resolve(storeResult);
5813
5912
  }
5814
5913
  },
@@ -5821,9 +5920,11 @@ var QueryManager = (function () {
5821
5920
  self.cache.removeOptimistic(mutationId);
5822
5921
  }
5823
5922
  self.broadcastQueries();
5824
- reject(err instanceof ApolloError ? err : new ApolloError({
5825
- networkError: err,
5826
- }));
5923
+ reject(err instanceof ApolloError
5924
+ ? err
5925
+ : new ApolloError({
5926
+ networkError: err,
5927
+ }));
5827
5928
  },
5828
5929
  });
5829
5930
  })];
@@ -5841,12 +5942,13 @@ var QueryManager = (function () {
5841
5942
  if (!isExecutionPatchIncrementalResult(result)) {
5842
5943
  cacheWrites.push({
5843
5944
  result: result.data,
5844
- dataId: 'ROOT_MUTATION',
5945
+ dataId: "ROOT_MUTATION",
5845
5946
  query: mutation.document,
5846
5947
  variables: mutation.variables,
5847
5948
  });
5848
5949
  }
5849
- if (isExecutionPatchIncrementalResult(result) && isNonEmptyArray(result.incremental)) {
5950
+ if (isExecutionPatchIncrementalResult(result) &&
5951
+ isNonEmptyArray(result.incremental)) {
5850
5952
  var diff = cache.diff({
5851
5953
  id: "ROOT_MUTATION",
5852
5954
  query: this.getDocumentInfo(mutation.document).asQuery,
@@ -5858,11 +5960,11 @@ var QueryManager = (function () {
5858
5960
  if (diff.result) {
5859
5961
  mergedData = mergeIncrementalData(diff.result, result);
5860
5962
  }
5861
- if (typeof mergedData !== 'undefined') {
5963
+ if (typeof mergedData !== "undefined") {
5862
5964
  result.data = mergedData;
5863
5965
  cacheWrites.push({
5864
5966
  result: mergedData,
5865
- dataId: 'ROOT_MUTATION',
5967
+ dataId: "ROOT_MUTATION",
5866
5968
  query: mutation.document,
5867
5969
  variables: mutation.variables,
5868
5970
  });
@@ -5887,13 +5989,13 @@ var QueryManager = (function () {
5887
5989
  if (complete && currentQueryResult) {
5888
5990
  var nextQueryResult = updater(currentQueryResult, {
5889
5991
  mutationResult: result,
5890
- queryName: document && getOperationName(document) || void 0,
5992
+ queryName: (document && getOperationName(document)) || void 0,
5891
5993
  queryVariables: variables,
5892
5994
  });
5893
5995
  if (nextQueryResult) {
5894
5996
  cacheWrites.push({
5895
5997
  result: nextQueryResult,
5896
- dataId: 'ROOT_QUERY',
5998
+ dataId: "ROOT_QUERY",
5897
5999
  query: document,
5898
6000
  variables: variables,
5899
6001
  });
@@ -5927,10 +6029,10 @@ var QueryManager = (function () {
5927
6029
  });
5928
6030
  if (diff.complete) {
5929
6031
  result = tslib.__assign(tslib.__assign({}, result), { data: diff.result });
5930
- if ('incremental' in result) {
6032
+ if ("incremental" in result) {
5931
6033
  delete result.incremental;
5932
6034
  }
5933
- if ('hasNext' in result) {
6035
+ if ("hasNext" in result) {
5934
6036
  delete result.hasNext;
5935
6037
  }
5936
6038
  }
@@ -5944,7 +6046,7 @@ var QueryManager = (function () {
5944
6046
  }
5945
6047
  if (!skipCache && !mutation.keepRootFields && isFinalResult) {
5946
6048
  cache.modify({
5947
- id: 'ROOT_MUTATION',
6049
+ id: "ROOT_MUTATION",
5948
6050
  fields: function (value, _a) {
5949
6051
  var fieldName = _a.fieldName, DELETE = _a.DELETE;
5950
6052
  return fieldName === "__typename" ? value : DELETE;
@@ -5978,7 +6080,8 @@ var QueryManager = (function () {
5978
6080
  }, mutation.mutationId);
5979
6081
  };
5980
6082
  QueryManager.prototype.fetchQuery = function (queryId, options, networkStatus) {
5981
- return this.fetchConcastWithInfo(queryId, options, networkStatus).concast.promise;
6083
+ return this.fetchConcastWithInfo(queryId, options, networkStatus).concast
6084
+ .promise;
5982
6085
  };
5983
6086
  QueryManager.prototype.getQueryStore = function () {
5984
6087
  var store = Object.create(null);
@@ -6008,12 +6111,12 @@ var QueryManager = (function () {
6008
6111
  var cacheEntry = {
6009
6112
  hasClientExports: hasClientExports(document),
6010
6113
  hasForcedResolvers: this.localState.shouldForceResolvers(document),
6011
- hasNonreactiveDirective: hasDirectives(['nonreactive'], document),
6114
+ hasNonreactiveDirective: hasDirectives(["nonreactive"], document),
6012
6115
  clientQuery: this.localState.clientQuery(document),
6013
6116
  serverQuery: removeDirectivesFromDocument([
6014
- { name: 'client', remove: true },
6015
- { name: 'connection' },
6016
- { name: 'nonreactive' },
6117
+ { name: "client", remove: true },
6118
+ { name: "connection" },
6119
+ { name: "nonreactive" },
6017
6120
  ], document),
6018
6121
  defaultVars: getDefaultValues(getOperationDefinition(document)),
6019
6122
  asQuery: tslib.__assign(tslib.__assign({}, document), { definitions: document.definitions.map(function (def) {
@@ -6022,7 +6125,7 @@ var QueryManager = (function () {
6022
6125
  return tslib.__assign(tslib.__assign({}, def), { operation: "query" });
6023
6126
  }
6024
6127
  return def;
6025
- }) })
6128
+ }) }),
6026
6129
  };
6027
6130
  transformCache.set(document, cacheEntry);
6028
6131
  }
@@ -6034,7 +6137,7 @@ var QueryManager = (function () {
6034
6137
  QueryManager.prototype.watchQuery = function (options) {
6035
6138
  var query = this.transform(options.query);
6036
6139
  options = tslib.__assign(tslib.__assign({}, options), { variables: this.getVariables(query, options.variables) });
6037
- if (typeof options.notifyOnNetworkStatusChange === 'undefined') {
6140
+ if (typeof options.notifyOnNetworkStatusChange === "undefined") {
6038
6141
  options.notifyOnNetworkStatusChange = false;
6039
6142
  }
6040
6143
  var queryInfo = new QueryInfo(this);
@@ -6043,7 +6146,7 @@ var QueryManager = (function () {
6043
6146
  queryInfo: queryInfo,
6044
6147
  options: options,
6045
6148
  });
6046
- observable['lastQuery'] = query;
6149
+ observable["lastQuery"] = query;
6047
6150
  this.queries.set(observable.queryId, queryInfo);
6048
6151
  queryInfo.init({
6049
6152
  document: query,
@@ -6056,7 +6159,7 @@ var QueryManager = (function () {
6056
6159
  var _this = this;
6057
6160
  if (queryId === void 0) { queryId = this.generateQueryId(); }
6058
6161
  invariant(options.query, 26);
6059
- invariant(options.query.kind === 'Document', 27);
6162
+ invariant(options.query.kind === "Document", 27);
6060
6163
  invariant(!options.returnPartialData, 28);
6061
6164
  invariant(!options.pollInterval, 29);
6062
6165
  return this.fetchQuery(queryId, tslib.__assign(tslib.__assign({}, options), { query: this.transform(options.query) })).finally(function () { return _this.stopQuery(queryId); });
@@ -6173,8 +6276,7 @@ var QueryManager = (function () {
6173
6276
  var fetchPolicy = observableQuery.options.fetchPolicy;
6174
6277
  observableQuery.resetLastResults();
6175
6278
  if (includeStandby ||
6176
- (fetchPolicy !== "standby" &&
6177
- fetchPolicy !== "cache-only")) {
6279
+ (fetchPolicy !== "standby" && fetchPolicy !== "cache-only")) {
6178
6280
  observableQueryPromises.push(observableQuery.refetch());
6179
6281
  }
6180
6282
  _this.getQuery(queryId).setDiff(null);
@@ -6187,17 +6289,17 @@ var QueryManager = (function () {
6187
6289
  };
6188
6290
  QueryManager.prototype.startGraphQLSubscription = function (_a) {
6189
6291
  var _this = this;
6190
- var query = _a.query, fetchPolicy = _a.fetchPolicy, errorPolicy = _a.errorPolicy, variables = _a.variables, _b = _a.context, context = _b === void 0 ? {} : _b;
6292
+ var query = _a.query, fetchPolicy = _a.fetchPolicy, _b = _a.errorPolicy, errorPolicy = _b === void 0 ? "none" : _b, variables = _a.variables, _c = _a.context, context = _c === void 0 ? {} : _c;
6191
6293
  query = this.transform(query);
6192
6294
  variables = this.getVariables(query, variables);
6193
6295
  var makeObservable = function (variables) {
6194
6296
  return _this.getObservableFromLink(query, context, variables).map(function (result) {
6195
- if (fetchPolicy !== 'no-cache') {
6297
+ if (fetchPolicy !== "no-cache") {
6196
6298
  if (shouldWriteResult(result, errorPolicy)) {
6197
6299
  _this.cache.write({
6198
6300
  query: query,
6199
6301
  result: result.data,
6200
- dataId: 'ROOT_SUBSCRIPTION',
6302
+ dataId: "ROOT_SUBSCRIPTION",
6201
6303
  variables: variables,
6202
6304
  });
6203
6305
  }
@@ -6213,16 +6315,23 @@ var QueryManager = (function () {
6213
6315
  if (hasProtocolErrors) {
6214
6316
  errors.protocolErrors = result.extensions[PROTOCOL_ERRORS_SYMBOL];
6215
6317
  }
6216
- throw new ApolloError(errors);
6318
+ if (errorPolicy === "none" || hasProtocolErrors) {
6319
+ throw new ApolloError(errors);
6320
+ }
6321
+ }
6322
+ if (errorPolicy === "ignore") {
6323
+ delete result.errors;
6217
6324
  }
6218
6325
  return result;
6219
6326
  });
6220
6327
  };
6221
6328
  if (this.getDocumentInfo(query).hasClientExports) {
6222
- var observablePromise_1 = this.localState.addExportedVariables(query, variables, context).then(makeObservable);
6329
+ var observablePromise_1 = this.localState
6330
+ .addExportedVariables(query, variables, context)
6331
+ .then(makeObservable);
6223
6332
  return new zenObservableTs.Observable(function (observer) {
6224
6333
  var sub = null;
6225
- observablePromise_1.then(function (observable) { return sub = observable.subscribe(observer); }, observer.error);
6334
+ observablePromise_1.then(function (observable) { return (sub = observable.subscribe(observer)); }, observer.error);
6226
6335
  return function () { return sub && sub.unsubscribe(); };
6227
6336
  });
6228
6337
  }
@@ -6274,12 +6383,11 @@ var QueryManager = (function () {
6274
6383
  observable = byVariables_1.get(varJson_1);
6275
6384
  if (!observable) {
6276
6385
  var concast = new Concast([
6277
- execute(link, operation)
6386
+ execute(link, operation),
6278
6387
  ]);
6279
- byVariables_1.set(varJson_1, observable = concast);
6388
+ byVariables_1.set(varJson_1, (observable = concast));
6280
6389
  concast.beforeNext(function () {
6281
- if (byVariables_1.delete(varJson_1) &&
6282
- byVariables_1.size < 1) {
6390
+ if (byVariables_1.delete(varJson_1) && byVariables_1.size < 1) {
6283
6391
  inFlightLinkObservables_1.delete(printedServerQuery_1);
6284
6392
  }
6285
6393
  });
@@ -6287,14 +6395,12 @@ var QueryManager = (function () {
6287
6395
  }
6288
6396
  else {
6289
6397
  observable = new Concast([
6290
- execute(link, operation)
6398
+ execute(link, operation),
6291
6399
  ]);
6292
6400
  }
6293
6401
  }
6294
6402
  else {
6295
- observable = new Concast([
6296
- zenObservableTs.Observable.of({ data: {} })
6297
- ]);
6403
+ observable = new Concast([zenObservableTs.Observable.of({ data: {} })]);
6298
6404
  context = this.prepareContext(context);
6299
6405
  }
6300
6406
  if (clientQuery) {
@@ -6310,7 +6416,7 @@ var QueryManager = (function () {
6310
6416
  return observable;
6311
6417
  };
6312
6418
  QueryManager.prototype.getResultsFromLink = function (queryInfo, cacheWriteBehavior, options) {
6313
- var requestId = queryInfo.lastRequestId = this.generateRequestId();
6419
+ var requestId = (queryInfo.lastRequestId = this.generateRequestId());
6314
6420
  var linkDocument = this.cache.transformForLink(options.query);
6315
6421
  return asyncMap(this.getObservableFromLink(linkDocument, options.context, options.variables), function (result) {
6316
6422
  var graphQLErrors = getGraphQLErrorsFromResult(result);
@@ -6351,7 +6457,7 @@ var QueryManager = (function () {
6351
6457
  var variables = this.getVariables(query, options.variables);
6352
6458
  var queryInfo = this.getQuery(queryId);
6353
6459
  var defaults = this.defaultOptions.watchQuery;
6354
- var _a = options.fetchPolicy, fetchPolicy = _a === void 0 ? defaults && defaults.fetchPolicy || "cache-first" : _a, _b = options.errorPolicy, errorPolicy = _b === void 0 ? defaults && defaults.errorPolicy || "none" : _b, _c = options.returnPartialData, returnPartialData = _c === void 0 ? false : _c, _d = options.notifyOnNetworkStatusChange, notifyOnNetworkStatusChange = _d === void 0 ? false : _d, _e = options.context, context = _e === void 0 ? {} : _e;
6460
+ var _a = options.fetchPolicy, fetchPolicy = _a === void 0 ? (defaults && defaults.fetchPolicy) || "cache-first" : _a, _b = options.errorPolicy, errorPolicy = _b === void 0 ? (defaults && defaults.errorPolicy) || "none" : _b, _c = options.returnPartialData, returnPartialData = _c === void 0 ? false : _c, _d = options.notifyOnNetworkStatusChange, notifyOnNetworkStatusChange = _d === void 0 ? false : _d, _e = options.context, context = _e === void 0 ? {} : _e;
6355
6461
  var normalized = Object.assign({}, options, {
6356
6462
  query: query,
6357
6463
  variables: variables,
@@ -6380,7 +6486,8 @@ var QueryManager = (function () {
6380
6486
  if (this.getDocumentInfo(normalized.query).hasClientExports) {
6381
6487
  concast = new Concast(this.localState
6382
6488
  .addExportedVariables(normalized.query, normalized.variables, normalized.context)
6383
- .then(fromVariables).then(function (sourcesWithInfo) { return sourcesWithInfo.sources; }));
6489
+ .then(fromVariables)
6490
+ .then(function (sourcesWithInfo) { return sourcesWithInfo.sources; }));
6384
6491
  containsDataFromLink = true;
6385
6492
  }
6386
6493
  else {
@@ -6406,15 +6513,14 @@ var QueryManager = (function () {
6406
6513
  });
6407
6514
  });
6408
6515
  }
6409
- var results = new Map;
6516
+ var results = new Map();
6410
6517
  if (updateCache) {
6411
6518
  this.cache.batch({
6412
6519
  update: updateCache,
6413
- optimistic: optimistic && removeOptimistic || false,
6520
+ optimistic: (optimistic && removeOptimistic) || false,
6414
6521
  removeOptimistic: removeOptimistic,
6415
6522
  onWatchUpdated: function (watch, diff, lastDiff) {
6416
- var oq = watch.watcher instanceof QueryInfo &&
6417
- watch.watcher.observableQuery;
6523
+ var oq = watch.watcher instanceof QueryInfo && watch.watcher.observableQuery;
6418
6524
  if (oq) {
6419
6525
  if (onQueryUpdated) {
6420
6526
  includedQueriesById.delete(oq.queryId);
@@ -6471,43 +6577,50 @@ var QueryManager = (function () {
6471
6577
  variables: variables,
6472
6578
  networkStatus: networkStatus,
6473
6579
  });
6474
- var readCache = function () { return queryInfo.getDiff(variables); };
6580
+ var readCache = function () { return queryInfo.getDiff(); };
6475
6581
  var resultsFromCache = function (diff, networkStatus) {
6476
6582
  if (networkStatus === void 0) { networkStatus = queryInfo.networkStatus || exports.NetworkStatus.loading; }
6477
6583
  var data = diff.result;
6478
- if (globalThis.__DEV__ !== false &&
6479
- !returnPartialData &&
6480
- !equal.equal(data, {})) {
6584
+ if (globalThis.__DEV__ !== false && !returnPartialData && !equal.equal(data, {})) {
6481
6585
  logMissingFieldErrors(diff.missing);
6482
6586
  }
6483
- var fromData = function (data) { return zenObservableTs.Observable.of(tslib.__assign({ data: data, loading: isNetworkRequestInFlight(networkStatus), networkStatus: networkStatus }, (diff.complete ? null : { partial: true }))); };
6587
+ var fromData = function (data) {
6588
+ return zenObservableTs.Observable.of(tslib.__assign({ data: data, loading: isNetworkRequestInFlight(networkStatus), networkStatus: networkStatus }, (diff.complete ? null : { partial: true })));
6589
+ };
6484
6590
  if (data && _this.getDocumentInfo(query).hasForcedResolvers) {
6485
- return _this.localState.runResolvers({
6591
+ return _this.localState
6592
+ .runResolvers({
6486
6593
  document: query,
6487
6594
  remoteResult: { data: data },
6488
6595
  context: context,
6489
6596
  variables: variables,
6490
6597
  onlyRunForcedResolvers: true,
6491
- }).then(function (resolved) { return fromData(resolved.data || void 0); });
6598
+ })
6599
+ .then(function (resolved) { return fromData(resolved.data || void 0); });
6492
6600
  }
6493
- if (errorPolicy === 'none' &&
6601
+ if (errorPolicy === "none" &&
6494
6602
  networkStatus === exports.NetworkStatus.refetch &&
6495
6603
  Array.isArray(diff.missing)) {
6496
6604
  return fromData(void 0);
6497
6605
  }
6498
6606
  return fromData(data);
6499
6607
  };
6500
- var cacheWriteBehavior = fetchPolicy === "no-cache" ? 0 :
6501
- (networkStatus === exports.NetworkStatus.refetch &&
6502
- refetchWritePolicy !== "merge") ? 1
6503
- : 2;
6504
- var resultsFromLink = function () { return _this.getResultsFromLink(queryInfo, cacheWriteBehavior, {
6505
- query: query,
6506
- variables: variables,
6507
- context: context,
6508
- fetchPolicy: fetchPolicy,
6509
- errorPolicy: errorPolicy,
6510
- }); };
6608
+ var cacheWriteBehavior = fetchPolicy === "no-cache"
6609
+ ? 0
6610
+ :
6611
+ networkStatus === exports.NetworkStatus.refetch &&
6612
+ refetchWritePolicy !== "merge"
6613
+ ? 1
6614
+ : 2;
6615
+ var resultsFromLink = function () {
6616
+ return _this.getResultsFromLink(queryInfo, cacheWriteBehavior, {
6617
+ query: query,
6618
+ variables: variables,
6619
+ context: context,
6620
+ fetchPolicy: fetchPolicy,
6621
+ errorPolicy: errorPolicy,
6622
+ });
6623
+ };
6511
6624
  var shouldNotify = notifyOnNetworkStatusChange &&
6512
6625
  typeof oldNetworkStatus === "number" &&
6513
6626
  oldNetworkStatus !== networkStatus &&
@@ -6517,35 +6630,47 @@ var QueryManager = (function () {
6517
6630
  case "cache-first": {
6518
6631
  var diff = readCache();
6519
6632
  if (diff.complete) {
6520
- return { fromLink: false, sources: [resultsFromCache(diff, queryInfo.markReady())] };
6633
+ return {
6634
+ fromLink: false,
6635
+ sources: [resultsFromCache(diff, queryInfo.markReady())],
6636
+ };
6521
6637
  }
6522
6638
  if (returnPartialData || shouldNotify) {
6523
- return { fromLink: true, sources: [resultsFromCache(diff), resultsFromLink()] };
6639
+ return {
6640
+ fromLink: true,
6641
+ sources: [resultsFromCache(diff), resultsFromLink()],
6642
+ };
6524
6643
  }
6525
6644
  return { fromLink: true, sources: [resultsFromLink()] };
6526
6645
  }
6527
6646
  case "cache-and-network": {
6528
6647
  var diff = readCache();
6529
6648
  if (diff.complete || returnPartialData || shouldNotify) {
6530
- return { fromLink: true, sources: [resultsFromCache(diff), resultsFromLink()] };
6649
+ return {
6650
+ fromLink: true,
6651
+ sources: [resultsFromCache(diff), resultsFromLink()],
6652
+ };
6531
6653
  }
6532
6654
  return { fromLink: true, sources: [resultsFromLink()] };
6533
6655
  }
6534
6656
  case "cache-only":
6535
- return { fromLink: false, sources: [resultsFromCache(readCache(), queryInfo.markReady())] };
6657
+ return {
6658
+ fromLink: false,
6659
+ sources: [resultsFromCache(readCache(), queryInfo.markReady())],
6660
+ };
6536
6661
  case "network-only":
6537
6662
  if (shouldNotify) {
6538
- return { fromLink: true, sources: [resultsFromCache(readCache()), resultsFromLink()] };
6663
+ return {
6664
+ fromLink: true,
6665
+ sources: [resultsFromCache(readCache()), resultsFromLink()],
6666
+ };
6539
6667
  }
6540
6668
  return { fromLink: true, sources: [resultsFromLink()] };
6541
6669
  case "no-cache":
6542
6670
  if (shouldNotify) {
6543
6671
  return {
6544
6672
  fromLink: true,
6545
- sources: [
6546
- resultsFromCache(queryInfo.getDiff()),
6547
- resultsFromLink(),
6548
- ],
6673
+ sources: [resultsFromCache(queryInfo.getDiff()), resultsFromLink()],
6549
6674
  };
6550
6675
  }
6551
6676
  return { fromLink: true, sources: [resultsFromLink()] };
@@ -6576,7 +6701,7 @@ var ApolloClient = (function () {
6576
6701
  if (!options.cache) {
6577
6702
  throw newInvariantError(13);
6578
6703
  }
6579
- 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' &&
6704
+ 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" &&
6580
6705
  !window.__APOLLO_CLIENT__ &&
6581
6706
  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;
6582
6707
  var link = options.link;
@@ -6599,32 +6724,40 @@ var ApolloClient = (function () {
6599
6724
  this.mutate = this.mutate.bind(this);
6600
6725
  this.resetStore = this.resetStore.bind(this);
6601
6726
  this.reFetchObservableQueries = this.reFetchObservableQueries.bind(this);
6602
- if (connectToDevTools && typeof window === 'object') {
6603
- window.__APOLLO_CLIENT__ = this;
6727
+ if (connectToDevTools && typeof window === "object") {
6728
+ var windowWithDevTools = window;
6729
+ var devtoolsSymbol = Symbol.for("apollo.devtools");
6730
+ (windowWithDevTools[devtoolsSymbol] =
6731
+ windowWithDevTools[devtoolsSymbol] || []).push(this);
6732
+ windowWithDevTools.__APOLLO_CLIENT__ = this;
6604
6733
  }
6605
6734
  if (!hasSuggestedDevtools && connectToDevTools && globalThis.__DEV__ !== false) {
6606
6735
  hasSuggestedDevtools = true;
6607
- if (typeof window !== 'undefined' &&
6608
- window.document &&
6609
- window.top === window.self &&
6610
- !window.__APOLLO_DEVTOOLS_GLOBAL_HOOK__) {
6611
- var nav = window.navigator;
6612
- var ua = nav && nav.userAgent;
6613
- var url = void 0;
6614
- if (typeof ua === "string") {
6615
- if (ua.indexOf("Chrome/") > -1) {
6616
- url = "https://chrome.google.com/webstore/detail/" +
6617
- "apollo-client-developer-t/jdkknkkbebbapilgoeccciglkfbmbnfm";
6736
+ setTimeout(function () {
6737
+ if (typeof window !== "undefined" &&
6738
+ window.document &&
6739
+ window.top === window.self &&
6740
+ !window.__APOLLO_DEVTOOLS_GLOBAL_HOOK__) {
6741
+ var nav = window.navigator;
6742
+ var ua = nav && nav.userAgent;
6743
+ var url = void 0;
6744
+ if (typeof ua === "string") {
6745
+ if (ua.indexOf("Chrome/") > -1) {
6746
+ url =
6747
+ "https://chrome.google.com/webstore/detail/" +
6748
+ "apollo-client-developer-t/jdkknkkbebbapilgoeccciglkfbmbnfm";
6749
+ }
6750
+ else if (ua.indexOf("Firefox/") > -1) {
6751
+ url =
6752
+ "https://addons.mozilla.org/en-US/firefox/addon/apollo-developer-tools/";
6753
+ }
6618
6754
  }
6619
- else if (ua.indexOf("Firefox/") > -1) {
6620
- url = "https://addons.mozilla.org/en-US/firefox/addon/apollo-developer-tools/";
6755
+ if (url) {
6756
+ globalThis.__DEV__ !== false && invariant.log("Download the Apollo DevTools for a better development " +
6757
+ "experience: %s", url);
6621
6758
  }
6622
6759
  }
6623
- if (url) {
6624
- globalThis.__DEV__ !== false && invariant.log("Download the Apollo DevTools for a better development " +
6625
- "experience: %s", url);
6626
- }
6627
- }
6760
+ }, 10000);
6628
6761
  }
6629
6762
  this.version = version;
6630
6763
  this.localState = new LocalState({
@@ -6646,18 +6779,20 @@ var ApolloClient = (function () {
6646
6779
  },
6647
6780
  localState: this.localState,
6648
6781
  assumeImmutableResults: assumeImmutableResults,
6649
- onBroadcast: connectToDevTools ? function () {
6650
- if (_this.devToolsHookCb) {
6651
- _this.devToolsHookCb({
6652
- action: {},
6653
- state: {
6654
- queries: _this.queryManager.getQueryStore(),
6655
- mutations: _this.queryManager.mutationStore || {},
6656
- },
6657
- dataWithOptimisticResults: _this.cache.extract(true),
6658
- });
6782
+ onBroadcast: connectToDevTools
6783
+ ? function () {
6784
+ if (_this.devToolsHookCb) {
6785
+ _this.devToolsHookCb({
6786
+ action: {},
6787
+ state: {
6788
+ queries: _this.queryManager.getQueryStore(),
6789
+ mutations: _this.queryManager.mutationStore || {},
6790
+ },
6791
+ dataWithOptimisticResults: _this.cache.extract(true),
6792
+ });
6793
+ }
6659
6794
  }
6660
- } : void 0,
6795
+ : void 0,
6661
6796
  });
6662
6797
  }
6663
6798
  Object.defineProperty(ApolloClient.prototype, "documentTransform", {
@@ -6675,9 +6810,9 @@ var ApolloClient = (function () {
6675
6810
  options = mergeOptions(this.defaultOptions.watchQuery, options);
6676
6811
  }
6677
6812
  if (this.disableNetworkFetches &&
6678
- (options.fetchPolicy === 'network-only' ||
6679
- options.fetchPolicy === 'cache-and-network')) {
6680
- options = tslib.__assign(tslib.__assign({}, options), { fetchPolicy: 'cache-first' });
6813
+ (options.fetchPolicy === "network-only" ||
6814
+ options.fetchPolicy === "cache-and-network")) {
6815
+ options = tslib.__assign(tslib.__assign({}, options), { fetchPolicy: "cache-first" });
6681
6816
  }
6682
6817
  return this.queryManager.watchQuery(options);
6683
6818
  };
@@ -6685,9 +6820,9 @@ var ApolloClient = (function () {
6685
6820
  if (this.defaultOptions.query) {
6686
6821
  options = mergeOptions(this.defaultOptions.query, options);
6687
6822
  }
6688
- invariant(options.fetchPolicy !== 'cache-and-network', 14);
6689
- if (this.disableNetworkFetches && options.fetchPolicy === 'network-only') {
6690
- options = tslib.__assign(tslib.__assign({}, options), { fetchPolicy: 'cache-first' });
6823
+ invariant(options.fetchPolicy !== "cache-and-network", 14);
6824
+ if (this.disableNetworkFetches && options.fetchPolicy === "network-only") {
6825
+ options = tslib.__assign(tslib.__assign({}, options), { fetchPolicy: "cache-first" });
6691
6826
  }
6692
6827
  return this.queryManager.query(options);
6693
6828
  };
@@ -6731,18 +6866,22 @@ var ApolloClient = (function () {
6731
6866
  ApolloClient.prototype.resetStore = function () {
6732
6867
  var _this = this;
6733
6868
  return Promise.resolve()
6734
- .then(function () { return _this.queryManager.clearStore({
6735
- discardWatches: false,
6736
- }); })
6869
+ .then(function () {
6870
+ return _this.queryManager.clearStore({
6871
+ discardWatches: false,
6872
+ });
6873
+ })
6737
6874
  .then(function () { return Promise.all(_this.resetStoreCallbacks.map(function (fn) { return fn(); })); })
6738
6875
  .then(function () { return _this.reFetchObservableQueries(); });
6739
6876
  };
6740
6877
  ApolloClient.prototype.clearStore = function () {
6741
6878
  var _this = this;
6742
6879
  return Promise.resolve()
6743
- .then(function () { return _this.queryManager.clearStore({
6744
- discardWatches: true,
6745
- }); })
6880
+ .then(function () {
6881
+ return _this.queryManager.clearStore({
6882
+ discardWatches: true,
6883
+ });
6884
+ })
6746
6885
  .then(function () { return Promise.all(_this.clearStoreCallbacks.map(function (fn) { return fn(); })); });
6747
6886
  };
6748
6887
  ApolloClient.prototype.onResetStore = function (cb) {
@@ -7090,15 +7229,8 @@ var InternalState = (function () {
7090
7229
  _this.setResult(result);
7091
7230
  };
7092
7231
  var onError = function (error) {
7093
- var last = obsQuery["last"];
7094
7232
  subscription.unsubscribe();
7095
- try {
7096
- obsQuery.resetLastResults();
7097
- subscription = obsQuery.subscribe(onNext, onError);
7098
- }
7099
- finally {
7100
- obsQuery["last"] = last;
7101
- }
7233
+ subscription = obsQuery.resubscribeAfterError(onNext, onError);
7102
7234
  if (!hasOwnProperty.call(error, "graphQLErrors")) {
7103
7235
  throw error;
7104
7236
  }
@@ -7600,18 +7732,12 @@ function useSubscription(subscription, options) {
7600
7732
  }
7601
7733
 
7602
7734
  function useReactiveVar(rv) {
7603
- var value = rv();
7604
- var setValue = React__namespace.useState(value)[1];
7605
- React__namespace.useEffect(function () {
7606
- var probablySameValue = rv();
7607
- if (value !== probablySameValue) {
7608
- setValue(probablySameValue);
7609
- }
7610
- else {
7611
- return rv.onNextChange(setValue);
7612
- }
7613
- }, [value]);
7614
- return value;
7735
+ return useSyncExternalStore(React__namespace.useCallback(function (update) {
7736
+ return rv.onNextChange(function onNext() {
7737
+ update();
7738
+ rv.onNextChange(onNext);
7739
+ });
7740
+ }, [rv]), rv, rv);
7615
7741
  }
7616
7742
 
7617
7743
  function useFragment(options) {
@@ -7823,6 +7949,8 @@ var InternalQueryReference = (function () {
7823
7949
  };
7824
7950
  InternalQueryReference.prototype.handleError = function (error) {
7825
7951
  var _a;
7952
+ this.subscription.unsubscribe();
7953
+ this.subscription = this.observable.resubscribeAfterError(this.handleNext, this.handleError);
7826
7954
  switch (this.status) {
7827
7955
  case "loading": {
7828
7956
  this.status = "idle";
@@ -7903,7 +8031,7 @@ var SuspenseCache = (function (_super) {
7903
8031
  return SuspenseCache;
7904
8032
  }(SuspenseCache$1));
7905
8033
 
7906
- var skipToken = Symbol.for('apollo.skipToken');
8034
+ var skipToken = Symbol.for("apollo.skipToken");
7907
8035
 
7908
8036
  function useSuspenseQuery(query, options) {
7909
8037
  if (options === void 0) { options = Object.create(null); }