@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 +1 @@
1
- {"version":3,"file":"core.cjs","sources":["ApolloLink.js","empty.js","from.js","split.js","concat.js","execute.js"],"sourcesContent":["import { newInvariantError, invariant } from '../../utilities/globals/index.js';\nimport { Observable } from '../../utilities/index.js';\nimport { validateOperation, createOperation, transformOperation, } from '../utils/index.js';\nfunction passthrough(op, forward) {\n return (forward ? forward(op) : Observable.of());\n}\nfunction toLink(handler) {\n return typeof handler === 'function' ? new ApolloLink(handler) : handler;\n}\nfunction isTerminating(link) {\n return link.request.length <= 1;\n}\nvar ApolloLink = (function () {\n function ApolloLink(request) {\n if (request)\n this.request = request;\n }\n ApolloLink.empty = function () {\n return new ApolloLink(function () { return Observable.of(); });\n };\n ApolloLink.from = function (links) {\n if (links.length === 0)\n return ApolloLink.empty();\n return links.map(toLink).reduce(function (x, y) { return x.concat(y); });\n };\n ApolloLink.split = function (test, left, right) {\n var leftLink = toLink(left);\n var rightLink = toLink(right || new ApolloLink(passthrough));\n if (isTerminating(leftLink) && isTerminating(rightLink)) {\n return new ApolloLink(function (operation) {\n return test(operation)\n ? leftLink.request(operation) || Observable.of()\n : rightLink.request(operation) || Observable.of();\n });\n }\n else {\n return new ApolloLink(function (operation, forward) {\n return test(operation)\n ? leftLink.request(operation, forward) || Observable.of()\n : rightLink.request(operation, forward) || Observable.of();\n });\n }\n };\n ApolloLink.execute = function (link, operation) {\n return (link.request(createOperation(operation.context, transformOperation(validateOperation(operation)))) || Observable.of());\n };\n ApolloLink.concat = function (first, second) {\n var firstLink = toLink(first);\n if (isTerminating(firstLink)) {\n globalThis.__DEV__ !== false && invariant.warn(33, firstLink);\n return firstLink;\n }\n var nextLink = toLink(second);\n if (isTerminating(nextLink)) {\n return new ApolloLink(function (operation) {\n return firstLink.request(operation, function (op) { return nextLink.request(op) || Observable.of(); }) || Observable.of();\n });\n }\n else {\n return new ApolloLink(function (operation, forward) {\n return (firstLink.request(operation, function (op) {\n return nextLink.request(op, forward) || Observable.of();\n }) || Observable.of());\n });\n }\n };\n ApolloLink.prototype.split = function (test, left, right) {\n return this.concat(ApolloLink.split(test, left, right || new ApolloLink(passthrough)));\n };\n ApolloLink.prototype.concat = function (next) {\n return ApolloLink.concat(this, next);\n };\n ApolloLink.prototype.request = function (operation, forward) {\n throw newInvariantError(34);\n };\n ApolloLink.prototype.onError = function (error, observer) {\n if (observer && observer.error) {\n observer.error(error);\n return false;\n }\n throw error;\n };\n ApolloLink.prototype.setOnError = function (fn) {\n this.onError = fn;\n return this;\n };\n return ApolloLink;\n}());\nexport { ApolloLink };\n//# sourceMappingURL=ApolloLink.js.map","import { ApolloLink } from './ApolloLink.js';\nexport var empty = ApolloLink.empty;\n//# sourceMappingURL=empty.js.map","import { ApolloLink } from './ApolloLink.js';\nexport var from = ApolloLink.from;\n//# sourceMappingURL=from.js.map","import { ApolloLink } from './ApolloLink.js';\nexport var split = ApolloLink.split;\n//# sourceMappingURL=split.js.map","import { ApolloLink } from './ApolloLink.js';\nexport var concat = ApolloLink.concat;\n//# sourceMappingURL=concat.js.map","import { ApolloLink } from './ApolloLink.js';\nexport var execute = ApolloLink.execute;\n//# sourceMappingURL=execute.js.map"],"names":["Observable","createOperation","transformOperation","validateOperation","invariant","newInvariantError"],"mappings":";;;;;;;;AAGA,SAAS,WAAW,CAAC,EAAE,EAAE,OAAO,EAAE;AAClC,IAAI,QAAQ,OAAO,GAAG,OAAO,CAAC,EAAE,CAAC,GAAGA,oBAAU,CAAC,EAAE,EAAE,EAAE;AACrD,CAAC;AACD,SAAS,MAAM,CAAC,OAAO,EAAE;AACzB,IAAI,OAAO,OAAO,OAAO,KAAK,UAAU,GAAG,IAAI,UAAU,CAAC,OAAO,CAAC,GAAG,OAAO,CAAC;AAC7E,CAAC;AACD,SAAS,aAAa,CAAC,IAAI,EAAE;AAC7B,IAAI,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,IAAI,CAAC,CAAC;AACpC,CAAC;AACE,IAAC,UAAU,IAAI,YAAY;AAC9B,IAAI,SAAS,UAAU,CAAC,OAAO,EAAE;AACjC,QAAQ,IAAI,OAAO;AACnB,YAAY,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;AACnC,KAAK;AACL,IAAI,UAAU,CAAC,KAAK,GAAG,YAAY;AACnC,QAAQ,OAAO,IAAI,UAAU,CAAC,YAAY,EAAE,OAAOA,oBAAU,CAAC,EAAE,EAAE,CAAC,EAAE,CAAC,CAAC;AACvE,KAAK,CAAC;AACN,IAAI,UAAU,CAAC,IAAI,GAAG,UAAU,KAAK,EAAE;AACvC,QAAQ,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC;AAC9B,YAAY,OAAO,UAAU,CAAC,KAAK,EAAE,CAAC;AACtC,QAAQ,OAAO,KAAK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K,GAAG,UAAU,CAAC;;ACApB,IAAC,MAAM,GAAG,UAAU,CAAC;;ACArB,IAAC,OAAO,GAAG,UAAU,CAAC;;;;;;;;;"}
1
+ {"version":3,"file":"core.cjs","sources":["ApolloLink.js","empty.js","from.js","split.js","concat.js","execute.js"],"sourcesContent":["import { newInvariantError, invariant } from \"../../utilities/globals/index.js\";\nimport { Observable } from \"../../utilities/index.js\";\nimport { validateOperation, createOperation, transformOperation, } from \"../utils/index.js\";\nfunction passthrough(op, forward) {\n return (forward ? forward(op) : Observable.of());\n}\nfunction toLink(handler) {\n return typeof handler === \"function\" ? new ApolloLink(handler) : handler;\n}\nfunction isTerminating(link) {\n return link.request.length <= 1;\n}\nvar ApolloLink = (function () {\n function ApolloLink(request) {\n if (request)\n this.request = request;\n }\n ApolloLink.empty = function () {\n return new ApolloLink(function () { return Observable.of(); });\n };\n ApolloLink.from = function (links) {\n if (links.length === 0)\n return ApolloLink.empty();\n return links.map(toLink).reduce(function (x, y) { return x.concat(y); });\n };\n ApolloLink.split = function (test, left, right) {\n var leftLink = toLink(left);\n var rightLink = toLink(right || new ApolloLink(passthrough));\n if (isTerminating(leftLink) && isTerminating(rightLink)) {\n return new ApolloLink(function (operation) {\n return test(operation)\n ? leftLink.request(operation) || Observable.of()\n : rightLink.request(operation) || Observable.of();\n });\n }\n else {\n return new ApolloLink(function (operation, forward) {\n return test(operation)\n ? leftLink.request(operation, forward) || Observable.of()\n : rightLink.request(operation, forward) || Observable.of();\n });\n }\n };\n ApolloLink.execute = function (link, operation) {\n return (link.request(createOperation(operation.context, transformOperation(validateOperation(operation)))) || Observable.of());\n };\n ApolloLink.concat = function (first, second) {\n var firstLink = toLink(first);\n if (isTerminating(firstLink)) {\n globalThis.__DEV__ !== false && invariant.warn(33, firstLink);\n return firstLink;\n }\n var nextLink = toLink(second);\n if (isTerminating(nextLink)) {\n return new ApolloLink(function (operation) {\n return firstLink.request(operation, function (op) { return nextLink.request(op) || Observable.of(); }) || Observable.of();\n });\n }\n else {\n return new ApolloLink(function (operation, forward) {\n return (firstLink.request(operation, function (op) {\n return nextLink.request(op, forward) || Observable.of();\n }) || Observable.of());\n });\n }\n };\n ApolloLink.prototype.split = function (test, left, right) {\n return this.concat(ApolloLink.split(test, left, right || new ApolloLink(passthrough)));\n };\n ApolloLink.prototype.concat = function (next) {\n return ApolloLink.concat(this, next);\n };\n ApolloLink.prototype.request = function (operation, forward) {\n throw newInvariantError(34);\n };\n ApolloLink.prototype.onError = function (error, observer) {\n if (observer && observer.error) {\n observer.error(error);\n return false;\n }\n throw error;\n };\n ApolloLink.prototype.setOnError = function (fn) {\n this.onError = fn;\n return this;\n };\n return ApolloLink;\n}());\nexport { ApolloLink };\n//# sourceMappingURL=ApolloLink.js.map","import { ApolloLink } from \"./ApolloLink.js\";\nexport var empty = ApolloLink.empty;\n//# sourceMappingURL=empty.js.map","import { ApolloLink } from \"./ApolloLink.js\";\nexport var from = ApolloLink.from;\n//# sourceMappingURL=from.js.map","import { ApolloLink } from \"./ApolloLink.js\";\nexport var split = ApolloLink.split;\n//# sourceMappingURL=split.js.map","import { ApolloLink } from \"./ApolloLink.js\";\nexport var concat = ApolloLink.concat;\n//# sourceMappingURL=concat.js.map","import { ApolloLink } from \"./ApolloLink.js\";\nexport var execute = ApolloLink.execute;\n//# sourceMappingURL=execute.js.map"],"names":["Observable","createOperation","transformOperation","validateOperation","invariant","newInvariantError"],"mappings":";;;;;;;;AAGA,SAAS,WAAW,CAAC,EAAE,EAAE,OAAO,EAAE;AAClC,IAAI,QAAQ,OAAO,GAAG,OAAO,CAAC,EAAE,CAAC,GAAGA,oBAAU,CAAC,EAAE,EAAE,EAAE;AACrD,CAAC;AACD,SAAS,MAAM,CAAC,OAAO,EAAE;AACzB,IAAI,OAAO,OAAO,OAAO,KAAK,UAAU,GAAG,IAAI,UAAU,CAAC,OAAO,CAAC,GAAG,OAAO,CAAC;AAC7E,CAAC;AACD,SAAS,aAAa,CAAC,IAAI,EAAE;AAC7B,IAAI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SAAS,CAAC,OAAO,GAAG,UAAU,KAAK,EAAE,QAAQ,EAAE;AAC9D,QAAQ,IAAI,QAAQ,IAAI,QAAQ,CAAC,KAAK,EAAE;AACxC,YAAY,QAAQ,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;AAClC,YAAY,OAAO,KAAK,CAAC;AACzB,SAAS;AACT,QAAQ,MAAM,KAAK,CAAC;AACpB,KAAK,CAAC;AACN,IAAI,UAAU,CAAC,SAAS,CAAC,UAAU,GAAG,UAAU,EAAE,EAAE;AACpD,QAAQ,IAAI,CAAC,OAAO,GAAG,EAAE,CAAC;AAC1B,QAAQ,OAAO,IAAI,CAAC;AACpB,KAAK,CAAC;AACN,IAAI,OAAO,UAAU,CAAC;AACtB,CAAC,EAAE;;ACtFO,IAAC,KAAK,GAAG,UAAU,CAAC;;ACApB,IAAC,IAAI,GAAG,UAAU,CAAC;;ACAnB,IAAC,KAAK,GAAG,UAAU,CAAC;;ACApB,IAAC,MAAM,GAAG,UAAU,CAAC;;ACArB,IAAC,OAAO,GAAG,UAAU,CAAC;;;;;;;;;"}
@@ -10,7 +10,7 @@ function passthrough(op, forward) {
10
10
  return (forward ? forward(op) : utilities.Observable.of());
11
11
  }
12
12
  function toLink(handler) {
13
- return typeof handler === 'function' ? new ApolloLink(handler) : handler;
13
+ return typeof handler === "function" ? new ApolloLink(handler) : handler;
14
14
  }
15
15
  function isTerminating(link) {
16
16
  return link.request.length <= 1;
@@ -1,3 +1,3 @@
1
- import { ApolloLink } from './ApolloLink.js';
1
+ import { ApolloLink } from "./ApolloLink.js";
2
2
  export declare const empty: typeof ApolloLink.empty;
3
3
  //# sourceMappingURL=empty.d.ts.map
@@ -1,3 +1,3 @@
1
- import { ApolloLink } from './ApolloLink.js';
1
+ import { ApolloLink } from "./ApolloLink.js";
2
2
  export var empty = ApolloLink.empty;
3
3
  //# sourceMappingURL=empty.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"empty.js","sourceRoot":"","sources":["../../../src/link/core/empty.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAE7C,MAAM,CAAC,IAAM,KAAK,GAAG,UAAU,CAAC,KAAK,CAAC","sourcesContent":["import { ApolloLink } from './ApolloLink.js';\n\nexport const empty = ApolloLink.empty;\n"]}
1
+ {"version":3,"file":"empty.js","sourceRoot":"","sources":["../../../src/link/core/empty.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAE7C,MAAM,CAAC,IAAM,KAAK,GAAG,UAAU,CAAC,KAAK,CAAC","sourcesContent":["import { ApolloLink } from \"./ApolloLink.js\";\n\nexport const empty = ApolloLink.empty;\n"]}
@@ -1,3 +1,3 @@
1
- import { ApolloLink } from './ApolloLink.js';
1
+ import { ApolloLink } from "./ApolloLink.js";
2
2
  export declare const execute: typeof ApolloLink.execute;
3
3
  //# sourceMappingURL=execute.d.ts.map
@@ -1,3 +1,3 @@
1
- import { ApolloLink } from './ApolloLink.js';
1
+ import { ApolloLink } from "./ApolloLink.js";
2
2
  export var execute = ApolloLink.execute;
3
3
  //# sourceMappingURL=execute.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"execute.js","sourceRoot":"","sources":["../../../src/link/core/execute.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAE7C,MAAM,CAAC,IAAM,OAAO,GAAG,UAAU,CAAC,OAAO,CAAC","sourcesContent":["import { ApolloLink } from './ApolloLink.js';\n\nexport const execute = ApolloLink.execute;\n"]}
1
+ {"version":3,"file":"execute.js","sourceRoot":"","sources":["../../../src/link/core/execute.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAE7C,MAAM,CAAC,IAAM,OAAO,GAAG,UAAU,CAAC,OAAO,CAAC","sourcesContent":["import { ApolloLink } from \"./ApolloLink.js\";\n\nexport const execute = ApolloLink.execute;\n"]}
@@ -1,3 +1,3 @@
1
- import { ApolloLink } from './ApolloLink.js';
1
+ import { ApolloLink } from "./ApolloLink.js";
2
2
  export declare const from: typeof ApolloLink.from;
3
3
  //# sourceMappingURL=from.d.ts.map
package/link/core/from.js CHANGED
@@ -1,3 +1,3 @@
1
- import { ApolloLink } from './ApolloLink.js';
1
+ import { ApolloLink } from "./ApolloLink.js";
2
2
  export var from = ApolloLink.from;
3
3
  //# sourceMappingURL=from.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"from.js","sourceRoot":"","sources":["../../../src/link/core/from.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAE7C,MAAM,CAAC,IAAM,IAAI,GAAG,UAAU,CAAC,IAAI,CAAC","sourcesContent":["import { ApolloLink } from './ApolloLink.js';\n\nexport const from = ApolloLink.from;\n"]}
1
+ {"version":3,"file":"from.js","sourceRoot":"","sources":["../../../src/link/core/from.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAE7C,MAAM,CAAC,IAAM,IAAI,GAAG,UAAU,CAAC,IAAI,CAAC","sourcesContent":["import { ApolloLink } from \"./ApolloLink.js\";\n\nexport const from = ApolloLink.from;\n"]}
@@ -1,9 +1,9 @@
1
- import '../../utilities/globals/index.js';
2
- export { empty } from './empty.js';
3
- export { from } from './from.js';
4
- export { split } from './split.js';
5
- export { concat } from './concat.js';
6
- export { execute } from './execute.js';
7
- export { ApolloLink } from './ApolloLink.js';
8
- export * from './types.js';
1
+ import "../../utilities/globals/index.js";
2
+ export { empty } from "./empty.js";
3
+ export { from } from "./from.js";
4
+ export { split } from "./split.js";
5
+ export { concat } from "./concat.js";
6
+ export { execute } from "./execute.js";
7
+ export { ApolloLink } from "./ApolloLink.js";
8
+ export * from "./types.js";
9
9
  //# sourceMappingURL=index.d.ts.map
@@ -1,9 +1,9 @@
1
- import '../../utilities/globals/index.js';
2
- export { empty } from './empty.js';
3
- export { from } from './from.js';
4
- export { split } from './split.js';
5
- export { concat } from './concat.js';
6
- export { execute } from './execute.js';
7
- export { ApolloLink } from './ApolloLink.js';
8
- export * from './types.js';
1
+ import "../../utilities/globals/index.js";
2
+ export { empty } from "./empty.js";
3
+ export { from } from "./from.js";
4
+ export { split } from "./split.js";
5
+ export { concat } from "./concat.js";
6
+ export { execute } from "./execute.js";
7
+ export { ApolloLink } from "./ApolloLink.js";
8
+ export * from "./types.js";
9
9
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/link/core/index.ts"],"names":[],"mappings":"AAAA,OAAO,kCAAkC,CAAC;AAE1C,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAE7C,cAAc,YAAY,CAAC","sourcesContent":["import '../../utilities/globals/index.js';\n\nexport { empty } from './empty.js';\nexport { from } from './from.js';\nexport { split } from './split.js';\nexport { concat } from './concat.js';\nexport { execute } from './execute.js';\nexport { ApolloLink } from './ApolloLink.js';\n\nexport * from './types.js';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/link/core/index.ts"],"names":[],"mappings":"AAAA,OAAO,kCAAkC,CAAC;AAE1C,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAE7C,cAAc,YAAY,CAAC","sourcesContent":["import \"../../utilities/globals/index.js\";\n\nexport { empty } from \"./empty.js\";\nexport { from } from \"./from.js\";\nexport { split } from \"./split.js\";\nexport { concat } from \"./concat.js\";\nexport { execute } from \"./execute.js\";\nexport { ApolloLink } from \"./ApolloLink.js\";\n\nexport * from \"./types.js\";\n"]}
@@ -1,3 +1,3 @@
1
- import { ApolloLink } from './ApolloLink.js';
1
+ import { ApolloLink } from "./ApolloLink.js";
2
2
  export declare const split: typeof ApolloLink.split;
3
3
  //# sourceMappingURL=split.d.ts.map
@@ -1,3 +1,3 @@
1
- import { ApolloLink } from './ApolloLink.js';
1
+ import { ApolloLink } from "./ApolloLink.js";
2
2
  export var split = ApolloLink.split;
3
3
  //# sourceMappingURL=split.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"split.js","sourceRoot":"","sources":["../../../src/link/core/split.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAE7C,MAAM,CAAC,IAAM,KAAK,GAAG,UAAU,CAAC,KAAK,CAAC","sourcesContent":["import { ApolloLink } from './ApolloLink.js';\n\nexport const split = ApolloLink.split;\n"]}
1
+ {"version":3,"file":"split.js","sourceRoot":"","sources":["../../../src/link/core/split.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAE7C,MAAM,CAAC,IAAM,KAAK,GAAG,UAAU,CAAC,KAAK,CAAC","sourcesContent":["import { ApolloLink } from \"./ApolloLink.js\";\n\nexport const split = ApolloLink.split;\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/link/core/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { ExecutionResult, GraphQLError } from \"graphql\";\nimport type { DocumentNode } from \"graphql\";\nimport type { DefaultContext } from \"../../core/index.js\";\nexport type { DocumentNode };\n\nimport type { Observable } from \"../../utilities/index.js\";\n\nexport type Path = ReadonlyArray<string | number>;\n\ninterface ExecutionPatchResultBase {\n hasNext?: boolean;\n}\n\nexport interface ExecutionPatchInitialResult<\n TData = Record<string, any>,\n TExtensions = Record<string, any>\n> extends ExecutionPatchResultBase {\n // if data is present, incremental is not\n data: TData | null | undefined;\n incremental?: never;\n errors?: ReadonlyArray<GraphQLError>;\n extensions?: TExtensions;\n}\n\nexport interface IncrementalPayload<TData, TExtensions> {\n // data and path must both be present\n // https://github.com/graphql/graphql-spec/pull/742/files#diff-98d0cd153b72b63c417ad4238e8cc0d3385691ccbde7f7674bc0d2a718b896ecR288-R293\n data: TData | null;\n label?: string;\n path: Path;\n errors?: ReadonlyArray<GraphQLError>;\n extensions?: TExtensions;\n}\n\nexport interface ExecutionPatchIncrementalResult<\n TData = Record<string, any>,\n TExtensions = Record<string, any>\n> extends ExecutionPatchResultBase {\n // the reverse is also true: if incremental is present,\n // data (and errors and extensions) are not\n incremental?: IncrementalPayload<TData, TExtensions>[];\n data?: never;\n // Errors only exist for chunks, not at the top level\n // https://github.com/robrichard/defer-stream-wg/discussions/50#discussioncomment-3466739\n errors?: never;\n extensions?: never;\n}\n\nexport interface ApolloPayloadResult<\n TData = Record<string, any>,\n TExtensions = Record<string, any>\n> {\n payload: SingleExecutionResult | ExecutionPatchResult | null;\n // Transport layer errors (as distinct from GraphQL or NetworkErrors),\n // these are fatal errors that will include done: true.\n errors?: ReadonlyArray<Error | string>;\n}\n\nexport type ExecutionPatchResult<\n TData = Record<string, any>,\n TExtensions = Record<string, any>\n> =\n | ExecutionPatchInitialResult<TData, TExtensions>\n | ExecutionPatchIncrementalResult<TData, TExtensions>;\n\nexport interface GraphQLRequest<TVariables = Record<string, any>> {\n query: DocumentNode;\n variables?: TVariables;\n operationName?: string;\n context?: DefaultContext;\n extensions?: Record<string, any>;\n}\n\nexport interface Operation {\n query: DocumentNode;\n variables: Record<string, any>;\n operationName: string;\n extensions: Record<string, any>;\n setContext: (context: DefaultContext) => DefaultContext;\n getContext: () => DefaultContext;\n}\n\nexport interface SingleExecutionResult<\n TData = Record<string, any>,\n TContext = DefaultContext,\n TExtensions = Record<string, any>\n> extends ExecutionResult<TData, TExtensions> {\n data?: TData | null;\n context?: TContext;\n}\n\nexport type FetchResult<\n TData = Record<string, any>,\n TContext = Record<string, any>,\n TExtensions = Record<string, any>\n> =\n | SingleExecutionResult<TData, TContext, TExtensions>\n | ExecutionPatchResult<TData, TExtensions>;\n\nexport type NextLink = (operation: Operation) => Observable<FetchResult>;\n\nexport type RequestHandler = (\n operation: Operation,\n forward: NextLink\n) => Observable<FetchResult> | null;\n"]}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/link/core/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { ExecutionResult, GraphQLError } from \"graphql\";\nimport type { DocumentNode } from \"graphql\";\nimport type { DefaultContext } from \"../../core/index.js\";\nexport type { DocumentNode };\n\nimport type { Observable } from \"../../utilities/index.js\";\n\nexport type Path = ReadonlyArray<string | number>;\n\ninterface ExecutionPatchResultBase {\n hasNext?: boolean;\n}\n\nexport interface ExecutionPatchInitialResult<\n TData = Record<string, any>,\n TExtensions = Record<string, any>,\n> extends ExecutionPatchResultBase {\n // if data is present, incremental is not\n data: TData | null | undefined;\n incremental?: never;\n errors?: ReadonlyArray<GraphQLError>;\n extensions?: TExtensions;\n}\n\nexport interface IncrementalPayload<TData, TExtensions> {\n // data and path must both be present\n // https://github.com/graphql/graphql-spec/pull/742/files#diff-98d0cd153b72b63c417ad4238e8cc0d3385691ccbde7f7674bc0d2a718b896ecR288-R293\n data: TData | null;\n label?: string;\n path: Path;\n errors?: ReadonlyArray<GraphQLError>;\n extensions?: TExtensions;\n}\n\nexport interface ExecutionPatchIncrementalResult<\n TData = Record<string, any>,\n TExtensions = Record<string, any>,\n> extends ExecutionPatchResultBase {\n // the reverse is also true: if incremental is present,\n // data (and errors and extensions) are not\n incremental?: IncrementalPayload<TData, TExtensions>[];\n data?: never;\n // Errors only exist for chunks, not at the top level\n // https://github.com/robrichard/defer-stream-wg/discussions/50#discussioncomment-3466739\n errors?: never;\n extensions?: never;\n}\n\nexport interface ApolloPayloadResult<\n TData = Record<string, any>,\n TExtensions = Record<string, any>,\n> {\n payload: SingleExecutionResult | ExecutionPatchResult | null;\n // Transport layer errors (as distinct from GraphQL or NetworkErrors),\n // these are fatal errors that will include done: true.\n errors?: ReadonlyArray<Error | string>;\n}\n\nexport type ExecutionPatchResult<\n TData = Record<string, any>,\n TExtensions = Record<string, any>,\n> =\n | ExecutionPatchInitialResult<TData, TExtensions>\n | ExecutionPatchIncrementalResult<TData, TExtensions>;\n\nexport interface GraphQLRequest<TVariables = Record<string, any>> {\n query: DocumentNode;\n variables?: TVariables;\n operationName?: string;\n context?: DefaultContext;\n extensions?: Record<string, any>;\n}\n\nexport interface Operation {\n query: DocumentNode;\n variables: Record<string, any>;\n operationName: string;\n extensions: Record<string, any>;\n setContext: (context: DefaultContext) => DefaultContext;\n getContext: () => DefaultContext;\n}\n\nexport interface SingleExecutionResult<\n TData = Record<string, any>,\n TContext = DefaultContext,\n TExtensions = Record<string, any>,\n> extends ExecutionResult<TData, TExtensions> {\n data?: TData | null;\n context?: TContext;\n}\n\nexport type FetchResult<\n TData = Record<string, any>,\n TContext = Record<string, any>,\n TExtensions = Record<string, any>,\n> =\n | SingleExecutionResult<TData, TContext, TExtensions>\n | ExecutionPatchResult<TData, TExtensions>;\n\nexport type NextLink = (operation: Operation) => Observable<FetchResult>;\n\nexport type RequestHandler = (\n operation: Operation,\n forward: NextLink\n) => Observable<FetchResult> | null;\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"error.cjs","sources":["index.js"],"sourcesContent":["import { __extends } from \"tslib\";\nimport { Observable } from '../../utilities/index.js';\nimport { ApolloLink } from '../core/index.js';\nexport function onError(errorHandler) {\n return new ApolloLink(function (operation, forward) {\n return new Observable(function (observer) {\n var sub;\n var retriedSub;\n var retriedResult;\n try {\n sub = forward(operation).subscribe({\n next: function (result) {\n if (result.errors) {\n retriedResult = errorHandler({\n graphQLErrors: result.errors,\n response: result,\n operation: operation,\n forward: forward,\n });\n if (retriedResult) {\n retriedSub = retriedResult.subscribe({\n next: observer.next.bind(observer),\n error: observer.error.bind(observer),\n complete: observer.complete.bind(observer),\n });\n return;\n }\n }\n observer.next(result);\n },\n error: function (networkError) {\n retriedResult = errorHandler({\n operation: operation,\n networkError: networkError,\n graphQLErrors: networkError &&\n networkError.result &&\n networkError.result.errors,\n forward: forward,\n });\n if (retriedResult) {\n retriedSub = retriedResult.subscribe({\n next: observer.next.bind(observer),\n error: observer.error.bind(observer),\n complete: observer.complete.bind(observer),\n });\n return;\n }\n observer.error(networkError);\n },\n complete: function () {\n if (!retriedResult) {\n observer.complete.bind(observer)();\n }\n },\n });\n }\n catch (e) {\n errorHandler({ networkError: e, operation: operation, forward: forward });\n observer.error(e);\n }\n return function () {\n if (sub)\n sub.unsubscribe();\n if (retriedSub)\n sub.unsubscribe();\n };\n });\n });\n}\nvar ErrorLink = (function (_super) {\n __extends(ErrorLink, _super);\n function ErrorLink(errorHandler) {\n var _this = _super.call(this) || this;\n _this.link = onError(errorHandler);\n return _this;\n }\n ErrorLink.prototype.request = function (operation, forward) {\n return this.link.request(operation, forward);\n };\n return ErrorLink;\n}(ApolloLink));\nexport { ErrorLink };\n//# sourceMappingURL=index.js.map"],"names":["ApolloLink","Observable","__extends"],"mappings":";;;;;;;;AAGO,SAAS,OAAO,CAAC,YAAY,EAAE;AACtC,IAAI,OAAO,IAAIA,eAAU,CAAC,UAAU,SAAS,EAAE,OAAO,EAAE;AACxD,QAAQ,OAAO,IAAIC,oBAAU,CAAC,UAAU,QAAQ,EAAE;AAClD,YAAY,IAAI,GAAG,CAAC;AACpB,YAAY,IAAI,UAAU,CAAC;AAC3B,YAAY,IAAI,aAAa,CAAC;AAC9B,YAAY,IAAI;AAChB,gBAAgB,GAAG,GAAG,O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,CAAC,IAAI,IAAI,CAAC;AAC9C,QAAQ,KAAK,CAAC,IAAI,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC;AAC3C,QAAQ,OAAO,KAAK,CAAC;AACrB,KAAK;AACL,IAAI,SAAS,CAAC,SAAS,CAAC,OAAO,GAAG,UAAU,SAAS,EAAE,OAAO,EAAE;AAChE,QAAQ,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;AACrD,KAAK,CAAC;AACN,IAAI,OAAO,SAAS,CAAC;AACrB,CAAC,CAACF,eAAU,CAAC;;;;;"}
1
+ {"version":3,"file":"error.cjs","sources":["index.js"],"sourcesContent":["import { __extends } from \"tslib\";\nimport { Observable } from \"../../utilities/index.js\";\nimport { ApolloLink } from \"../core/index.js\";\nexport function onError(errorHandler) {\n return new ApolloLink(function (operation, forward) {\n return new Observable(function (observer) {\n var sub;\n var retriedSub;\n var retriedResult;\n try {\n sub = forward(operation).subscribe({\n next: function (result) {\n if (result.errors) {\n retriedResult = errorHandler({\n graphQLErrors: result.errors,\n response: result,\n operation: operation,\n forward: forward,\n });\n if (retriedResult) {\n retriedSub = retriedResult.subscribe({\n next: observer.next.bind(observer),\n error: observer.error.bind(observer),\n complete: observer.complete.bind(observer),\n });\n return;\n }\n }\n observer.next(result);\n },\n error: function (networkError) {\n retriedResult = errorHandler({\n operation: operation,\n networkError: networkError,\n graphQLErrors: networkError &&\n networkError.result &&\n networkError.result.errors,\n forward: forward,\n });\n if (retriedResult) {\n retriedSub = retriedResult.subscribe({\n next: observer.next.bind(observer),\n error: observer.error.bind(observer),\n complete: observer.complete.bind(observer),\n });\n return;\n }\n observer.error(networkError);\n },\n complete: function () {\n if (!retriedResult) {\n observer.complete.bind(observer)();\n }\n },\n });\n }\n catch (e) {\n errorHandler({ networkError: e, operation: operation, forward: forward });\n observer.error(e);\n }\n return function () {\n if (sub)\n sub.unsubscribe();\n if (retriedSub)\n sub.unsubscribe();\n };\n });\n });\n}\nvar ErrorLink = (function (_super) {\n __extends(ErrorLink, _super);\n function ErrorLink(errorHandler) {\n var _this = _super.call(this) || this;\n _this.link = onError(errorHandler);\n return _this;\n }\n ErrorLink.prototype.request = function (operation, forward) {\n return this.link.request(operation, forward);\n };\n return ErrorLink;\n}(ApolloLink));\nexport { ErrorLink };\n//# sourceMappingURL=index.js.map"],"names":["ApolloLink","Observable","__extends"],"mappings":";;;;;;;;AAGO,SAAS,OAAO,CAAC,YAAY,EAAE;AACtC,IAAI,OAAO,IAAIA,eAAU,CAAC,UAAU,SAAS,EAAE,OAAO,EAAE;AACxD,QAAQ,OAAO,IAAIC,oBAAU,CAAC,UAAU,QAAQ,EAAE;AAClD,YAAY,IAAI,GAAG,CAAC;AACpB,YAAY,IAAI,UAAU,CAAC;AAC3B,YAAY,IAAI,aAAa,CAAC;AAC9B,YAAY,IAAI;AAChB,gBAAgB,GAAG,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC,SAAS,CAAC;AACnD,oBAAoB,IAAI,EAAE,UAAU,MAAM,EAAE;AAC5C,wBAAwB,IAAI,MAAM,CAAC,MAAM,EAAE;AAC3C,4BAA4B,aAAa,GAAG,YAAY,CAAC;AACzD,gCAAgC,aAAa,EAAE,MAAM,CAAC,MAAM;AAC5D,gCAAgC,QAAQ,EAAE,MAAM;AAChD,gCAAgC,SAAS,EAAE,SAAS;AACpD,gCAAgC,OAAO,EAAE,OAAO;AAChD,6BAA6B,CAAC,CAAC;AAC/B,4BAA4B,IAAI,aAAa,EAAE;AAC/C,gCAAgC,UAAU,GAAG,aAAa,CAAC,SAAS,CAAC;AACrE,oCAAoC,IAAI,EAAE,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC;AACtE,oCAAoC,KAAK,EAAE,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC;AACxE,oCAAoC,QAAQ,EAAE,QAAQ,CAAC,QAAQ,CAAC,IAAI,CAAC,QAAQ,CAAC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,SAAS,EAAE,SAAS,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC,CAAC;AAC1F,gBAAgB,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;AAClC,aAAa;AACb,YAAY,OAAO,YAAY;AAC/B,gBAAgB,IAAI,GAAG;AACvB,oBAAoB,GAAG,CAAC,WAAW,EAAE,CAAC;AACtC,gBAAgB,IAAI,UAAU;AAC9B,oBAAoB,GAAG,CAAC,WAAW,EAAE,CAAC;AACtC,aAAa,CAAC;AACd,SAAS,CAAC,CAAC;AACX,KAAK,CAAC,CAAC;AACP,CAAC;AACE,IAAC,SAAS,IAAI,UAAU,MAAM,EAAE;AACnC,IAAIC,eAAS,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;AACjC,IAAI,SAAS,SAAS,CAAC,YAAY,EAAE;AACrC,QAAQ,IAAI,KAAK,GAAG,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC;AAC9C,QAAQ,KAAK,CAAC,IAAI,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC;AAC3C,QAAQ,OAAO,KAAK,CAAC;AACrB,KAAK;AACL,IAAI,SAAS,CAAC,SAAS,CAAC,OAAO,GAAG,UAAU,SAAS,EAAE,OAAO,EAAE;AAChE,QAAQ,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;AACrD,KAAK,CAAC;AACN,IAAI,OAAO,SAAS,CAAC;AACrB,CAAC,CAACF,eAAU,CAAC;;;;;"}
@@ -1,8 +1,8 @@
1
- import type { ExecutionResult } from 'graphql';
2
- import type { NetworkError, GraphQLErrors } from '../../errors/index.js';
3
- import { Observable } from '../../utilities/index.js';
4
- import type { Operation, FetchResult, NextLink } from '../core/index.js';
5
- import { ApolloLink } from '../core/index.js';
1
+ import type { ExecutionResult } from "graphql";
2
+ import type { NetworkError, GraphQLErrors } from "../../errors/index.js";
3
+ import { Observable } from "../../utilities/index.js";
4
+ import type { Operation, FetchResult, NextLink } from "../core/index.js";
5
+ import { ApolloLink } from "../core/index.js";
6
6
  export interface ErrorResponse {
7
7
  graphQLErrors?: GraphQLErrors;
8
8
  networkError?: NetworkError;
@@ -1,6 +1,6 @@
1
1
  import { __extends } from "tslib";
2
- import { Observable } from '../../utilities/index.js';
3
- import { ApolloLink } from '../core/index.js';
2
+ import { Observable } from "../../utilities/index.js";
3
+ import { ApolloLink } from "../core/index.js";
4
4
  export function onError(errorHandler) {
5
5
  return new ApolloLink(function (operation, forward) {
6
6
  return new Observable(function (observer) {
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/link/error/index.ts"],"names":[],"mappings":";AAGA,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAEtD,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAsB9C,MAAM,UAAU,OAAO,CAAC,YAA0B;IAChD,OAAO,IAAI,UAAU,CAAC,UAAC,SAAS,EAAE,OAAO;QACvC,OAAO,IAAI,UAAU,CAAC,UAAA,QAAQ;YAC5B,IAAI,GAAQ,CAAC;YACb,IAAI,UAAe,CAAC;YACpB,IAAI,aAAkB,CAAC;YAEvB,IAAI;gBACF,GAAG,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC,SAAS,CAAC;oBACjC,IAAI,EAAE,UAAA,MAAM;wBACV,IAAI,MAAM,CAAC,MAAM,EAAE;4BACjB,aAAa,GAAG,YAAY,CAAC;gCAC3B,aAAa,EAAE,MAAM,CAAC,MAAM;gCAC5B,QAAQ,EAAE,MAAM;gCAChB,SAAS,WAAA;gCACT,OAAO,SAAA;6BACR,CAAC,CAAC;4BAEH,IAAI,aAAa,EAAE;gCACjB,UAAU,GAAG,aAAa,CAAC,SAAS,CAAC;oCACnC,IAAI,EAAE,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC;oCAClC,KAAK,EAAE,QAAQ,CAAC,KAAK,CAAC,IAAI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AU;oBAAE,GAAG,CAAC,WAAW,EAAE,CAAC;YACpC,CAAC,CAAC;QACJ,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC;AAED;IAA+B,6BAAU;IAEvC,mBAAY,YAAoC;QAAhD,YACE,iBAAO,SAER;QADC,KAAI,CAAC,IAAI,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC;;IACpC,CAAC;IAEM,2BAAO,GAAd,UACE,SAAoB,EACpB,OAAiB;QAEjB,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;IAC/C,CAAC;IACH,gBAAC;AAAD,CAAC,AAbD,CAA+B,UAAU,GAaxC","sourcesContent":["import type { ExecutionResult } from 'graphql';\n\nimport type { NetworkError, GraphQLErrors } from '../../errors/index.js';\nimport { Observable } from '../../utilities/index.js';\nimport type { Operation, FetchResult, NextLink } from '../core/index.js';\nimport { ApolloLink } from '../core/index.js';\n\nexport interface ErrorResponse {\n graphQLErrors?: GraphQLErrors;\n networkError?: NetworkError;\n response?: ExecutionResult;\n operation: Operation;\n forward: NextLink;\n}\n\nexport namespace ErrorLink {\n /**\n * Callback to be triggered when an error occurs within the link stack.\n */\n export interface ErrorHandler {\n (error: ErrorResponse): Observable<FetchResult> | void;\n }\n}\n\n// For backwards compatibility.\nexport import ErrorHandler = ErrorLink.ErrorHandler;\n\nexport function onError(errorHandler: ErrorHandler): ApolloLink {\n return new ApolloLink((operation, forward) => {\n return new Observable(observer => {\n let sub: any;\n let retriedSub: any;\n let retriedResult: any;\n\n try {\n sub = forward(operation).subscribe({\n next: result => {\n if (result.errors) {\n retriedResult = errorHandler({\n graphQLErrors: result.errors,\n response: result,\n operation,\n forward,\n });\n\n if (retriedResult) {\n retriedSub = retriedResult.subscribe({\n next: observer.next.bind(observer),\n error: observer.error.bind(observer),\n complete: observer.complete.bind(observer),\n });\n return;\n }\n }\n observer.next(result);\n },\n error: networkError => {\n retriedResult = errorHandler({\n operation,\n networkError,\n //Network errors can return GraphQL errors on for example a 403\n graphQLErrors:\n networkError &&\n networkError.result &&\n networkError.result.errors,\n forward,\n });\n if (retriedResult) {\n retriedSub = retriedResult.subscribe({\n next: observer.next.bind(observer),\n error: observer.error.bind(observer),\n complete: observer.complete.bind(observer),\n });\n return;\n }\n observer.error(networkError);\n },\n complete: () => {\n // disable the previous sub from calling complete on observable\n // if retry is in flight.\n if (!retriedResult) {\n observer.complete.bind(observer)();\n }\n },\n });\n } catch (e) {\n errorHandler({ networkError: e, operation, forward });\n observer.error(e);\n }\n\n return () => {\n if (sub) sub.unsubscribe();\n if (retriedSub) sub.unsubscribe();\n };\n });\n });\n}\n\nexport class ErrorLink extends ApolloLink {\n private link: ApolloLink;\n constructor(errorHandler: ErrorLink.ErrorHandler) {\n super();\n this.link = onError(errorHandler);\n }\n\n public request(\n operation: Operation,\n forward: NextLink,\n ): Observable<FetchResult> | null {\n return this.link.request(operation, forward);\n }\n}\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/link/error/index.ts"],"names":[],"mappings":";AAGA,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAEtD,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAsB9C,MAAM,UAAU,OAAO,CAAC,YAA0B;IAChD,OAAO,IAAI,UAAU,CAAC,UAAC,SAAS,EAAE,OAAO;QACvC,OAAO,IAAI,UAAU,CAAC,UAAC,QAAQ;YAC7B,IAAI,GAAQ,CAAC;YACb,IAAI,UAAe,CAAC;YACpB,IAAI,aAAkB,CAAC;YAEvB,IAAI;gBACF,GAAG,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC,SAAS,CAAC;oBACjC,IAAI,EAAE,UAAC,MAAM;wBACX,IAAI,MAAM,CAAC,MAAM,EAAE;4BACjB,aAAa,GAAG,YAAY,CAAC;gCAC3B,aAAa,EAAE,MAAM,CAAC,MAAM;gCAC5B,QAAQ,EAAE,MAAM;gCAChB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;gBACV,YAAY,CAAC,EAAE,YAAY,EAAE,CAAC,EAAE,SAAS,WAAA,EAAE,OAAO,SAAA,EAAE,CAAC,CAAC;gBACtD,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;aACnB;YAED,OAAO;gBACL,IAAI,GAAG;oBAAE,GAAG,CAAC,WAAW,EAAE,CAAC;gBAC3B,IAAI,UAAU;oBAAE,GAAG,CAAC,WAAW,EAAE,CAAC;YACpC,CAAC,CAAC;QACJ,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC;AAED;IAA+B,6BAAU;IAEvC,mBAAY,YAAoC;QAAhD,YACE,iBAAO,SAER;QADC,KAAI,CAAC,IAAI,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC;;IACpC,CAAC;IAEM,2BAAO,GAAd,UACE,SAAoB,EACpB,OAAiB;QAEjB,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;IAC/C,CAAC;IACH,gBAAC;AAAD,CAAC,AAbD,CAA+B,UAAU,GAaxC","sourcesContent":["import type { ExecutionResult } from \"graphql\";\n\nimport type { NetworkError, GraphQLErrors } from \"../../errors/index.js\";\nimport { Observable } from \"../../utilities/index.js\";\nimport type { Operation, FetchResult, NextLink } from \"../core/index.js\";\nimport { ApolloLink } from \"../core/index.js\";\n\nexport interface ErrorResponse {\n graphQLErrors?: GraphQLErrors;\n networkError?: NetworkError;\n response?: ExecutionResult;\n operation: Operation;\n forward: NextLink;\n}\n\nexport namespace ErrorLink {\n /**\n * Callback to be triggered when an error occurs within the link stack.\n */\n export interface ErrorHandler {\n (error: ErrorResponse): Observable<FetchResult> | void;\n }\n}\n\n// For backwards compatibility.\nexport import ErrorHandler = ErrorLink.ErrorHandler;\n\nexport function onError(errorHandler: ErrorHandler): ApolloLink {\n return new ApolloLink((operation, forward) => {\n return new Observable((observer) => {\n let sub: any;\n let retriedSub: any;\n let retriedResult: any;\n\n try {\n sub = forward(operation).subscribe({\n next: (result) => {\n if (result.errors) {\n retriedResult = errorHandler({\n graphQLErrors: result.errors,\n response: result,\n operation,\n forward,\n });\n\n if (retriedResult) {\n retriedSub = retriedResult.subscribe({\n next: observer.next.bind(observer),\n error: observer.error.bind(observer),\n complete: observer.complete.bind(observer),\n });\n return;\n }\n }\n observer.next(result);\n },\n error: (networkError) => {\n retriedResult = errorHandler({\n operation,\n networkError,\n //Network errors can return GraphQL errors on for example a 403\n graphQLErrors:\n networkError &&\n networkError.result &&\n networkError.result.errors,\n forward,\n });\n if (retriedResult) {\n retriedSub = retriedResult.subscribe({\n next: observer.next.bind(observer),\n error: observer.error.bind(observer),\n complete: observer.complete.bind(observer),\n });\n return;\n }\n observer.error(networkError);\n },\n complete: () => {\n // disable the previous sub from calling complete on observable\n // if retry is in flight.\n if (!retriedResult) {\n observer.complete.bind(observer)();\n }\n },\n });\n } catch (e) {\n errorHandler({ networkError: e, operation, forward });\n observer.error(e);\n }\n\n return () => {\n if (sub) sub.unsubscribe();\n if (retriedSub) sub.unsubscribe();\n };\n });\n });\n}\n\nexport class ErrorLink extends ApolloLink {\n private link: ApolloLink;\n constructor(errorHandler: ErrorLink.ErrorHandler) {\n super();\n this.link = onError(errorHandler);\n }\n\n public request(\n operation: Operation,\n forward: NextLink\n ): Observable<FetchResult> | null {\n return this.link.request(operation, forward);\n }\n}\n"]}
@@ -1,6 +1,6 @@
1
- import type { RequestHandler } from '../core/index.js';
2
- import { ApolloLink } from '../core/index.js';
3
- import type { HttpOptions } from './selectHttpOptionsAndBody.js';
1
+ import type { RequestHandler } from "../core/index.js";
2
+ import { ApolloLink } from "../core/index.js";
3
+ import type { HttpOptions } from "./selectHttpOptionsAndBody.js";
4
4
  export declare class HttpLink extends ApolloLink {
5
5
  options: HttpOptions;
6
6
  requester: RequestHandler;
@@ -1,6 +1,6 @@
1
1
  import { __extends } from "tslib";
2
- import { ApolloLink } from '../core/index.js';
3
- import { createHttpLink } from './createHttpLink.js';
2
+ import { ApolloLink } from "../core/index.js";
3
+ import { createHttpLink } from "./createHttpLink.js";
4
4
  var HttpLink = (function (_super) {
5
5
  __extends(HttpLink, _super);
6
6
  function HttpLink(options) {
@@ -1 +1 @@
1
- {"version":3,"file":"HttpLink.js","sourceRoot":"","sources":["../../../src/link/http/HttpLink.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE9C,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAErD;IAA8B,4BAAU;IAEtC,kBAAmB,OAAyB;QAAzB,wBAAA,EAAA,YAAyB;QAA5C,YACE,kBAAM,cAAc,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,SACvC;QAFkB,aAAO,GAAP,OAAO,CAAkB;;IAE5C,CAAC;IACH,eAAC;AAAD,CAAC,AALD,CAA8B,UAAU,GAKvC","sourcesContent":["import type { RequestHandler } from '../core/index.js';\nimport { ApolloLink } from '../core/index.js';\nimport type { HttpOptions } from './selectHttpOptionsAndBody.js';\nimport { createHttpLink } from './createHttpLink.js';\n\nexport class HttpLink extends ApolloLink {\n public requester: RequestHandler;\n constructor(public options: HttpOptions = {}) {\n super(createHttpLink(options).request);\n }\n}\n"]}
1
+ {"version":3,"file":"HttpLink.js","sourceRoot":"","sources":["../../../src/link/http/HttpLink.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE9C,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAErD;IAA8B,4BAAU;IAEtC,kBAAmB,OAAyB;QAAzB,wBAAA,EAAA,YAAyB;QAA5C,YACE,kBAAM,cAAc,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,SACvC;QAFkB,aAAO,GAAP,OAAO,CAAkB;;IAE5C,CAAC;IACH,eAAC;AAAD,CAAC,AALD,CAA8B,UAAU,GAKvC","sourcesContent":["import type { RequestHandler } from \"../core/index.js\";\nimport { ApolloLink } from \"../core/index.js\";\nimport type { HttpOptions } from \"./selectHttpOptionsAndBody.js\";\nimport { createHttpLink } from \"./createHttpLink.js\";\n\nexport class HttpLink extends ApolloLink {\n public requester: RequestHandler;\n constructor(public options: HttpOptions = {}) {\n super(createHttpLink(options).request);\n }\n}\n"]}
@@ -1,2 +1,2 @@
1
- export declare const checkFetcher: (fetcher: WindowOrWorkerGlobalScope['fetch'] | undefined) => void;
1
+ export declare const checkFetcher: (fetcher: WindowOrWorkerGlobalScope["fetch"] | undefined) => void;
2
2
  //# sourceMappingURL=checkFetcher.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"checkFetcher.d.ts","sourceRoot":"","sources":["../../../src/link/http/checkFetcher.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,YAAY,YAAa,yBAAyB,CAAC,OAAO,CAAC,GAAG,SAAS,SAenF,CAAC"}
1
+ {"version":3,"file":"checkFetcher.d.ts","sourceRoot":"","sources":["../../../src/link/http/checkFetcher.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,YAAY,YACd,yBAAyB,CAAC,OAAO,CAAC,GAAG,SAAS,SAgBxD,CAAC"}
@@ -1,6 +1,6 @@
1
- import { newInvariantError } from '../../utilities/globals/index.js';
1
+ import { newInvariantError } from "../../utilities/globals/index.js";
2
2
  export var checkFetcher = function (fetcher) {
3
- if (!fetcher && typeof fetch === 'undefined') {
3
+ if (!fetcher && typeof fetch === "undefined") {
4
4
  throw newInvariantError(35);
5
5
  }
6
6
  };
@@ -1 +1 @@
1
- {"version":3,"file":"checkFetcher.js","sourceRoot":"","sources":["../../../src/link/http/checkFetcher.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AAErE,MAAM,CAAC,IAAM,YAAY,GAAG,UAAC,OAAuD;IAClF,IAAI,CAAC,OAAO,IAAI,OAAO,KAAK,KAAK,WAAW,EAAE;QAC5C,MAAM,iBAAiB,CAAC,obAWvB,CAAC,CAAC;KACJ;AACH,CAAC,CAAC","sourcesContent":["import { newInvariantError } from '../../utilities/globals/index.js';\n\nexport const checkFetcher = (fetcher: WindowOrWorkerGlobalScope['fetch'] | undefined) => {\n if (!fetcher && typeof fetch === 'undefined') {\n throw newInvariantError(`\n\"fetch\" has not been found globally and no fetcher has been \\\nconfigured. To fix this, install a fetch package (like \\\nhttps://www.npmjs.com/package/cross-fetch), instantiate the \\\nfetcher, and pass it into your HttpLink constructor. For example:\n\nimport fetch from 'cross-fetch';\nimport { ApolloClient, HttpLink } from '@apollo/client';\nconst client = new ApolloClient({\n link: new HttpLink({ uri: '/graphql', fetch })\n});\n `);\n }\n};\n"]}
1
+ {"version":3,"file":"checkFetcher.js","sourceRoot":"","sources":["../../../src/link/http/checkFetcher.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AAErE,MAAM,CAAC,IAAM,YAAY,GAAG,UAC1B,OAAuD;IAEvD,IAAI,CAAC,OAAO,IAAI,OAAO,KAAK,KAAK,WAAW,EAAE;QAC5C,MAAM,iBAAiB,CAAC,obAWvB,CAAC,CAAC;KACJ;AACH,CAAC,CAAC","sourcesContent":["import { newInvariantError } from \"../../utilities/globals/index.js\";\n\nexport const checkFetcher = (\n fetcher: WindowOrWorkerGlobalScope[\"fetch\"] | undefined\n) => {\n if (!fetcher && typeof fetch === \"undefined\") {\n throw newInvariantError(`\n\"fetch\" has not been found globally and no fetcher has been \\\nconfigured. To fix this, install a fetch package (like \\\nhttps://www.npmjs.com/package/cross-fetch), instantiate the \\\nfetcher, and pass it into your HttpLink constructor. For example:\n\nimport fetch from 'cross-fetch';\nimport { ApolloClient, HttpLink } from '@apollo/client';\nconst client = new ApolloClient({\n link: new HttpLink({ uri: '/graphql', fetch })\n});\n `);\n }\n};\n"]}
@@ -1,4 +1,4 @@
1
- import { ApolloLink } from '../core/index.js';
2
- import type { HttpOptions } from './selectHttpOptionsAndBody.js';
1
+ import { ApolloLink } from "../core/index.js";
2
+ import type { HttpOptions } from "./selectHttpOptionsAndBody.js";
3
3
  export declare const createHttpLink: (linkOptions?: HttpOptions) => ApolloLink;
4
4
  //# sourceMappingURL=createHttpLink.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"createHttpLink.d.ts","sourceRoot":"","sources":["../../../src/link/http/createHttpLink.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAU9C,OAAO,KAAK,EACV,WAAW,EACZ,MAAM,+BAA+B,CAAC;AAgBvC,eAAO,MAAM,cAAc,iBAAiB,WAAW,eAkLtD,CAAC"}
1
+ {"version":3,"file":"createHttpLink.d.ts","sourceRoot":"","sources":["../../../src/link/http/createHttpLink.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAU9C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAgBjE,eAAO,MAAM,cAAc,iBAAiB,WAAW,eA0LtD,CAAC"}
@@ -1,19 +1,19 @@
1
1
  import { __assign, __rest } from "tslib";
2
- import { invariant } from '../../utilities/globals/index.js';
3
- import { ApolloLink } from '../core/index.js';
4
- import { Observable, hasDirectives } from '../../utilities/index.js';
5
- import { serializeFetchParameter } from './serializeFetchParameter.js';
6
- import { selectURI } from './selectURI.js';
7
- import { handleError, readMultipartBody, parseAndCheckHttpResponse } from './parseAndCheckHttpResponse.js';
8
- import { checkFetcher } from './checkFetcher.js';
9
- import { selectHttpOptionsAndBodyInternal, defaultPrinter, fallbackHttpConfig } from './selectHttpOptionsAndBody.js';
10
- import { rewriteURIForGET } from './rewriteURIForGET.js';
11
- import { fromError, filterOperationVariables } from '../utils/index.js';
12
- import { maybe, getMainDefinition, removeClientSetsFromDocument } from '../../utilities/index.js';
2
+ import { invariant } from "../../utilities/globals/index.js";
3
+ import { ApolloLink } from "../core/index.js";
4
+ import { Observable, hasDirectives } from "../../utilities/index.js";
5
+ import { serializeFetchParameter } from "./serializeFetchParameter.js";
6
+ import { selectURI } from "./selectURI.js";
7
+ import { handleError, readMultipartBody, parseAndCheckHttpResponse, } from "./parseAndCheckHttpResponse.js";
8
+ import { checkFetcher } from "./checkFetcher.js";
9
+ import { selectHttpOptionsAndBodyInternal, defaultPrinter, fallbackHttpConfig, } from "./selectHttpOptionsAndBody.js";
10
+ import { rewriteURIForGET } from "./rewriteURIForGET.js";
11
+ import { fromError, filterOperationVariables } from "../utils/index.js";
12
+ import { maybe, getMainDefinition, removeClientSetsFromDocument, } from "../../utilities/index.js";
13
13
  var backupFetch = maybe(function () { return fetch; });
14
14
  export var createHttpLink = function (linkOptions) {
15
15
  if (linkOptions === void 0) { linkOptions = {}; }
16
- 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 = __rest(linkOptions, ["uri", "fetch", "print", "includeExtensions", "preserveHeaderCase", "useGETForQueries", "includeUnusedVariables"]);
16
+ 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 = __rest(linkOptions, ["uri", "fetch", "print", "includeExtensions", "preserveHeaderCase", "useGETForQueries", "includeUnusedVariables"]);
17
17
  if (globalThis.__DEV__ !== false) {
18
18
  checkFetcher(preferredFetch || backupFetch);
19
19
  }
@@ -30,10 +30,10 @@ export var createHttpLink = function (linkOptions) {
30
30
  if (context.clientAwareness) {
31
31
  var _a = context.clientAwareness, name_1 = _a.name, version = _a.version;
32
32
  if (name_1) {
33
- clientAwarenessHeaders['apollographql-client-name'] = name_1;
33
+ clientAwarenessHeaders["apollographql-client-name"] = name_1;
34
34
  }
35
35
  if (version) {
36
- clientAwarenessHeaders['apollographql-client-version'] = version;
36
+ clientAwarenessHeaders["apollographql-client-version"] = version;
37
37
  }
38
38
  }
39
39
  var contextHeaders = __assign(__assign({}, clientAwarenessHeaders), context.headers);
@@ -43,10 +43,10 @@ export var createHttpLink = function (linkOptions) {
43
43
  credentials: context.credentials,
44
44
  headers: contextHeaders,
45
45
  };
46
- if (hasDirectives(['client'], operation.query)) {
46
+ if (hasDirectives(["client"], operation.query)) {
47
47
  var transformedQuery = removeClientSetsFromDocument(operation.query);
48
48
  if (!transformedQuery) {
49
- 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`.'));
49
+ 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`."));
50
50
  }
51
51
  operation.query = transformedQuery;
52
52
  }
@@ -55,21 +55,21 @@ export var createHttpLink = function (linkOptions) {
55
55
  body.variables = filterOperationVariables(body.variables, operation.query);
56
56
  }
57
57
  var controller;
58
- if (!options.signal && typeof AbortController !== 'undefined') {
58
+ if (!options.signal && typeof AbortController !== "undefined") {
59
59
  controller = new AbortController();
60
60
  options.signal = controller.signal;
61
61
  }
62
62
  var definitionIsMutation = function (d) {
63
- return d.kind === 'OperationDefinition' && d.operation === 'mutation';
63
+ return d.kind === "OperationDefinition" && d.operation === "mutation";
64
64
  };
65
65
  var definitionIsSubscription = function (d) {
66
- return d.kind === 'OperationDefinition' && d.operation === 'subscription';
66
+ return d.kind === "OperationDefinition" && d.operation === "subscription";
67
67
  };
68
68
  var isSubscription = definitionIsSubscription(getMainDefinition(operation.query));
69
- var hasDefer = hasDirectives(['defer'], operation.query);
69
+ var hasDefer = hasDirectives(["defer"], operation.query);
70
70
  if (useGETForQueries &&
71
71
  !operation.query.definitions.some(definitionIsMutation)) {
72
- options.method = 'GET';
72
+ options.method = "GET";
73
73
  }
74
74
  if (hasDefer || isSubscription) {
75
75
  options.headers = options.headers || {};
@@ -78,14 +78,15 @@ export var createHttpLink = function (linkOptions) {
78
78
  globalThis.__DEV__ !== false && invariant.warn(36);
79
79
  }
80
80
  if (isSubscription) {
81
- acceptHeader += 'boundary=graphql;subscriptionSpec=1.0,application/json';
81
+ acceptHeader +=
82
+ "boundary=graphql;subscriptionSpec=1.0,application/json";
82
83
  }
83
84
  else if (hasDefer) {
84
- acceptHeader += 'deferSpec=20220824,application/json';
85
+ acceptHeader += "deferSpec=20220824,application/json";
85
86
  }
86
87
  options.headers.accept = acceptHeader;
87
88
  }
88
- if (options.method === 'GET') {
89
+ if (options.method === "GET") {
89
90
  var _c = rewriteURIForGET(chosenURI, body), newURI = _c.newURI, parseError = _c.parseError;
90
91
  if (parseError) {
91
92
  return fromError(parseError);
@@ -94,7 +95,7 @@ export var createHttpLink = function (linkOptions) {
94
95
  }
95
96
  else {
96
97
  try {
97
- options.body = serializeFetchParameter(body, 'Payload');
98
+ options.body = serializeFetchParameter(body, "Payload");
98
99
  }
99
100
  catch (parseError) {
100
101
  return fromError(parseError);
@@ -107,7 +108,7 @@ export var createHttpLink = function (linkOptions) {
107
108
  .then(function (response) {
108
109
  var _a;
109
110
  operation.setContext({ response: response });
110
- var ctype = (_a = response.headers) === null || _a === void 0 ? void 0 : _a.get('content-type');
111
+ var ctype = (_a = response.headers) === null || _a === void 0 ? void 0 : _a.get("content-type");
111
112
  if (ctype !== null && /^multipart\/mixed/i.test(ctype)) {
112
113
  return readMultipartBody(response, observerNext);
113
114
  }
@@ -1 +1 @@
1
- {"version":3,"file":"createHttpLink.js","sourceRoot":"","sources":["../../../src/link/http/createHttpLink.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,kC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pD,IAAI,KAAK,KAAK,IAAI,IAAI,oBAAoB,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE;oBACtD,OAAO,iBAAiB,CAAC,QAAQ,EAAE,YAAY,CAAC,CAAC;iBAClD;qBAAM;oBACL,OAAO,yBAAyB,CAAC,SAAS,CAAC,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;iBAC1E;YACH,CAAC,CAAC;iBACD,IAAI,CAAC;gBACJ,UAAU,GAAG,SAAS,CAAC;gBACvB,QAAQ,CAAC,QAAQ,EAAE,CAAC;YACtB,CAAC,CAAC;iBACD,KAAK,CAAC,UAAA,GAAG;gBACR,UAAU,GAAG,SAAS,CAAC;gBACvB,WAAW,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAA;YAC5B,CAAC,CAAC,CAAC;YAEL,OAAO;gBAGL,IAAI,UAAU;oBAAE,UAAU,CAAC,KAAK,EAAE,CAAC;YACrC,CAAC,CAAC;QACJ,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC","sourcesContent":["import { invariant } from '../../utilities/globals/index.js';\n\nimport type { DefinitionNode } from 'graphql';\n\nimport { ApolloLink } from '../core/index.js';\nimport { Observable, hasDirectives } from '../../utilities/index.js';\nimport { serializeFetchParameter } from './serializeFetchParameter.js';\nimport { selectURI } from './selectURI.js';\nimport {\n handleError,\n readMultipartBody,\n parseAndCheckHttpResponse\n} from './parseAndCheckHttpResponse.js';\nimport { checkFetcher } from './checkFetcher.js';\nimport type {\n HttpOptions\n} from './selectHttpOptionsAndBody.js';\nimport {\n selectHttpOptionsAndBodyInternal,\n defaultPrinter,\n fallbackHttpConfig\n} from './selectHttpOptionsAndBody.js';\nimport { rewriteURIForGET } from './rewriteURIForGET.js';\nimport { fromError, filterOperationVariables } from '../utils/index.js';\nimport {\n maybe,\n getMainDefinition,\n removeClientSetsFromDocument\n} from '../../utilities/index.js';\n\nconst backupFetch = maybe(() => fetch);\n\nexport const createHttpLink = (linkOptions: HttpOptions = {}) => {\n let {\n uri = '/graphql',\n // use default global fetch if nothing passed in\n fetch: preferredFetch,\n print = defaultPrinter,\n includeExtensions,\n preserveHeaderCase,\n useGETForQueries,\n includeUnusedVariables = false,\n ...requestOptions\n } = linkOptions;\n\n if (__DEV__) {\n // Make sure at least one of preferredFetch, window.fetch, or backupFetch is\n // defined, so requests won't fail at runtime.\n checkFetcher(preferredFetch || backupFetch);\n }\n\n const linkConfig = {\n http: { includeExtensions, preserveHeaderCase },\n options: requestOptions.fetchOptions,\n credentials: requestOptions.credentials,\n headers: requestOptions.headers,\n };\n\n return new ApolloLink(operation => {\n let chosenURI = selectURI(operation, uri);\n\n const context = operation.getContext();\n\n // `apollographql-client-*` headers are automatically set if a\n // `clientAwareness` object is found in the context. These headers are\n // set first, followed by the rest of the headers pulled from\n // `context.headers`. If desired, `apollographql-client-*` headers set by\n // the `clientAwareness` object can be overridden by\n // `apollographql-client-*` headers set in `context.headers`.\n const clientAwarenessHeaders: {\n 'apollographql-client-name'?: string;\n 'apollographql-client-version'?: string;\n } = {};\n\n if (context.clientAwareness) {\n const { name, version } = context.clientAwareness;\n if (name) {\n clientAwarenessHeaders['apollographql-client-name'] = name;\n }\n if (version) {\n clientAwarenessHeaders['apollographql-client-version'] = version;\n }\n }\n\n const contextHeaders = { ...clientAwarenessHeaders, ...context.headers };\n\n const contextConfig = {\n http: context.http,\n options: context.fetchOptions,\n credentials: context.credentials,\n headers: contextHeaders,\n };\n\n if (hasDirectives(['client'], operation.query)) {\n const transformedQuery = removeClientSetsFromDocument(operation.query);\n\n if (!transformedQuery) {\n return fromError(\n new Error(\n '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`.'\n )\n );\n }\n\n operation.query = transformedQuery;\n }\n\n //uses fallback, link, and then context to build options\n const { options, body } = selectHttpOptionsAndBodyInternal(\n operation,\n print,\n fallbackHttpConfig,\n linkConfig,\n contextConfig,\n );\n\n if (body.variables && !includeUnusedVariables) {\n body.variables = filterOperationVariables(body.variables, operation.query);\n }\n\n let controller: AbortController | undefined;\n if (!options.signal && typeof AbortController !== 'undefined') {\n controller = new AbortController();\n options.signal = controller.signal;\n }\n\n // If requested, set method to GET if there are no mutations.\n const definitionIsMutation = (d: DefinitionNode) => {\n return d.kind === 'OperationDefinition' && d.operation === 'mutation';\n };\n const definitionIsSubscription = (d: DefinitionNode) => {\n return d.kind === 'OperationDefinition' && d.operation === 'subscription';\n };\n const isSubscription = definitionIsSubscription(getMainDefinition(operation.query));\n // does not match custom directives beginning with @defer\n const hasDefer = hasDirectives(['defer'], operation.query);\n if (\n useGETForQueries &&\n !operation.query.definitions.some(definitionIsMutation)\n ) {\n options.method = 'GET';\n }\n\n if (hasDefer || isSubscription) {\n options.headers = options.headers || {};\n let acceptHeader = \"multipart/mixed;\";\n // Omit defer-specific headers if the user attempts to defer a selection\n // set on a subscription and log a warning.\n if (isSubscription && hasDefer) {\n invariant.warn(\"Multipart-subscriptions do not support @defer\");\n }\n\n if (isSubscription) {\n acceptHeader += 'boundary=graphql;subscriptionSpec=1.0,application/json';\n } else if (hasDefer) {\n acceptHeader += 'deferSpec=20220824,application/json';\n }\n options.headers.accept = acceptHeader;\n }\n\n if (options.method === 'GET') {\n const { newURI, parseError } = rewriteURIForGET(chosenURI, body);\n if (parseError) {\n return fromError(parseError);\n }\n chosenURI = newURI;\n } else {\n try {\n (options as any).body = serializeFetchParameter(body, 'Payload');\n } catch (parseError) {\n return fromError(parseError);\n }\n }\n\n return new Observable(observer => {\n // Prefer linkOptions.fetch (preferredFetch) if provided, and otherwise\n // fall back to the *current* global window.fetch function (see issue\n // #7832), or (if all else fails) the backupFetch function we saved when\n // this module was first evaluated. This last option protects against the\n // removal of window.fetch, which is unlikely but not impossible.\n const currentFetch = preferredFetch || maybe(() => fetch) || backupFetch;\n\n const observerNext = observer.next.bind(observer);\n currentFetch!(chosenURI, options)\n .then(response => {\n operation.setContext({ response });\n const ctype = response.headers?.get('content-type');\n\n if (ctype !== null && /^multipart\\/mixed/i.test(ctype)) {\n return readMultipartBody(response, observerNext);\n } else {\n return parseAndCheckHttpResponse(operation)(response).then(observerNext);\n }\n })\n .then(() => {\n controller = undefined;\n observer.complete();\n })\n .catch(err => {\n controller = undefined;\n handleError(err, observer)\n });\n\n return () => {\n // XXX support canceling this request\n // https://developers.google.com/web/updates/2017/09/abortable-fetch\n if (controller) controller.abort();\n };\n });\n });\n};\n"]}
1
+ {"version":3,"file":"createHttpLink.js","sourceRoot":"","sources":["../../../src/link/http/createHttpLink.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,kCAAkC,CAAC;AAI7D,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AACrE,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AACvE,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EACL,WAAW,EACX,iBAAiB,EACjB,yBAAyB,GAC1B,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEjD,OAAO,EACL,gCAAgC,EAChC,cAAc,EACd,kBAAkB,GACnB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,SAAS,EAAE,wBAAwB,EAAE,MAAM,mBAAmB,CAAC;AACxE,OAAO,EACL,KAAK,EACL,iBAAiB,EACjB,4BAA4B,GAC7B,MAAM,0BAA0B,CAAC;AAElC,IAAM,WAAW,GAAG,KAAK,CAAC,cAAM,OAAA,KAAK,EAAL,CAAK,CAAC,CAAC;AAEvC,MAAM,CAAC,IAAM,cAAc,GAAG,UAAC,WAA6B;IAA7B,4BAAA,EAAA,gBAA6B;IAExD,IAAA,KASE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7B,IAAM,YAAY,GAAG,cAAc,IAAI,KAAK,CAAC,cAAM,OAAA,KAAK,EAAL,CAAK,CAAC,IAAI,WAAW,CAAC;YAEzE,IAAM,YAAY,GAAG,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;YAClD,YAAa,CAAC,SAAS,EAAE,OAAO,CAAC;iBAC9B,IAAI,CAAC,UAAC,QAAQ;;gBACb,SAAS,CAAC,UAAU,CAAC,EAAE,QAAQ,UAAA,EAAE,CAAC,CAAC;gBACnC,IAAM,KAAK,GAAG,MAAA,QAAQ,CAAC,OAAO,0CAAE,GAAG,CAAC,cAAc,CAAC,CAAC;gBAEpD,IAAI,KAAK,KAAK,IAAI,IAAI,oBAAoB,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE;oBACtD,OAAO,iBAAiB,CAAC,QAAQ,EAAE,YAAY,CAAC,CAAC;iBAClD;qBAAM;oBACL,OAAO,yBAAyB,CAAC,SAAS,CAAC,CAAC,QAAQ,CAAC,CAAC,IAAI,CACxD,YAAY,CACb,CAAC;iBACH;YACH,CAAC,CAAC;iBACD,IAAI,CAAC;gBACJ,UAAU,GAAG,SAAS,CAAC;gBACvB,QAAQ,CAAC,QAAQ,EAAE,CAAC;YACtB,CAAC,CAAC;iBACD,KAAK,CAAC,UAAC,GAAG;gBACT,UAAU,GAAG,SAAS,CAAC;gBACvB,WAAW,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAC;YAC7B,CAAC,CAAC,CAAC;YAEL,OAAO;gBAGL,IAAI,UAAU;oBAAE,UAAU,CAAC,KAAK,EAAE,CAAC;YACrC,CAAC,CAAC;QACJ,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC","sourcesContent":["import { invariant } from \"../../utilities/globals/index.js\";\n\nimport type { DefinitionNode } from \"graphql\";\n\nimport { ApolloLink } from \"../core/index.js\";\nimport { Observable, hasDirectives } from \"../../utilities/index.js\";\nimport { serializeFetchParameter } from \"./serializeFetchParameter.js\";\nimport { selectURI } from \"./selectURI.js\";\nimport {\n handleError,\n readMultipartBody,\n parseAndCheckHttpResponse,\n} from \"./parseAndCheckHttpResponse.js\";\nimport { checkFetcher } from \"./checkFetcher.js\";\nimport type { HttpOptions } from \"./selectHttpOptionsAndBody.js\";\nimport {\n selectHttpOptionsAndBodyInternal,\n defaultPrinter,\n fallbackHttpConfig,\n} from \"./selectHttpOptionsAndBody.js\";\nimport { rewriteURIForGET } from \"./rewriteURIForGET.js\";\nimport { fromError, filterOperationVariables } from \"../utils/index.js\";\nimport {\n maybe,\n getMainDefinition,\n removeClientSetsFromDocument,\n} from \"../../utilities/index.js\";\n\nconst backupFetch = maybe(() => fetch);\n\nexport const createHttpLink = (linkOptions: HttpOptions = {}) => {\n let {\n uri = \"/graphql\",\n // use default global fetch if nothing passed in\n fetch: preferredFetch,\n print = defaultPrinter,\n includeExtensions,\n preserveHeaderCase,\n useGETForQueries,\n includeUnusedVariables = false,\n ...requestOptions\n } = linkOptions;\n\n if (__DEV__) {\n // Make sure at least one of preferredFetch, window.fetch, or backupFetch is\n // defined, so requests won't fail at runtime.\n checkFetcher(preferredFetch || backupFetch);\n }\n\n const linkConfig = {\n http: { includeExtensions, preserveHeaderCase },\n options: requestOptions.fetchOptions,\n credentials: requestOptions.credentials,\n headers: requestOptions.headers,\n };\n\n return new ApolloLink((operation) => {\n let chosenURI = selectURI(operation, uri);\n\n const context = operation.getContext();\n\n // `apollographql-client-*` headers are automatically set if a\n // `clientAwareness` object is found in the context. These headers are\n // set first, followed by the rest of the headers pulled from\n // `context.headers`. If desired, `apollographql-client-*` headers set by\n // the `clientAwareness` object can be overridden by\n // `apollographql-client-*` headers set in `context.headers`.\n const clientAwarenessHeaders: {\n \"apollographql-client-name\"?: string;\n \"apollographql-client-version\"?: string;\n } = {};\n\n if (context.clientAwareness) {\n const { name, version } = context.clientAwareness;\n if (name) {\n clientAwarenessHeaders[\"apollographql-client-name\"] = name;\n }\n if (version) {\n clientAwarenessHeaders[\"apollographql-client-version\"] = version;\n }\n }\n\n const contextHeaders = { ...clientAwarenessHeaders, ...context.headers };\n\n const contextConfig = {\n http: context.http,\n options: context.fetchOptions,\n credentials: context.credentials,\n headers: contextHeaders,\n };\n\n if (hasDirectives([\"client\"], operation.query)) {\n const transformedQuery = removeClientSetsFromDocument(operation.query);\n\n if (!transformedQuery) {\n return fromError(\n new Error(\n \"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`.\"\n )\n );\n }\n\n operation.query = transformedQuery;\n }\n\n //uses fallback, link, and then context to build options\n const { options, body } = selectHttpOptionsAndBodyInternal(\n operation,\n print,\n fallbackHttpConfig,\n linkConfig,\n contextConfig\n );\n\n if (body.variables && !includeUnusedVariables) {\n body.variables = filterOperationVariables(\n body.variables,\n operation.query\n );\n }\n\n let controller: AbortController | undefined;\n if (!options.signal && typeof AbortController !== \"undefined\") {\n controller = new AbortController();\n options.signal = controller.signal;\n }\n\n // If requested, set method to GET if there are no mutations.\n const definitionIsMutation = (d: DefinitionNode) => {\n return d.kind === \"OperationDefinition\" && d.operation === \"mutation\";\n };\n const definitionIsSubscription = (d: DefinitionNode) => {\n return d.kind === \"OperationDefinition\" && d.operation === \"subscription\";\n };\n const isSubscription = definitionIsSubscription(\n getMainDefinition(operation.query)\n );\n // does not match custom directives beginning with @defer\n const hasDefer = hasDirectives([\"defer\"], operation.query);\n if (\n useGETForQueries &&\n !operation.query.definitions.some(definitionIsMutation)\n ) {\n options.method = \"GET\";\n }\n\n if (hasDefer || isSubscription) {\n options.headers = options.headers || {};\n let acceptHeader = \"multipart/mixed;\";\n // Omit defer-specific headers if the user attempts to defer a selection\n // set on a subscription and log a warning.\n if (isSubscription && hasDefer) {\n invariant.warn(\"Multipart-subscriptions do not support @defer\");\n }\n\n if (isSubscription) {\n acceptHeader +=\n \"boundary=graphql;subscriptionSpec=1.0,application/json\";\n } else if (hasDefer) {\n acceptHeader += \"deferSpec=20220824,application/json\";\n }\n options.headers.accept = acceptHeader;\n }\n\n if (options.method === \"GET\") {\n const { newURI, parseError } = rewriteURIForGET(chosenURI, body);\n if (parseError) {\n return fromError(parseError);\n }\n chosenURI = newURI;\n } else {\n try {\n (options as any).body = serializeFetchParameter(body, \"Payload\");\n } catch (parseError) {\n return fromError(parseError);\n }\n }\n\n return new Observable((observer) => {\n // Prefer linkOptions.fetch (preferredFetch) if provided, and otherwise\n // fall back to the *current* global window.fetch function (see issue\n // #7832), or (if all else fails) the backupFetch function we saved when\n // this module was first evaluated. This last option protects against the\n // removal of window.fetch, which is unlikely but not impossible.\n const currentFetch = preferredFetch || maybe(() => fetch) || backupFetch;\n\n const observerNext = observer.next.bind(observer);\n currentFetch!(chosenURI, options)\n .then((response) => {\n operation.setContext({ response });\n const ctype = response.headers?.get(\"content-type\");\n\n if (ctype !== null && /^multipart\\/mixed/i.test(ctype)) {\n return readMultipartBody(response, observerNext);\n } else {\n return parseAndCheckHttpResponse(operation)(response).then(\n observerNext\n );\n }\n })\n .then(() => {\n controller = undefined;\n observer.complete();\n })\n .catch((err) => {\n controller = undefined;\n handleError(err, observer);\n });\n\n return () => {\n // XXX support canceling this request\n // https://developers.google.com/web/updates/2017/09/abortable-fetch\n if (controller) controller.abort();\n };\n });\n });\n};\n"]}
@@ -1,5 +1,5 @@
1
1
  export var createSignalIfSupported = function () {
2
- if (typeof AbortController === 'undefined')
2
+ if (typeof AbortController === "undefined")
3
3
  return { controller: false, signal: false };
4
4
  var controller = new AbortController();
5
5
  var signal = controller.signal;
@@ -1 +1 @@
1
- {"version":3,"file":"createSignalIfSupported.js","sourceRoot":"","sources":["../../../src/link/http/createSignalIfSupported.ts"],"names":[],"mappings":"AAKA,MAAM,CAAC,IAAM,uBAAuB,GAAG;IACrC,IAAI,OAAO,eAAe,KAAK,WAAW;QACxC,OAAO,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC;IAE9C,IAAM,UAAU,GAAG,IAAI,eAAe,EAAE,CAAC;IACzC,IAAM,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC;IACjC,OAAO,EAAE,UAAU,YAAA,EAAE,MAAM,QAAA,EAAE,CAAC;AAChC,CAAC,CAAC","sourcesContent":["/**\n * @deprecated \n * This is not used internally any more and will be removed in\n * the next major version of Apollo Client.\n */\nexport const createSignalIfSupported = () => {\n if (typeof AbortController === 'undefined')\n return { controller: false, signal: false };\n\n const controller = new AbortController();\n const signal = controller.signal;\n return { controller, signal };\n};\n"]}
1
+ {"version":3,"file":"createSignalIfSupported.js","sourceRoot":"","sources":["../../../src/link/http/createSignalIfSupported.ts"],"names":[],"mappings":"AAKA,MAAM,CAAC,IAAM,uBAAuB,GAAG;IACrC,IAAI,OAAO,eAAe,KAAK,WAAW;QACxC,OAAO,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC;IAE9C,IAAM,UAAU,GAAG,IAAI,eAAe,EAAE,CAAC;IACzC,IAAM,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC;IACjC,OAAO,EAAE,UAAU,YAAA,EAAE,MAAM,QAAA,EAAE,CAAC;AAChC,CAAC,CAAC","sourcesContent":["/**\n * @deprecated\n * This is not used internally any more and will be removed in\n * the next major version of Apollo Client.\n */\nexport const createSignalIfSupported = () => {\n if (typeof AbortController === \"undefined\")\n return { controller: false, signal: false };\n\n const controller = new AbortController();\n const signal = controller.signal;\n return { controller, signal };\n};\n"]}