@apollo/client 3.8.1 → 3.8.3

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 (432) hide show
  1. package/apollo-client.cjs +708 -575
  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 +12 -11
  73. package/core/ApolloClient.d.ts.map +1 -1
  74. package/core/ApolloClient.js +75 -57
  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 +266 -206
  93. package/core/core.cjs.map +1 -1
  94. package/core/core.cjs.native.js +266 -206
  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 +39 -35
  190. package/link/http/http.cjs.map +1 -1
  191. package/link/http/http.cjs.native.js +39 -35
  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/rewriteURIForGET.d.ts +1 -1
  201. package/link/http/rewriteURIForGET.js +12 -12
  202. package/link/http/rewriteURIForGET.js.map +1 -1
  203. package/link/http/selectHttpOptionsAndBody.d.ts +5 -5
  204. package/link/http/selectHttpOptionsAndBody.d.ts.map +1 -1
  205. package/link/http/selectHttpOptionsAndBody.js +8 -7
  206. package/link/http/selectHttpOptionsAndBody.js.map +1 -1
  207. package/link/http/selectURI.d.ts +1 -1
  208. package/link/http/selectURI.js +2 -2
  209. package/link/http/selectURI.js.map +1 -1
  210. package/link/http/serializeFetchParameter.d.ts +1 -1
  211. package/link/http/serializeFetchParameter.js +1 -1
  212. package/link/http/serializeFetchParameter.js.map +1 -1
  213. package/link/persisted-queries/index.d.ts +4 -4
  214. package/link/persisted-queries/index.d.ts.map +1 -1
  215. package/link/persisted-queries/index.js +26 -25
  216. package/link/persisted-queries/index.js.map +1 -1
  217. package/link/persisted-queries/persisted-queries.cjs +22 -17
  218. package/link/persisted-queries/persisted-queries.cjs.map +1 -1
  219. package/link/persisted-queries/persisted-queries.cjs.native.js +22 -17
  220. package/link/retry/delayFunction.d.ts +1 -1
  221. package/link/retry/delayFunction.js.map +1 -1
  222. package/link/retry/index.d.ts +1 -1
  223. package/link/retry/index.js +1 -1
  224. package/link/retry/index.js.map +1 -1
  225. package/link/retry/retry.cjs +2 -2
  226. package/link/retry/retry.cjs.map +1 -1
  227. package/link/retry/retry.cjs.native.js +2 -2
  228. package/link/retry/retryFunction.d.ts +1 -1
  229. package/link/retry/retryFunction.js.map +1 -1
  230. package/link/retry/retryLink.d.ts +5 -5
  231. package/link/retry/retryLink.d.ts.map +1 -1
  232. package/link/retry/retryLink.js +6 -6
  233. package/link/retry/retryLink.js.map +1 -1
  234. package/link/schema/index.d.ts +4 -4
  235. package/link/schema/index.d.ts.map +1 -1
  236. package/link/schema/index.js +13 -8
  237. package/link/schema/index.js.map +1 -1
  238. package/link/schema/schema.cjs +10 -5
  239. package/link/schema/schema.cjs.map +1 -1
  240. package/link/schema/schema.cjs.native.js +10 -5
  241. package/link/subscriptions/index.js +1 -1
  242. package/link/subscriptions/index.js.map +1 -1
  243. package/link/subscriptions/subscriptions.cjs.map +1 -1
  244. package/link/utils/createOperation.d.ts +1 -1
  245. package/link/utils/createOperation.js +3 -3
  246. package/link/utils/createOperation.js.map +1 -1
  247. package/link/utils/filterOperationVariables.d.ts +1 -1
  248. package/link/utils/filterOperationVariables.js +2 -2
  249. package/link/utils/filterOperationVariables.js.map +1 -1
  250. package/link/utils/fromError.d.ts +1 -1
  251. package/link/utils/fromError.js +1 -1
  252. package/link/utils/fromError.js.map +1 -1
  253. package/link/utils/fromPromise.d.ts +1 -1
  254. package/link/utils/fromPromise.js +1 -1
  255. package/link/utils/fromPromise.js.map +1 -1
  256. package/link/utils/index.d.ts +10 -10
  257. package/link/utils/index.js +9 -9
  258. package/link/utils/index.js.map +1 -1
  259. package/link/utils/throwServerError.js +1 -1
  260. package/link/utils/throwServerError.js.map +1 -1
  261. package/link/utils/toPromise.d.ts +1 -1
  262. package/link/utils/toPromise.js +1 -1
  263. package/link/utils/toPromise.js.map +1 -1
  264. package/link/utils/transformOperation.d.ts +1 -1
  265. package/link/utils/transformOperation.js +3 -3
  266. package/link/utils/transformOperation.js.map +1 -1
  267. package/link/utils/utils.cjs +12 -12
  268. package/link/utils/utils.cjs.map +1 -1
  269. package/link/utils/utils.cjs.native.js +12 -12
  270. package/link/utils/validateOperation.d.ts +1 -1
  271. package/link/utils/validateOperation.js +6 -6
  272. package/link/utils/validateOperation.js.map +1 -1
  273. package/link/ws/index.d.ts +5 -5
  274. package/link/ws/index.js +2 -2
  275. package/link/ws/index.js.map +1 -1
  276. package/link/ws/ws.cjs.map +1 -1
  277. package/package.json +22 -22
  278. package/react/cache/QueryReference.d.ts +1 -1
  279. package/react/cache/QueryReference.d.ts.map +1 -1
  280. package/react/cache/QueryReference.js +2 -0
  281. package/react/cache/QueryReference.js.map +1 -1
  282. package/react/hooks/constants.js +1 -1
  283. package/react/hooks/constants.js.map +1 -1
  284. package/react/hooks/hooks.cjs +10 -21
  285. package/react/hooks/hooks.cjs.map +1 -1
  286. package/react/hooks/hooks.cjs.native.js +10 -21
  287. package/react/hooks/useBackgroundQuery.d.ts +1 -1
  288. package/react/hooks/useBackgroundQuery.d.ts.map +1 -1
  289. package/react/hooks/useBackgroundQuery.js.map +1 -1
  290. package/react/hooks/useQuery.d.ts.map +1 -1
  291. package/react/hooks/useQuery.js +1 -8
  292. package/react/hooks/useQuery.js.map +1 -1
  293. package/react/hooks/useReactiveVar.d.ts.map +1 -1
  294. package/react/hooks/useReactiveVar.js +7 -12
  295. package/react/hooks/useReactiveVar.js.map +1 -1
  296. package/react/hooks/useReadQuery.d.ts +1 -1
  297. package/react/hooks/useReadQuery.d.ts.map +1 -1
  298. package/react/hooks/useReadQuery.js +1 -1
  299. package/react/hooks/useReadQuery.js.map +1 -1
  300. package/react/hooks/useSuspenseQuery.d.ts +1 -1
  301. package/react/hooks/useSuspenseQuery.d.ts.map +1 -1
  302. package/react/hooks/useSuspenseQuery.js.map +1 -1
  303. package/react/react.cjs +2 -0
  304. package/react/react.cjs.map +1 -1
  305. package/react/react.cjs.native.js +2 -0
  306. package/react/types/types.js.map +1 -1
  307. package/testing/core/core.cjs +37 -28
  308. package/testing/core/core.cjs.map +1 -1
  309. package/testing/core/core.cjs.native.js +37 -28
  310. package/testing/core/itAsync.d.ts.map +1 -1
  311. package/testing/core/itAsync.js +8 -4
  312. package/testing/core/itAsync.js.map +1 -1
  313. package/testing/core/mocking/mockClient.d.ts +3 -3
  314. package/testing/core/mocking/mockClient.d.ts.map +1 -1
  315. package/testing/core/mocking/mockClient.js +6 -4
  316. package/testing/core/mocking/mockClient.js.map +1 -1
  317. package/testing/core/mocking/mockFetch.d.ts +1 -1
  318. package/testing/core/mocking/mockFetch.d.ts.map +1 -1
  319. package/testing/core/mocking/mockFetch.js +3 -3
  320. package/testing/core/mocking/mockFetch.js.map +1 -1
  321. package/testing/core/mocking/mockLink.d.ts +3 -3
  322. package/testing/core/mocking/mockLink.d.ts.map +1 -1
  323. package/testing/core/mocking/mockLink.js +24 -23
  324. package/testing/core/mocking/mockLink.js.map +1 -1
  325. package/testing/core/mocking/mockQueryManager.d.ts +2 -2
  326. package/testing/core/mocking/mockQueryManager.js +3 -3
  327. package/testing/core/mocking/mockQueryManager.js.map +1 -1
  328. package/testing/core/mocking/mockSubscriptionLink.d.ts +3 -3
  329. package/testing/core/mocking/mockSubscriptionLink.js +4 -4
  330. package/testing/core/mocking/mockSubscriptionLink.js.map +1 -1
  331. package/testing/core/mocking/mockWatchQuery.d.ts +2 -2
  332. package/testing/core/mocking/mockWatchQuery.js +2 -2
  333. package/testing/core/mocking/mockWatchQuery.js.map +1 -1
  334. package/testing/core/observableToPromise.d.ts +3 -3
  335. package/testing/core/observableToPromise.d.ts.map +1 -1
  336. package/testing/core/observableToPromise.js +8 -4
  337. package/testing/core/observableToPromise.js.map +1 -1
  338. package/testing/core/subscribeAndCount.d.ts +1 -1
  339. package/testing/core/subscribeAndCount.d.ts.map +1 -1
  340. package/testing/core/subscribeAndCount.js +5 -3
  341. package/testing/core/subscribeAndCount.js.map +1 -1
  342. package/testing/core/wait.js.map +1 -1
  343. package/testing/core/withConsoleSpy.d.ts.map +1 -1
  344. package/testing/core/withConsoleSpy.js.map +1 -1
  345. package/testing/core/wrap.d.ts.map +1 -1
  346. package/testing/core/wrap.js +14 -12
  347. package/testing/core/wrap.js.map +1 -1
  348. package/testing/index.d.ts +4 -4
  349. package/testing/index.js +3 -3
  350. package/testing/index.js.map +1 -1
  351. package/testing/react/MockedProvider.d.ts +7 -7
  352. package/testing/react/MockedProvider.d.ts.map +1 -1
  353. package/testing/react/MockedProvider.js +10 -11
  354. package/testing/react/MockedProvider.js.map +1 -1
  355. package/testing/testing.cjs +3 -5
  356. package/testing/testing.cjs.map +1 -1
  357. package/testing/testing.cjs.native.js +3 -5
  358. package/utilities/common/canUse.d.ts.map +1 -1
  359. package/utilities/common/canUse.js +4 -5
  360. package/utilities/common/canUse.js.map +1 -1
  361. package/utilities/common/cloneDeep.js +2 -2
  362. package/utilities/common/cloneDeep.js.map +1 -1
  363. package/utilities/common/compact.d.ts +1 -1
  364. package/utilities/common/compact.js.map +1 -1
  365. package/utilities/common/filterInPlace.js.map +1 -1
  366. package/utilities/common/maybeDeepFreeze.js +1 -1
  367. package/utilities/common/maybeDeepFreeze.js.map +1 -1
  368. package/utilities/common/mergeDeep.d.ts.map +1 -1
  369. package/utilities/common/mergeDeep.js +3 -1
  370. package/utilities/common/mergeDeep.js.map +1 -1
  371. package/utilities/common/mergeOptions.d.ts.map +1 -1
  372. package/utilities/common/mergeOptions.js.map +1 -1
  373. package/utilities/common/objects.js +2 -2
  374. package/utilities/common/objects.js.map +1 -1
  375. package/utilities/common/stringifyForDisplay.d.ts.map +1 -1
  376. package/utilities/common/stringifyForDisplay.js +3 -1
  377. package/utilities/common/stringifyForDisplay.js.map +1 -1
  378. package/utilities/globals/global.d.ts.map +1 -1
  379. package/utilities/globals/global.js +3 -1
  380. package/utilities/globals/global.js.map +1 -1
  381. package/utilities/globals/globals.cjs +8 -4
  382. package/utilities/globals/globals.cjs.map +1 -1
  383. package/utilities/globals/globals.cjs.native.js +8 -4
  384. package/utilities/globals/index.d.ts.map +1 -1
  385. package/utilities/globals/index.js +1 -1
  386. package/utilities/globals/index.js.map +1 -1
  387. package/utilities/globals/invariantWrappers.js +1 -1
  388. package/utilities/globals/invariantWrappers.js.map +1 -1
  389. package/utilities/globals/maybe.d.ts.map +1 -1
  390. package/utilities/globals/maybe.js.map +1 -1
  391. package/utilities/graphql/directives.d.ts +1 -1
  392. package/utilities/graphql/directives.d.ts.map +1 -1
  393. package/utilities/graphql/directives.js +17 -13
  394. package/utilities/graphql/directives.js.map +1 -1
  395. package/utilities/graphql/fragments.d.ts +1 -1
  396. package/utilities/graphql/fragments.d.ts.map +1 -1
  397. package/utilities/graphql/fragments.js +12 -12
  398. package/utilities/graphql/fragments.js.map +1 -1
  399. package/utilities/graphql/getFromAST.d.ts +1 -1
  400. package/utilities/graphql/getFromAST.js +16 -16
  401. package/utilities/graphql/getFromAST.js.map +1 -1
  402. package/utilities/graphql/storeUtils.d.ts +2 -2
  403. package/utilities/graphql/storeUtils.d.ts.map +1 -1
  404. package/utilities/graphql/storeUtils.js +36 -34
  405. package/utilities/graphql/storeUtils.js.map +1 -1
  406. package/utilities/graphql/transform.d.ts +1 -1
  407. package/utilities/graphql/transform.d.ts.map +1 -1
  408. package/utilities/graphql/transform.js +48 -32
  409. package/utilities/graphql/transform.js.map +1 -1
  410. package/utilities/observables/Concast.d.ts.map +1 -1
  411. package/utilities/observables/Concast.js +5 -9
  412. package/utilities/observables/Concast.js.map +1 -1
  413. package/utilities/observables/Observable.d.ts +4 -4
  414. package/utilities/observables/Observable.d.ts.map +1 -1
  415. package/utilities/observables/Observable.js +6 -4
  416. package/utilities/observables/Observable.js.map +1 -1
  417. package/utilities/observables/asyncMap.d.ts.map +1 -1
  418. package/utilities/observables/asyncMap.js +5 -2
  419. package/utilities/observables/asyncMap.js.map +1 -1
  420. package/utilities/observables/iteration.js.map +1 -1
  421. package/utilities/policies/pagination.d.ts +1 -1
  422. package/utilities/policies/pagination.d.ts.map +1 -1
  423. package/utilities/policies/pagination.js +9 -7
  424. package/utilities/policies/pagination.js.map +1 -1
  425. package/utilities/types/IsStrictlyAny.d.ts +2 -2
  426. package/utilities/types/IsStrictlyAny.d.ts.map +1 -1
  427. package/utilities/types/IsStrictlyAny.js.map +1 -1
  428. package/utilities/utilities.cjs +147 -121
  429. package/utilities/utilities.cjs.map +1 -1
  430. package/utilities/utilities.cjs.native.js +147 -121
  431. package/version.js +1 -1
  432. package/version.js.map +1 -1
@@ -1,23 +1,23 @@
1
1
  import { __assign, __awaiter, __generator } from "tslib";
2
- import { invariant, newInvariantError } from '../utilities/globals/index.js';
3
- import { equal } from '@wry/equality';
4
- import { execute } from '../link/core/index.js';
5
- import { hasDirectives, isExecutionPatchIncrementalResult, isExecutionPatchResult, removeDirectivesFromDocument, } from '../utilities/index.js';
6
- import { canonicalStringify } from '../cache/index.js';
7
- import { getDefaultValues, getOperationDefinition, getOperationName, hasClientExports, graphQLResultHasError, getGraphQLErrorsFromResult, canUseWeakMap, Observable, asyncMap, isNonEmptyArray, Concast, makeUniqueId, isDocumentNode, isNonNullObject, DocumentTransform, } from '../utilities/index.js';
8
- import { mergeIncrementalData } from '../utilities/common/incrementalResult.js';
9
- import { ApolloError, isApolloError, graphQLResultHasProtocolErrors } from '../errors/index.js';
10
- import { ObservableQuery, logMissingFieldErrors } from './ObservableQuery.js';
11
- import { NetworkStatus, isNetworkRequestInFlight } from './networkStatus.js';
12
- import { LocalState } from './LocalState.js';
13
- import { QueryInfo, shouldWriteResult, } from './QueryInfo.js';
14
- import { PROTOCOL_ERRORS_SYMBOL } from '../errors/index.js';
15
- import { print } from '../utilities/index.js';
2
+ import { invariant, newInvariantError } from "../utilities/globals/index.js";
3
+ import { equal } from "@wry/equality";
4
+ import { execute } from "../link/core/index.js";
5
+ import { hasDirectives, isExecutionPatchIncrementalResult, isExecutionPatchResult, removeDirectivesFromDocument, } from "../utilities/index.js";
6
+ import { canonicalStringify } from "../cache/index.js";
7
+ import { getDefaultValues, getOperationDefinition, getOperationName, hasClientExports, graphQLResultHasError, getGraphQLErrorsFromResult, canUseWeakMap, Observable, asyncMap, isNonEmptyArray, Concast, makeUniqueId, isDocumentNode, isNonNullObject, DocumentTransform, } from "../utilities/index.js";
8
+ import { mergeIncrementalData } from "../utilities/common/incrementalResult.js";
9
+ import { ApolloError, isApolloError, graphQLResultHasProtocolErrors, } from "../errors/index.js";
10
+ import { ObservableQuery, logMissingFieldErrors } from "./ObservableQuery.js";
11
+ import { NetworkStatus, isNetworkRequestInFlight } from "./networkStatus.js";
12
+ import { LocalState } from "./LocalState.js";
13
+ import { QueryInfo, shouldWriteResult, } from "./QueryInfo.js";
14
+ import { PROTOCOL_ERRORS_SYMBOL } from "../errors/index.js";
15
+ import { print } from "../utilities/index.js";
16
16
  var hasOwnProperty = Object.prototype.hasOwnProperty;
17
17
  var QueryManager = (function () {
18
18
  function QueryManager(_a) {
19
- 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;
20
19
  var _this = this;
20
+ 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;
21
21
  this.clientAwareness = {};
22
22
  this.queries = new Map();
23
23
  this.fetchCancelFns = new Map();
@@ -64,8 +64,7 @@ var QueryManager = (function () {
64
64
  switch (_h.label) {
65
65
  case 0:
66
66
  invariant(mutation, 24);
67
- invariant(fetchPolicy === 'network-only' ||
68
- fetchPolicy === 'no-cache', 25);
67
+ invariant(fetchPolicy === "network-only" || fetchPolicy === "no-cache", 25);
69
68
  mutationId = this.generateMutationId();
70
69
  mutation = this.cache.transformForLink(this.transform(mutation));
71
70
  hasClientExports = this.getDocumentInfo(mutation).hasClientExports;
@@ -100,7 +99,7 @@ var QueryManager = (function () {
100
99
  self = this;
101
100
  return [2, new Promise(function (resolve, reject) {
102
101
  return asyncMap(self.getObservableFromLink(mutation, __assign(__assign({}, context), { optimisticResponse: optimisticResponse }), variables, false), function (result) {
103
- if (graphQLResultHasError(result) && errorPolicy === 'none') {
102
+ if (graphQLResultHasError(result) && errorPolicy === "none") {
104
103
  throw new ApolloError({
105
104
  graphQLErrors: getGraphQLErrorsFromResult(result),
106
105
  });
@@ -113,8 +112,7 @@ var QueryManager = (function () {
113
112
  if (typeof refetchQueries === "function") {
114
113
  refetchQueries = refetchQueries(storeResult);
115
114
  }
116
- if (errorPolicy === 'ignore' &&
117
- graphQLResultHasError(storeResult)) {
115
+ if (errorPolicy === "ignore" && graphQLResultHasError(storeResult)) {
118
116
  delete storeResult.errors;
119
117
  }
120
118
  return self.markMutationResult({
@@ -136,7 +134,7 @@ var QueryManager = (function () {
136
134
  }).subscribe({
137
135
  next: function (storeResult) {
138
136
  self.broadcastQueries();
139
- if (!('hasNext' in storeResult) || storeResult.hasNext === false) {
137
+ if (!("hasNext" in storeResult) || storeResult.hasNext === false) {
140
138
  resolve(storeResult);
141
139
  }
142
140
  },
@@ -149,9 +147,11 @@ var QueryManager = (function () {
149
147
  self.cache.removeOptimistic(mutationId);
150
148
  }
151
149
  self.broadcastQueries();
152
- reject(err instanceof ApolloError ? err : new ApolloError({
153
- networkError: err,
154
- }));
150
+ reject(err instanceof ApolloError
151
+ ? err
152
+ : new ApolloError({
153
+ networkError: err,
154
+ }));
155
155
  },
156
156
  });
157
157
  })];
@@ -169,12 +169,13 @@ var QueryManager = (function () {
169
169
  if (!isExecutionPatchIncrementalResult(result)) {
170
170
  cacheWrites.push({
171
171
  result: result.data,
172
- dataId: 'ROOT_MUTATION',
172
+ dataId: "ROOT_MUTATION",
173
173
  query: mutation.document,
174
174
  variables: mutation.variables,
175
175
  });
176
176
  }
177
- if (isExecutionPatchIncrementalResult(result) && isNonEmptyArray(result.incremental)) {
177
+ if (isExecutionPatchIncrementalResult(result) &&
178
+ isNonEmptyArray(result.incremental)) {
178
179
  var diff = cache.diff({
179
180
  id: "ROOT_MUTATION",
180
181
  query: this.getDocumentInfo(mutation.document).asQuery,
@@ -186,11 +187,11 @@ var QueryManager = (function () {
186
187
  if (diff.result) {
187
188
  mergedData = mergeIncrementalData(diff.result, result);
188
189
  }
189
- if (typeof mergedData !== 'undefined') {
190
+ if (typeof mergedData !== "undefined") {
190
191
  result.data = mergedData;
191
192
  cacheWrites.push({
192
193
  result: mergedData,
193
- dataId: 'ROOT_MUTATION',
194
+ dataId: "ROOT_MUTATION",
194
195
  query: mutation.document,
195
196
  variables: mutation.variables,
196
197
  });
@@ -215,13 +216,13 @@ var QueryManager = (function () {
215
216
  if (complete && currentQueryResult) {
216
217
  var nextQueryResult = updater(currentQueryResult, {
217
218
  mutationResult: result,
218
- queryName: document && getOperationName(document) || void 0,
219
+ queryName: (document && getOperationName(document)) || void 0,
219
220
  queryVariables: variables,
220
221
  });
221
222
  if (nextQueryResult) {
222
223
  cacheWrites.push({
223
224
  result: nextQueryResult,
224
- dataId: 'ROOT_QUERY',
225
+ dataId: "ROOT_QUERY",
225
226
  query: document,
226
227
  variables: variables,
227
228
  });
@@ -255,10 +256,10 @@ var QueryManager = (function () {
255
256
  });
256
257
  if (diff.complete) {
257
258
  result = __assign(__assign({}, result), { data: diff.result });
258
- if ('incremental' in result) {
259
+ if ("incremental" in result) {
259
260
  delete result.incremental;
260
261
  }
261
- if ('hasNext' in result) {
262
+ if ("hasNext" in result) {
262
263
  delete result.hasNext;
263
264
  }
264
265
  }
@@ -272,7 +273,7 @@ var QueryManager = (function () {
272
273
  }
273
274
  if (!skipCache && !mutation.keepRootFields && isFinalResult) {
274
275
  cache.modify({
275
- id: 'ROOT_MUTATION',
276
+ id: "ROOT_MUTATION",
276
277
  fields: function (value, _a) {
277
278
  var fieldName = _a.fieldName, DELETE = _a.DELETE;
278
279
  return fieldName === "__typename" ? value : DELETE;
@@ -306,7 +307,8 @@ var QueryManager = (function () {
306
307
  }, mutation.mutationId);
307
308
  };
308
309
  QueryManager.prototype.fetchQuery = function (queryId, options, networkStatus) {
309
- return this.fetchConcastWithInfo(queryId, options, networkStatus).concast.promise;
310
+ return this.fetchConcastWithInfo(queryId, options, networkStatus).concast
311
+ .promise;
310
312
  };
311
313
  QueryManager.prototype.getQueryStore = function () {
312
314
  var store = Object.create(null);
@@ -336,12 +338,12 @@ var QueryManager = (function () {
336
338
  var cacheEntry = {
337
339
  hasClientExports: hasClientExports(document),
338
340
  hasForcedResolvers: this.localState.shouldForceResolvers(document),
339
- hasNonreactiveDirective: hasDirectives(['nonreactive'], document),
341
+ hasNonreactiveDirective: hasDirectives(["nonreactive"], document),
340
342
  clientQuery: this.localState.clientQuery(document),
341
343
  serverQuery: removeDirectivesFromDocument([
342
- { name: 'client', remove: true },
343
- { name: 'connection' },
344
- { name: 'nonreactive' },
344
+ { name: "client", remove: true },
345
+ { name: "connection" },
346
+ { name: "nonreactive" },
345
347
  ], document),
346
348
  defaultVars: getDefaultValues(getOperationDefinition(document)),
347
349
  asQuery: __assign(__assign({}, document), { definitions: document.definitions.map(function (def) {
@@ -350,7 +352,7 @@ var QueryManager = (function () {
350
352
  return __assign(__assign({}, def), { operation: "query" });
351
353
  }
352
354
  return def;
353
- }) })
355
+ }) }),
354
356
  };
355
357
  transformCache.set(document, cacheEntry);
356
358
  }
@@ -362,7 +364,7 @@ var QueryManager = (function () {
362
364
  QueryManager.prototype.watchQuery = function (options) {
363
365
  var query = this.transform(options.query);
364
366
  options = __assign(__assign({}, options), { variables: this.getVariables(query, options.variables) });
365
- if (typeof options.notifyOnNetworkStatusChange === 'undefined') {
367
+ if (typeof options.notifyOnNetworkStatusChange === "undefined") {
366
368
  options.notifyOnNetworkStatusChange = false;
367
369
  }
368
370
  var queryInfo = new QueryInfo(this);
@@ -371,7 +373,7 @@ var QueryManager = (function () {
371
373
  queryInfo: queryInfo,
372
374
  options: options,
373
375
  });
374
- observable['lastQuery'] = query;
376
+ observable["lastQuery"] = query;
375
377
  this.queries.set(observable.queryId, queryInfo);
376
378
  queryInfo.init({
377
379
  document: query,
@@ -384,7 +386,7 @@ var QueryManager = (function () {
384
386
  var _this = this;
385
387
  if (queryId === void 0) { queryId = this.generateQueryId(); }
386
388
  invariant(options.query, 26);
387
- invariant(options.query.kind === 'Document', 27);
389
+ invariant(options.query.kind === "Document", 27);
388
390
  invariant(!options.returnPartialData, 28);
389
391
  invariant(!options.pollInterval, 29);
390
392
  return this.fetchQuery(queryId, __assign(__assign({}, options), { query: this.transform(options.query) })).finally(function () { return _this.stopQuery(queryId); });
@@ -501,8 +503,7 @@ var QueryManager = (function () {
501
503
  var fetchPolicy = observableQuery.options.fetchPolicy;
502
504
  observableQuery.resetLastResults();
503
505
  if (includeStandby ||
504
- (fetchPolicy !== "standby" &&
505
- fetchPolicy !== "cache-only")) {
506
+ (fetchPolicy !== "standby" && fetchPolicy !== "cache-only")) {
506
507
  observableQueryPromises.push(observableQuery.refetch());
507
508
  }
508
509
  _this.getQuery(queryId).setDiff(null);
@@ -515,17 +516,17 @@ var QueryManager = (function () {
515
516
  };
516
517
  QueryManager.prototype.startGraphQLSubscription = function (_a) {
517
518
  var _this = this;
518
- var query = _a.query, fetchPolicy = _a.fetchPolicy, errorPolicy = _a.errorPolicy, variables = _a.variables, _b = _a.context, context = _b === void 0 ? {} : _b;
519
+ 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;
519
520
  query = this.transform(query);
520
521
  variables = this.getVariables(query, variables);
521
522
  var makeObservable = function (variables) {
522
523
  return _this.getObservableFromLink(query, context, variables).map(function (result) {
523
- if (fetchPolicy !== 'no-cache') {
524
+ if (fetchPolicy !== "no-cache") {
524
525
  if (shouldWriteResult(result, errorPolicy)) {
525
526
  _this.cache.write({
526
527
  query: query,
527
528
  result: result.data,
528
- dataId: 'ROOT_SUBSCRIPTION',
529
+ dataId: "ROOT_SUBSCRIPTION",
529
530
  variables: variables,
530
531
  });
531
532
  }
@@ -541,16 +542,23 @@ var QueryManager = (function () {
541
542
  if (hasProtocolErrors) {
542
543
  errors.protocolErrors = result.extensions[PROTOCOL_ERRORS_SYMBOL];
543
544
  }
544
- throw new ApolloError(errors);
545
+ if (errorPolicy === "none" || hasProtocolErrors) {
546
+ throw new ApolloError(errors);
547
+ }
548
+ }
549
+ if (errorPolicy === "ignore") {
550
+ delete result.errors;
545
551
  }
546
552
  return result;
547
553
  });
548
554
  };
549
555
  if (this.getDocumentInfo(query).hasClientExports) {
550
- var observablePromise_1 = this.localState.addExportedVariables(query, variables, context).then(makeObservable);
556
+ var observablePromise_1 = this.localState
557
+ .addExportedVariables(query, variables, context)
558
+ .then(makeObservable);
551
559
  return new Observable(function (observer) {
552
560
  var sub = null;
553
- observablePromise_1.then(function (observable) { return sub = observable.subscribe(observer); }, observer.error);
561
+ observablePromise_1.then(function (observable) { return (sub = observable.subscribe(observer)); }, observer.error);
554
562
  return function () { return sub && sub.unsubscribe(); };
555
563
  });
556
564
  }
@@ -602,12 +610,11 @@ var QueryManager = (function () {
602
610
  observable = byVariables_1.get(varJson_1);
603
611
  if (!observable) {
604
612
  var concast = new Concast([
605
- execute(link, operation)
613
+ execute(link, operation),
606
614
  ]);
607
- byVariables_1.set(varJson_1, observable = concast);
615
+ byVariables_1.set(varJson_1, (observable = concast));
608
616
  concast.beforeNext(function () {
609
- if (byVariables_1.delete(varJson_1) &&
610
- byVariables_1.size < 1) {
617
+ if (byVariables_1.delete(varJson_1) && byVariables_1.size < 1) {
611
618
  inFlightLinkObservables_1.delete(printedServerQuery_1);
612
619
  }
613
620
  });
@@ -615,14 +622,12 @@ var QueryManager = (function () {
615
622
  }
616
623
  else {
617
624
  observable = new Concast([
618
- execute(link, operation)
625
+ execute(link, operation),
619
626
  ]);
620
627
  }
621
628
  }
622
629
  else {
623
- observable = new Concast([
624
- Observable.of({ data: {} })
625
- ]);
630
+ observable = new Concast([Observable.of({ data: {} })]);
626
631
  context = this.prepareContext(context);
627
632
  }
628
633
  if (clientQuery) {
@@ -638,7 +643,7 @@ var QueryManager = (function () {
638
643
  return observable;
639
644
  };
640
645
  QueryManager.prototype.getResultsFromLink = function (queryInfo, cacheWriteBehavior, options) {
641
- var requestId = queryInfo.lastRequestId = this.generateRequestId();
646
+ var requestId = (queryInfo.lastRequestId = this.generateRequestId());
642
647
  var linkDocument = this.cache.transformForLink(options.query);
643
648
  return asyncMap(this.getObservableFromLink(linkDocument, options.context, options.variables), function (result) {
644
649
  var graphQLErrors = getGraphQLErrorsFromResult(result);
@@ -679,7 +684,7 @@ var QueryManager = (function () {
679
684
  var variables = this.getVariables(query, options.variables);
680
685
  var queryInfo = this.getQuery(queryId);
681
686
  var defaults = this.defaultOptions.watchQuery;
682
- 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;
687
+ 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;
683
688
  var normalized = Object.assign({}, options, {
684
689
  query: query,
685
690
  variables: variables,
@@ -708,7 +713,8 @@ var QueryManager = (function () {
708
713
  if (this.getDocumentInfo(normalized.query).hasClientExports) {
709
714
  concast = new Concast(this.localState
710
715
  .addExportedVariables(normalized.query, normalized.variables, normalized.context)
711
- .then(fromVariables).then(function (sourcesWithInfo) { return sourcesWithInfo.sources; }));
716
+ .then(fromVariables)
717
+ .then(function (sourcesWithInfo) { return sourcesWithInfo.sources; }));
712
718
  containsDataFromLink = true;
713
719
  }
714
720
  else {
@@ -734,15 +740,14 @@ var QueryManager = (function () {
734
740
  });
735
741
  });
736
742
  }
737
- var results = new Map;
743
+ var results = new Map();
738
744
  if (updateCache) {
739
745
  this.cache.batch({
740
746
  update: updateCache,
741
- optimistic: optimistic && removeOptimistic || false,
747
+ optimistic: (optimistic && removeOptimistic) || false,
742
748
  removeOptimistic: removeOptimistic,
743
749
  onWatchUpdated: function (watch, diff, lastDiff) {
744
- var oq = watch.watcher instanceof QueryInfo &&
745
- watch.watcher.observableQuery;
750
+ var oq = watch.watcher instanceof QueryInfo && watch.watcher.observableQuery;
746
751
  if (oq) {
747
752
  if (onQueryUpdated) {
748
753
  includedQueriesById.delete(oq.queryId);
@@ -799,43 +804,50 @@ var QueryManager = (function () {
799
804
  variables: variables,
800
805
  networkStatus: networkStatus,
801
806
  });
802
- var readCache = function () { return queryInfo.getDiff(variables); };
807
+ var readCache = function () { return queryInfo.getDiff(); };
803
808
  var resultsFromCache = function (diff, networkStatus) {
804
809
  if (networkStatus === void 0) { networkStatus = queryInfo.networkStatus || NetworkStatus.loading; }
805
810
  var data = diff.result;
806
- if (globalThis.__DEV__ !== false &&
807
- !returnPartialData &&
808
- !equal(data, {})) {
811
+ if (globalThis.__DEV__ !== false && !returnPartialData && !equal(data, {})) {
809
812
  logMissingFieldErrors(diff.missing);
810
813
  }
811
- var fromData = function (data) { return Observable.of(__assign({ data: data, loading: isNetworkRequestInFlight(networkStatus), networkStatus: networkStatus }, (diff.complete ? null : { partial: true }))); };
814
+ var fromData = function (data) {
815
+ return Observable.of(__assign({ data: data, loading: isNetworkRequestInFlight(networkStatus), networkStatus: networkStatus }, (diff.complete ? null : { partial: true })));
816
+ };
812
817
  if (data && _this.getDocumentInfo(query).hasForcedResolvers) {
813
- return _this.localState.runResolvers({
818
+ return _this.localState
819
+ .runResolvers({
814
820
  document: query,
815
821
  remoteResult: { data: data },
816
822
  context: context,
817
823
  variables: variables,
818
824
  onlyRunForcedResolvers: true,
819
- }).then(function (resolved) { return fromData(resolved.data || void 0); });
825
+ })
826
+ .then(function (resolved) { return fromData(resolved.data || void 0); });
820
827
  }
821
- if (errorPolicy === 'none' &&
828
+ if (errorPolicy === "none" &&
822
829
  networkStatus === NetworkStatus.refetch &&
823
830
  Array.isArray(diff.missing)) {
824
831
  return fromData(void 0);
825
832
  }
826
833
  return fromData(data);
827
834
  };
828
- var cacheWriteBehavior = fetchPolicy === "no-cache" ? 0 :
829
- (networkStatus === NetworkStatus.refetch &&
830
- refetchWritePolicy !== "merge") ? 1
831
- : 2;
832
- var resultsFromLink = function () { return _this.getResultsFromLink(queryInfo, cacheWriteBehavior, {
833
- query: query,
834
- variables: variables,
835
- context: context,
836
- fetchPolicy: fetchPolicy,
837
- errorPolicy: errorPolicy,
838
- }); };
835
+ var cacheWriteBehavior = fetchPolicy === "no-cache"
836
+ ? 0
837
+ :
838
+ networkStatus === NetworkStatus.refetch &&
839
+ refetchWritePolicy !== "merge"
840
+ ? 1
841
+ : 2;
842
+ var resultsFromLink = function () {
843
+ return _this.getResultsFromLink(queryInfo, cacheWriteBehavior, {
844
+ query: query,
845
+ variables: variables,
846
+ context: context,
847
+ fetchPolicy: fetchPolicy,
848
+ errorPolicy: errorPolicy,
849
+ });
850
+ };
839
851
  var shouldNotify = notifyOnNetworkStatusChange &&
840
852
  typeof oldNetworkStatus === "number" &&
841
853
  oldNetworkStatus !== networkStatus &&
@@ -845,35 +857,47 @@ var QueryManager = (function () {
845
857
  case "cache-first": {
846
858
  var diff = readCache();
847
859
  if (diff.complete) {
848
- return { fromLink: false, sources: [resultsFromCache(diff, queryInfo.markReady())] };
860
+ return {
861
+ fromLink: false,
862
+ sources: [resultsFromCache(diff, queryInfo.markReady())],
863
+ };
849
864
  }
850
865
  if (returnPartialData || shouldNotify) {
851
- return { fromLink: true, sources: [resultsFromCache(diff), resultsFromLink()] };
866
+ return {
867
+ fromLink: true,
868
+ sources: [resultsFromCache(diff), resultsFromLink()],
869
+ };
852
870
  }
853
871
  return { fromLink: true, sources: [resultsFromLink()] };
854
872
  }
855
873
  case "cache-and-network": {
856
874
  var diff = readCache();
857
875
  if (diff.complete || returnPartialData || shouldNotify) {
858
- return { fromLink: true, sources: [resultsFromCache(diff), resultsFromLink()] };
876
+ return {
877
+ fromLink: true,
878
+ sources: [resultsFromCache(diff), resultsFromLink()],
879
+ };
859
880
  }
860
881
  return { fromLink: true, sources: [resultsFromLink()] };
861
882
  }
862
883
  case "cache-only":
863
- return { fromLink: false, sources: [resultsFromCache(readCache(), queryInfo.markReady())] };
884
+ return {
885
+ fromLink: false,
886
+ sources: [resultsFromCache(readCache(), queryInfo.markReady())],
887
+ };
864
888
  case "network-only":
865
889
  if (shouldNotify) {
866
- return { fromLink: true, sources: [resultsFromCache(readCache()), resultsFromLink()] };
890
+ return {
891
+ fromLink: true,
892
+ sources: [resultsFromCache(readCache()), resultsFromLink()],
893
+ };
867
894
  }
868
895
  return { fromLink: true, sources: [resultsFromLink()] };
869
896
  case "no-cache":
870
897
  if (shouldNotify) {
871
898
  return {
872
899
  fromLink: true,
873
- sources: [
874
- resultsFromCache(queryInfo.getDiff()),
875
- resultsFromLink(),
876
- ],
900
+ sources: [resultsFromCache(queryInfo.getDiff()), resultsFromLink()],
877
901
  };
878
902
  }
879
903
  return { fromLink: true, sources: [resultsFromLink()] };