@apollo/client 4.0.0-rc.6 → 4.0.0-rc.8

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 (351) hide show
  1. package/CHANGELOG.md +159 -0
  2. package/__cjs/cache/core/cache.cjs +12 -7
  3. package/__cjs/cache/core/cache.cjs.map +1 -1
  4. package/__cjs/cache/core/cache.d.cts +12 -7
  5. package/__cjs/core/ApolloClient.cjs +2 -2
  6. package/__cjs/core/ApolloClient.cjs.map +1 -1
  7. package/__cjs/core/ApolloClient.d.cts +80 -98
  8. package/__cjs/core/ObservableQuery.d.cts +41 -74
  9. package/__cjs/core/QueryInfo.cjs.map +1 -1
  10. package/__cjs/core/QueryInfo.d.cts +3 -3
  11. package/__cjs/core/QueryManager.cjs +0 -2
  12. package/__cjs/core/QueryManager.cjs.map +1 -1
  13. package/__cjs/core/QueryManager.d.cts +3 -3
  14. package/__cjs/core/index.cjs +1 -2
  15. package/__cjs/core/index.cjs.map +1 -1
  16. package/__cjs/core/index.d.cts +2 -3
  17. package/__cjs/core/types.d.cts +40 -28
  18. package/__cjs/errors/CombinedGraphQLErrors.cjs +22 -17
  19. package/__cjs/errors/CombinedGraphQLErrors.cjs.map +1 -1
  20. package/__cjs/errors/CombinedGraphQLErrors.d.cts +39 -20
  21. package/__cjs/errors/CombinedProtocolErrors.cjs +12 -6
  22. package/__cjs/errors/CombinedProtocolErrors.cjs.map +1 -1
  23. package/__cjs/errors/CombinedProtocolErrors.d.cts +12 -6
  24. package/__cjs/errors/ServerError.cjs +2 -1
  25. package/__cjs/errors/ServerError.cjs.map +1 -1
  26. package/__cjs/errors/ServerError.d.cts +2 -1
  27. package/__cjs/errors/ServerParseError.cjs +2 -1
  28. package/__cjs/errors/ServerParseError.cjs.map +1 -1
  29. package/__cjs/errors/ServerParseError.d.cts +2 -1
  30. package/__cjs/incremental/handlers/defer20220824.cjs.map +1 -1
  31. package/__cjs/incremental/handlers/defer20220824.d.cts +4 -4
  32. package/__cjs/incremental/handlers/notImplemented.cjs.map +1 -1
  33. package/__cjs/incremental/handlers/notImplemented.d.cts +2 -2
  34. package/__cjs/incremental/types.d.cts +4 -4
  35. package/__cjs/invariantErrorCodes.cjs +15 -11
  36. package/__cjs/link/batch/batchLink.cjs +4 -12
  37. package/__cjs/link/batch/batchLink.cjs.map +1 -1
  38. package/__cjs/link/batch/batchLink.d.cts +36 -28
  39. package/__cjs/link/batch/batching.cjs +1 -1
  40. package/__cjs/link/batch/batching.cjs.map +1 -1
  41. package/__cjs/link/batch/batching.d.cts +8 -8
  42. package/__cjs/link/batch/index.cjs +1 -2
  43. package/__cjs/link/batch/index.cjs.map +1 -1
  44. package/__cjs/link/batch/index.d.cts +1 -2
  45. package/__cjs/link/batch-http/batchHttpLink.cjs +29 -6
  46. package/__cjs/link/batch-http/batchHttpLink.cjs.map +1 -1
  47. package/__cjs/link/batch-http/batchHttpLink.d.cts +45 -6
  48. package/__cjs/link/client-awareness/ClientAwarenessLink.cjs +33 -0
  49. package/__cjs/link/client-awareness/ClientAwarenessLink.cjs.map +1 -1
  50. package/__cjs/link/client-awareness/ClientAwarenessLink.d.cts +35 -2
  51. package/__cjs/link/context/index.cjs.map +1 -1
  52. package/__cjs/link/context/index.d.cts +3 -4
  53. package/__cjs/link/core/ApolloLink.cjs +226 -54
  54. package/__cjs/link/core/ApolloLink.cjs.map +1 -1
  55. package/__cjs/link/core/ApolloLink.d.cts +355 -9
  56. package/__cjs/link/core/concat.cjs +4 -0
  57. package/__cjs/link/core/concat.cjs.map +1 -1
  58. package/__cjs/link/core/concat.d.cts +4 -0
  59. package/__cjs/link/core/deprecated.cjs +3 -0
  60. package/__cjs/link/core/deprecated.cjs.map +1 -0
  61. package/__cjs/link/core/deprecated.d.cts +10 -0
  62. package/__cjs/link/core/empty.cjs +4 -0
  63. package/__cjs/link/core/empty.cjs.map +1 -1
  64. package/__cjs/link/core/empty.d.cts +4 -0
  65. package/__cjs/link/core/from.cjs +4 -0
  66. package/__cjs/link/core/from.cjs.map +1 -1
  67. package/__cjs/link/core/from.d.cts +4 -0
  68. package/__cjs/link/core/split.cjs +4 -0
  69. package/__cjs/link/core/split.cjs.map +1 -1
  70. package/__cjs/link/core/split.d.cts +4 -0
  71. package/__cjs/link/core/types.d.cts +2 -33
  72. package/__cjs/link/error/index.cjs +44 -0
  73. package/__cjs/link/error/index.cjs.map +1 -1
  74. package/__cjs/link/error/index.d.cts +68 -9
  75. package/__cjs/link/http/BaseHttpLink.cjs +3 -4
  76. package/__cjs/link/http/BaseHttpLink.cjs.map +1 -1
  77. package/__cjs/link/http/HttpLink.cjs +26 -1
  78. package/__cjs/link/http/HttpLink.cjs.map +1 -1
  79. package/__cjs/link/http/HttpLink.d.cts +191 -89
  80. package/__cjs/link/http/index.cjs +1 -3
  81. package/__cjs/link/http/index.cjs.map +1 -1
  82. package/__cjs/link/http/index.d.cts +0 -2
  83. package/__cjs/link/http/parseAndCheckHttpResponse.cjs +40 -25
  84. package/__cjs/link/http/parseAndCheckHttpResponse.cjs.map +1 -1
  85. package/__cjs/link/http/parseAndCheckHttpResponse.d.cts +2 -2
  86. package/__cjs/link/http/rewriteURIForGET.cjs +2 -3
  87. package/__cjs/link/http/rewriteURIForGET.cjs.map +1 -1
  88. package/__cjs/link/http/selectHttpOptionsAndBody.cjs.map +1 -1
  89. package/__cjs/link/http/selectHttpOptionsAndBody.d.cts +3 -3
  90. package/__cjs/link/http/selectURI.cjs.map +1 -1
  91. package/__cjs/link/http/selectURI.d.cts +2 -2
  92. package/__cjs/link/index.cjs.map +1 -1
  93. package/__cjs/link/index.d.cts +2 -1
  94. package/__cjs/link/persisted-queries/index.cjs.map +1 -1
  95. package/__cjs/link/persisted-queries/index.d.cts +23 -25
  96. package/__cjs/link/remove-typename/index.cjs.map +1 -1
  97. package/__cjs/link/remove-typename/index.d.cts +0 -1
  98. package/__cjs/link/remove-typename/removeTypenameFromVariables.cjs.map +1 -1
  99. package/__cjs/link/remove-typename/removeTypenameFromVariables.d.cts +9 -8
  100. package/__cjs/link/retry/delayFunction.cjs.map +1 -1
  101. package/__cjs/link/retry/delayFunction.d.cts +2 -39
  102. package/__cjs/link/retry/retryFunction.cjs.map +1 -1
  103. package/__cjs/link/retry/retryFunction.d.cts +2 -29
  104. package/__cjs/link/retry/retryLink.cjs +12 -9
  105. package/__cjs/link/retry/retryLink.cjs.map +1 -1
  106. package/__cjs/link/retry/retryLink.d.cts +57 -6
  107. package/__cjs/link/schema/index.cjs.map +1 -1
  108. package/__cjs/link/schema/index.d.cts +3 -4
  109. package/__cjs/link/subscriptions/index.cjs +23 -0
  110. package/__cjs/link/subscriptions/index.cjs.map +1 -1
  111. package/__cjs/link/subscriptions/index.d.cts +24 -2
  112. package/__cjs/link/utils/createOperation.cjs +12 -4
  113. package/__cjs/link/utils/createOperation.cjs.map +1 -1
  114. package/__cjs/link/utils/createOperation.d.cts +2 -2
  115. package/__cjs/link/utils/index.cjs +1 -5
  116. package/__cjs/link/utils/index.cjs.map +1 -1
  117. package/__cjs/link/utils/index.d.cts +0 -2
  118. package/__cjs/link/ws/index.cjs +17 -1
  119. package/__cjs/link/ws/index.cjs.map +1 -1
  120. package/__cjs/link/ws/index.d.cts +8 -2
  121. package/__cjs/react/hooks/useBackgroundQuery.cjs.map +1 -1
  122. package/__cjs/react/hooks/useBackgroundQuery.d.cts +125 -93
  123. package/__cjs/react/hooks/useFragment.cjs.map +1 -1
  124. package/__cjs/react/hooks/useFragment.d.cts +2 -2
  125. package/__cjs/react/hooks/useLazyQuery.cjs.map +1 -1
  126. package/__cjs/react/hooks/useLazyQuery.d.cts +70 -108
  127. package/__cjs/react/hooks/useLoadableQuery.cjs.map +1 -1
  128. package/__cjs/react/hooks/useLoadableQuery.d.cts +52 -61
  129. package/__cjs/react/hooks/useMutation.cjs.map +1 -1
  130. package/__cjs/react/hooks/useMutation.d.cts +36 -54
  131. package/__cjs/react/hooks/useQuery.cjs.map +1 -1
  132. package/__cjs/react/hooks/useQuery.d.cts +64 -105
  133. package/__cjs/react/hooks/useQueryRefHandlers.cjs.map +1 -1
  134. package/__cjs/react/hooks/useQueryRefHandlers.d.cts +17 -8
  135. package/__cjs/react/hooks/useReadQuery.cjs.map +1 -1
  136. package/__cjs/react/hooks/useReadQuery.d.cts +6 -9
  137. package/__cjs/react/hooks/useSubscription.cjs.map +1 -1
  138. package/__cjs/react/hooks/useSubscription.d.cts +32 -24
  139. package/__cjs/react/hooks/useSuspenseFragment.cjs.map +1 -1
  140. package/__cjs/react/hooks/useSuspenseQuery.cjs.map +1 -1
  141. package/__cjs/react/hooks/useSuspenseQuery.d.cts +75 -94
  142. package/__cjs/react/internal/cache/QueryReference.cjs.map +1 -1
  143. package/__cjs/react/internal/cache/QueryReference.d.cts +3 -1
  144. package/__cjs/react/query-preloader/createQueryPreloader.cjs.map +1 -1
  145. package/__cjs/react/query-preloader/createQueryPreloader.d.cts +29 -20
  146. package/__cjs/react/types/types.documentation.d.cts +5 -5
  147. package/__cjs/testing/core/mocking/mockLink.cjs.map +1 -1
  148. package/__cjs/testing/core/mocking/mockLink.d.cts +5 -6
  149. package/__cjs/testing/core/mocking/mockSubscriptionLink.cjs.map +1 -1
  150. package/__cjs/testing/core/mocking/mockSubscriptionLink.d.cts +3 -4
  151. package/__cjs/utilities/internal/types/DocumentationTypes.d.cts +20 -28
  152. package/__cjs/utilities/internal/types/VariablesOption.d.cts +2 -6
  153. package/__cjs/utilities/subscriptions/relay/index.cjs +1 -2
  154. package/__cjs/utilities/subscriptions/relay/index.cjs.map +1 -1
  155. package/__cjs/version.cjs +1 -1
  156. package/cache/core/cache.d.ts +12 -7
  157. package/cache/core/cache.js +12 -7
  158. package/cache/core/cache.js.map +1 -1
  159. package/core/ApolloClient.d.ts +80 -98
  160. package/core/ApolloClient.js +2 -2
  161. package/core/ApolloClient.js.map +1 -1
  162. package/core/ObservableQuery.d.ts +41 -74
  163. package/core/QueryInfo.d.ts +3 -3
  164. package/core/QueryInfo.js.map +1 -1
  165. package/core/QueryManager.d.ts +3 -3
  166. package/core/QueryManager.js +0 -2
  167. package/core/QueryManager.js.map +1 -1
  168. package/core/index.d.ts +2 -3
  169. package/core/index.js +1 -1
  170. package/core/index.js.map +1 -1
  171. package/core/types.d.ts +40 -28
  172. package/errors/CombinedGraphQLErrors.d.ts +39 -20
  173. package/errors/CombinedGraphQLErrors.js +22 -17
  174. package/errors/CombinedGraphQLErrors.js.map +1 -1
  175. package/errors/CombinedProtocolErrors.d.ts +12 -6
  176. package/errors/CombinedProtocolErrors.js +12 -6
  177. package/errors/CombinedProtocolErrors.js.map +1 -1
  178. package/errors/ServerError.d.ts +2 -1
  179. package/errors/ServerError.js +2 -1
  180. package/errors/ServerError.js.map +1 -1
  181. package/errors/ServerParseError.d.ts +2 -1
  182. package/errors/ServerParseError.js +2 -1
  183. package/errors/ServerParseError.js.map +1 -1
  184. package/incremental/handlers/defer20220824.d.ts +4 -4
  185. package/incremental/handlers/defer20220824.js.map +1 -1
  186. package/incremental/handlers/notImplemented.d.ts +2 -2
  187. package/incremental/handlers/notImplemented.js.map +1 -1
  188. package/incremental/types.d.ts +4 -4
  189. package/incremental/types.js.map +1 -1
  190. package/invariantErrorCodes.js +15 -11
  191. package/link/batch/batchLink.d.ts +37 -29
  192. package/link/batch/batchLink.js +3 -10
  193. package/link/batch/batchLink.js.map +1 -1
  194. package/link/batch/batching.d.ts +8 -8
  195. package/link/batch/batching.js +2 -2
  196. package/link/batch/batching.js.map +1 -1
  197. package/link/batch/index.d.ts +1 -2
  198. package/link/batch/index.js +1 -1
  199. package/link/batch/index.js.map +1 -1
  200. package/link/batch-http/batchHttpLink.d.ts +46 -7
  201. package/link/batch-http/batchHttpLink.js +30 -7
  202. package/link/batch-http/batchHttpLink.js.map +1 -1
  203. package/link/client-awareness/ClientAwarenessLink.d.ts +35 -2
  204. package/link/client-awareness/ClientAwarenessLink.js +33 -0
  205. package/link/client-awareness/ClientAwarenessLink.js.map +1 -1
  206. package/link/context/index.d.ts +3 -4
  207. package/link/context/index.js.map +1 -1
  208. package/link/core/ApolloLink.d.ts +355 -9
  209. package/link/core/ApolloLink.js +227 -56
  210. package/link/core/ApolloLink.js.map +1 -1
  211. package/link/core/concat.d.ts +4 -0
  212. package/link/core/concat.js +4 -0
  213. package/link/core/concat.js.map +1 -1
  214. package/link/core/deprecated.d.ts +10 -0
  215. package/link/core/deprecated.js +2 -0
  216. package/link/core/deprecated.js.map +1 -0
  217. package/link/core/empty.d.ts +4 -0
  218. package/link/core/empty.js +4 -0
  219. package/link/core/empty.js.map +1 -1
  220. package/link/core/from.d.ts +4 -0
  221. package/link/core/from.js +4 -0
  222. package/link/core/from.js.map +1 -1
  223. package/link/core/split.d.ts +4 -0
  224. package/link/core/split.js +4 -0
  225. package/link/core/split.js.map +1 -1
  226. package/link/core/types.d.ts +2 -33
  227. package/link/core/types.js.map +1 -1
  228. package/link/error/index.d.ts +69 -10
  229. package/link/error/index.js +44 -0
  230. package/link/error/index.js.map +1 -1
  231. package/link/http/BaseHttpLink.js +3 -4
  232. package/link/http/BaseHttpLink.js.map +1 -1
  233. package/link/http/HttpLink.d.ts +192 -90
  234. package/link/http/HttpLink.js +26 -1
  235. package/link/http/HttpLink.js.map +1 -1
  236. package/link/http/index.d.ts +0 -2
  237. package/link/http/index.js +0 -1
  238. package/link/http/index.js.map +1 -1
  239. package/link/http/parseAndCheckHttpResponse.d.ts +2 -2
  240. package/link/http/parseAndCheckHttpResponse.js +40 -25
  241. package/link/http/parseAndCheckHttpResponse.js.map +1 -1
  242. package/link/http/rewriteURIForGET.js +2 -3
  243. package/link/http/rewriteURIForGET.js.map +1 -1
  244. package/link/http/selectHttpOptionsAndBody.d.ts +3 -3
  245. package/link/http/selectHttpOptionsAndBody.js.map +1 -1
  246. package/link/http/selectURI.d.ts +2 -2
  247. package/link/http/selectURI.js.map +1 -1
  248. package/link/index.d.ts +2 -1
  249. package/link/index.js.map +1 -1
  250. package/link/persisted-queries/index.d.ts +23 -25
  251. package/link/persisted-queries/index.js.map +1 -1
  252. package/link/remove-typename/index.d.ts +0 -1
  253. package/link/remove-typename/index.js.map +1 -1
  254. package/link/remove-typename/removeTypenameFromVariables.d.ts +9 -8
  255. package/link/remove-typename/removeTypenameFromVariables.js.map +1 -1
  256. package/link/retry/delayFunction.d.ts +2 -39
  257. package/link/retry/delayFunction.js.map +1 -1
  258. package/link/retry/retryFunction.d.ts +2 -29
  259. package/link/retry/retryFunction.js.map +1 -1
  260. package/link/retry/retryLink.d.ts +57 -6
  261. package/link/retry/retryLink.js +13 -10
  262. package/link/retry/retryLink.js.map +1 -1
  263. package/link/schema/index.d.ts +3 -4
  264. package/link/schema/index.js.map +1 -1
  265. package/link/subscriptions/index.d.ts +24 -2
  266. package/link/subscriptions/index.js +23 -0
  267. package/link/subscriptions/index.js.map +1 -1
  268. package/link/utils/createOperation.d.ts +2 -2
  269. package/link/utils/createOperation.js +12 -4
  270. package/link/utils/createOperation.js.map +1 -1
  271. package/link/utils/index.d.ts +0 -2
  272. package/link/utils/index.js +0 -2
  273. package/link/utils/index.js.map +1 -1
  274. package/link/ws/index.d.ts +8 -2
  275. package/link/ws/index.js +13 -1
  276. package/link/ws/index.js.map +1 -1
  277. package/package.json +1 -1
  278. package/react/hooks/useBackgroundQuery.d.ts +125 -93
  279. package/react/hooks/useBackgroundQuery.js.map +1 -1
  280. package/react/hooks/useFragment.d.ts +2 -2
  281. package/react/hooks/useFragment.js.map +1 -1
  282. package/react/hooks/useLazyQuery.d.ts +70 -108
  283. package/react/hooks/useLazyQuery.js.map +1 -1
  284. package/react/hooks/useLoadableQuery.d.ts +52 -61
  285. package/react/hooks/useLoadableQuery.js.map +1 -1
  286. package/react/hooks/useMutation.d.ts +36 -54
  287. package/react/hooks/useMutation.js.map +1 -1
  288. package/react/hooks/useQuery.d.ts +64 -105
  289. package/react/hooks/useQuery.js.map +1 -1
  290. package/react/hooks/useQueryRefHandlers.d.ts +17 -8
  291. package/react/hooks/useQueryRefHandlers.js.map +1 -1
  292. package/react/hooks/useReadQuery.d.ts +6 -9
  293. package/react/hooks/useReadQuery.js.map +1 -1
  294. package/react/hooks/useSubscription.d.ts +32 -24
  295. package/react/hooks/useSubscription.js.map +1 -1
  296. package/react/hooks/useSuspenseFragment.js.map +1 -1
  297. package/react/hooks/useSuspenseQuery.d.ts +75 -94
  298. package/react/hooks/useSuspenseQuery.js.map +1 -1
  299. package/react/hooks-compiled/useBackgroundQuery.d.ts +125 -93
  300. package/react/hooks-compiled/useBackgroundQuery.js.map +1 -1
  301. package/react/hooks-compiled/useFragment.d.ts +2 -2
  302. package/react/hooks-compiled/useFragment.js.map +1 -1
  303. package/react/hooks-compiled/useLazyQuery.d.ts +70 -108
  304. package/react/hooks-compiled/useLazyQuery.js.map +1 -1
  305. package/react/hooks-compiled/useLoadableQuery.d.ts +52 -61
  306. package/react/hooks-compiled/useLoadableQuery.js.map +1 -1
  307. package/react/hooks-compiled/useMutation.d.ts +36 -54
  308. package/react/hooks-compiled/useMutation.js.map +1 -1
  309. package/react/hooks-compiled/useQuery.d.ts +64 -105
  310. package/react/hooks-compiled/useQuery.js.map +1 -1
  311. package/react/hooks-compiled/useQueryRefHandlers.d.ts +17 -8
  312. package/react/hooks-compiled/useQueryRefHandlers.js.map +1 -1
  313. package/react/hooks-compiled/useReadQuery.d.ts +6 -9
  314. package/react/hooks-compiled/useReadQuery.js.map +1 -1
  315. package/react/hooks-compiled/useSubscription.d.ts +32 -24
  316. package/react/hooks-compiled/useSubscription.js.map +1 -1
  317. package/react/hooks-compiled/useSuspenseFragment.js.map +1 -1
  318. package/react/hooks-compiled/useSuspenseQuery.d.ts +75 -94
  319. package/react/hooks-compiled/useSuspenseQuery.js.map +1 -1
  320. package/react/internal/cache/QueryReference.d.ts +3 -1
  321. package/react/internal/cache/QueryReference.js.map +1 -1
  322. package/react/query-preloader/createQueryPreloader.d.ts +29 -20
  323. package/react/query-preloader/createQueryPreloader.js.map +1 -1
  324. package/react/types/types.documentation.d.ts +5 -5
  325. package/testing/core/mocking/mockLink.d.ts +5 -6
  326. package/testing/core/mocking/mockLink.js.map +1 -1
  327. package/testing/core/mocking/mockSubscriptionLink.d.ts +3 -4
  328. package/testing/core/mocking/mockSubscriptionLink.js.map +1 -1
  329. package/utilities/internal/types/DocumentationTypes.d.ts +20 -28
  330. package/utilities/internal/types/VariablesOption.d.ts +2 -6
  331. package/utilities/subscriptions/relay/index.js +1 -2
  332. package/utilities/subscriptions/relay/index.js.map +1 -1
  333. package/version.js +1 -1
  334. package/__cjs/link/http/serializeFetchParameter.cjs +0 -18
  335. package/__cjs/link/http/serializeFetchParameter.cjs.map +0 -1
  336. package/__cjs/link/http/serializeFetchParameter.d.cts +0 -6
  337. package/__cjs/link/utils/transformOperation.cjs +0 -22
  338. package/__cjs/link/utils/transformOperation.cjs.map +0 -1
  339. package/__cjs/link/utils/transformOperation.d.cts +0 -3
  340. package/__cjs/link/utils/validateOperation.cjs +0 -21
  341. package/__cjs/link/utils/validateOperation.cjs.map +0 -1
  342. package/__cjs/link/utils/validateOperation.d.cts +0 -3
  343. package/link/http/serializeFetchParameter.d.ts +0 -6
  344. package/link/http/serializeFetchParameter.js +0 -14
  345. package/link/http/serializeFetchParameter.js.map +0 -1
  346. package/link/utils/transformOperation.d.ts +0 -3
  347. package/link/utils/transformOperation.js +0 -19
  348. package/link/utils/transformOperation.js.map +0 -1
  349. package/link/utils/validateOperation.d.ts +0 -3
  350. package/link/utils/validateOperation.js +0 -18
  351. package/link/utils/validateOperation.js.map +0 -1
@@ -46,16 +46,49 @@ export declare namespace ClientAwarenessLink {
46
46
  * and Apollo Server logs (and other monitoring or analytics tools) by adding
47
47
  * information about the your application to outgoing requests.
48
48
  */
49
- clientAwareness?: ClientAwarenessOptions;
49
+ clientAwareness?: ClientAwarenessLink.ClientAwarenessOptions;
50
50
  /**
51
51
  * Configures the "enhanced client awareness" feature.
52
52
  * This feature allows you to identify the version of the Apollo Client library
53
53
  * used in your application in Apollo Studio (and other monitoring or analytics tools)
54
54
  * by adding information about the Apollo Client library to outgoing requests.
55
55
  */
56
- enhancedClientAwareness?: EnhancedClientAwarenessOptions;
56
+ enhancedClientAwareness?: ClientAwarenessLink.EnhancedClientAwarenessOptions;
57
57
  }
58
58
  }
59
+ /**
60
+ * `ClientAwarenessLink` provides support for providing client awareness
61
+ * features.
62
+ *
63
+ * @remarks
64
+ *
65
+ * Client awareness adds identifying information about the client to HTTP
66
+ * requests for use with metrics reporting tools, such as [Apollo GraphOS](https://apollographql.com/docs/graphos/platform).
67
+ * It is included in the functionality of [`HttpLink`](https://apollographql.com/docs/react/api/link/apollo-link-http) by default.
68
+ *
69
+ * Client awareness distinguishes between user-provided client awareness
70
+ * (provided by the `clientAwareness` option) and enhanced client awareness
71
+ * (provided by the `enhancedClientAwareness` option). User-provided client
72
+ * awareness enables you to set a customized client name and version for
73
+ * identification in metrics reporting tools. Enhanced client awareness enables
74
+ * the identification of the Apollo Client package name and version.
75
+ *
76
+ * @example
77
+ *
78
+ * ```ts
79
+ * import { ClientAwarenessLink } from "@apollo/client/link/client-awareness";
80
+ *
81
+ * const link = new ClientAwarenessLink({
82
+ * clientAwareness: {
83
+ * name: "My Client",
84
+ * version: "1",
85
+ * },
86
+ * enhancedClientAwareness: {
87
+ * transport: "extensions",
88
+ * },
89
+ * });
90
+ * ```
91
+ */
59
92
  export declare class ClientAwarenessLink extends ApolloLink {
60
93
  constructor(constructorOptions?: ClientAwarenessLink.Options);
61
94
  }
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","sources":["../../../../src/link/context/index.ts"],"sourcesContent":["import { Observable } from \"rxjs\";\n\nimport type { Operation, OperationContext } from \"@apollo/client/link\";\nimport { ApolloLink } from \"@apollo/client/link\";\n\nexport declare namespace SetContextLink {\n export type ContextSetter = (\n prevContext: OperationContext,\n operation: SetContextOperation\n ) => Promise<Partial<OperationContext>> | Partial<OperationContext>;\n\n export type LegacyContextSetter = (\n operation: SetContextOperation,\n prevContext: OperationContext\n ) => Promise<Partial<OperationContext>> | Partial<OperationContext>;\n\n export type SetContextOperation = Omit<\n Operation,\n \"getContext\" | \"setContext\"\n >;\n}\n\n/**\n * @deprecated\n * Use `SetContextLink` from `@apollo/client/link/context` instead. Note you\n * will need to flip the arguments when using `SetContextLink` as `prevContext`\n * is the first argument.\n *\n * ```ts\n * new SetContextLink((prevContext, operation) => {\n * // ...\n * });\n * ```\n */\nexport function setContext(setter: SetContextLink.LegacyContextSetter) {\n return new SetContextLink((prevContext, operation) =>\n setter(operation, prevContext)\n );\n}\nexport class SetContextLink extends ApolloLink {\n constructor(setter: SetContextLink.ContextSetter) {\n super((operation, forward) => {\n const { ...request } = operation as SetContextLink.SetContextOperation;\n\n Object.defineProperty(request, \"client\", {\n enumerable: false,\n value: operation.client,\n });\n\n return new Observable((observer) => {\n let closed = false;\n Promise.resolve(request)\n .then((req) => setter(operation.getContext(), req))\n .then(operation.setContext)\n .then(() => {\n if (!closed) {\n forward(operation).subscribe(observer);\n }\n })\n .catch(observer.error.bind(observer));\n\n return () => {\n closed = true;\n };\n });\n });\n }\n}\n"],"names":[],"mappings":";;;AAkCA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAlCA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAGA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CA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AV,CAAA,CAAA,CAAA,CAAA,EAAA,EAAmB,CAAnB,CAAA,CAAA,CAAuB;gBACf,CAAC;YACH,CAAC,CAAC;QACJ,CAAC,CAAC;IACJ;AACF;AA5BA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;"}
1
+ {"version":3,"file":"index.cjs","sources":["../../../../src/link/context/index.ts"],"sourcesContent":["import { Observable } from \"rxjs\";\n\nimport { ApolloLink } from \"@apollo/client/link\";\n\nexport declare namespace SetContextLink {\n export type ContextSetter = (\n prevContext: ApolloLink.OperationContext,\n operation: SetContextOperation\n ) =>\n | Promise<Partial<ApolloLink.OperationContext>>\n | Partial<ApolloLink.OperationContext>;\n\n export type LegacyContextSetter = (\n operation: SetContextOperation,\n prevContext: ApolloLink.OperationContext\n ) =>\n | Promise<Partial<ApolloLink.OperationContext>>\n | Partial<ApolloLink.OperationContext>;\n\n export type SetContextOperation = Omit<\n ApolloLink.Operation,\n \"getContext\" | \"setContext\"\n >;\n}\n\n/**\n * @deprecated\n * Use `SetContextLink` from `@apollo/client/link/context` instead. Note you\n * will need to flip the arguments when using `SetContextLink` as `prevContext`\n * is the first argument.\n *\n * ```ts\n * new SetContextLink((prevContext, operation) => {\n * // ...\n * });\n * ```\n */\nexport function setContext(setter: SetContextLink.LegacyContextSetter) {\n return new SetContextLink((prevContext, operation) =>\n setter(operation, prevContext)\n );\n}\nexport class SetContextLink extends ApolloLink {\n constructor(setter: SetContextLink.ContextSetter) {\n super((operation, forward) => {\n const { ...request } = operation as SetContextLink.SetContextOperation;\n\n Object.defineProperty(request, \"client\", {\n enumerable: false,\n value: operation.client,\n });\n\n return new Observable((observer) => {\n let closed = false;\n Promise.resolve(request)\n .then((req) => setter(operation.getContext(), req))\n .then(operation.setContext)\n .then(() => {\n if (!closed) {\n forward(operation).subscribe(observer);\n }\n })\n .catch(observer.error.bind(observer));\n\n return () => {\n closed = true;\n };\n });\n });\n }\n}\n"],"names":[],"mappings":";;;AAqCA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AArCA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAEA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAuBA,CAAA,CAAA;;;;;;;;;;;CAWA,CAAA;AACA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAgB,CAAhB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAA0B,CAAC,CAA3B,CAAA,CAAA,CAAA,CAAA,CAAqE,EAArE;IACE,CAAF,CAAA,CAAA,CAAA,CAAA,EAAS,CAAT,CAAA,EAAa,CAAb,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAA2B,CAAC,CAAC,CAA7B,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAwC,EAAE,CAA1C,CAAA,CAAA,C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pC,CAAW,CAAX,CAAA,CAAA,CAAe,CAAC,CAAhB,EAAmB,CAAnB,EAAA;oBACY,CAAZ,EAAA,CAAgB,CAAC,CAAjB,CAAA,CAAA,CAAA,CAAA,CAAuB,EAAE;wBACX,CAAd,CAAA,CAAA,CAAA,CAAA,CAAA,CAAqB,CAAC,CAAtB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAA+B,CAAC,CAAC,CAAjC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAA0C,CAAC,CAA3C,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAmD,CAAC;oBACxC;gBACF,CAAC;oBACX,CAAW,CAAX,CAAA,CAAA,CAAA,CAAgB,CAAC,CAAjB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAyB,CAAC,CAA1B,CAAA,CAAA,CAAA,CAA+B,CAAC,CAAhC,CAAA,CAAA,CAAoC,CAAC,CAArC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAA6C,CAAC,CAAC;gBAEvC,CAAR,CAAA,CAAA,CAAA,CAAA,EAAe,CAAf,EAAkB,CAAlB,EAAA;oBACU,CAAV,CAAA,CAAA,CAAA,CAAA,EAAA,EAAmB,CAAnB,CAAA,CAAA,CAAuB;gBACf,CAAC;YACH,CAAC,CAAC;QACJ,CAAC,CAAC;IACJ;AACF;AA5BA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;"}
@@ -1,9 +1,8 @@
1
- import type { Operation, OperationContext } from "@apollo/client/link";
2
1
  import { ApolloLink } from "@apollo/client/link";
3
2
  export declare namespace SetContextLink {
4
- type ContextSetter = (prevContext: OperationContext, operation: SetContextOperation) => Promise<Partial<OperationContext>> | Partial<OperationContext>;
5
- type LegacyContextSetter = (operation: SetContextOperation, prevContext: OperationContext) => Promise<Partial<OperationContext>> | Partial<OperationContext>;
6
- type SetContextOperation = Omit<Operation, "getContext" | "setContext">;
3
+ type ContextSetter = (prevContext: ApolloLink.OperationContext, operation: SetContextOperation) => Promise<Partial<ApolloLink.OperationContext>> | Partial<ApolloLink.OperationContext>;
4
+ type LegacyContextSetter = (operation: SetContextOperation, prevContext: ApolloLink.OperationContext) => Promise<Partial<ApolloLink.OperationContext>> | Partial<ApolloLink.OperationContext>;
5
+ type SetContextOperation = Omit<ApolloLink.Operation, "getContext" | "setContext">;
7
6
  }
8
7
  /**
9
8
  * @deprecated
@@ -7,79 +7,251 @@ Object.defineProperty(exports, "__esModule", { value: true });
7
7
  exports.ApolloLink = void 0;
8
8
  const rxjs_1 = require("rxjs");
9
9
  const utils_1 = require("@apollo/client/link/utils");
10
+ const environment_1 = require("@apollo/client/utilities/environment");
10
11
  const invariant_1 = require("@apollo/client/utilities/invariant");
11
- function passthrough(op, forward) {
12
- return (forward ? forward(op) : rxjs_1.EMPTY);
13
- }
14
- function toLink(handler) {
15
- return typeof handler === "function" ? new ApolloLink(handler) : handler;
16
- }
17
- function isTerminating(link) {
18
- return link.request.length <= 1;
19
- }
12
+ /**
13
+ * The base class for all links in Apollo Client. A link represents either a
14
+ * self-contained modification to a GraphQL operation or a side effect (such as
15
+ * logging).
16
+ *
17
+ * @remarks
18
+ *
19
+ * Links enable you to customize Apollo Client's request flow by composing
20
+ * together different pieces of functionality into a chain of links. Each
21
+ * link represents a specific capability, such as adding authentication headers,
22
+ * retrying failed requests, batching operations, or sending requests to a
23
+ * GraphQL server.
24
+ *
25
+ * Every link must define a request handler via its constructor or by extending
26
+ * this class and implementing the `request` method.
27
+ *
28
+ * @example
29
+ *
30
+ * ```ts
31
+ * import { ApolloLink } from "@apollo/client";
32
+ *
33
+ * const link = new ApolloLink((operation, forward) => {
34
+ * console.log("Operation:", operation.operationName);
35
+ * return forward(operation);
36
+ * });
37
+ * ```
38
+ */
20
39
  class ApolloLink {
40
+ /**
41
+ * Creates a link that completes immediately and does not emit a result.
42
+ *
43
+ * @example
44
+ *
45
+ * ```ts
46
+ * const link = ApolloLink.empty();
47
+ * ```
48
+ */
21
49
  static empty() {
22
50
  return new ApolloLink(() => rxjs_1.EMPTY);
23
51
  }
52
+ /**
53
+ * Composes multiple links into a single composed link that executes each
54
+ * provided link in serial order.
55
+ *
56
+ * @example
57
+ *
58
+ * ```ts
59
+ * import { from, HttpLink, ApolloLink } from "@apollo/client";
60
+ * import { RetryLink } from "@apollo/client/link/retry";
61
+ * import MyAuthLink from "../auth";
62
+ *
63
+ * const link = ApolloLink.from([
64
+ * new RetryLink(),
65
+ * new MyAuthLink(),
66
+ * new HttpLink({ uri: "http://localhost:4000/graphql" }),
67
+ * ]);
68
+ * ```
69
+ *
70
+ * @param links - An array of `ApolloLink` instances or request handlers that
71
+ * are executed in serial order.
72
+ */
24
73
  static from(links) {
25
74
  if (links.length === 0)
26
75
  return ApolloLink.empty();
27
- return links.map(toLink).reduce((x, y) => x.concat(y));
76
+ const [first, ...rest] = links;
77
+ return first.concat(...rest);
28
78
  }
29
- static split(test, left, right) {
30
- const leftLink = toLink(left);
31
- const rightLink = toLink(right || new ApolloLink(passthrough));
32
- let ret;
33
- if (isTerminating(leftLink) && isTerminating(rightLink)) {
34
- ret = new ApolloLink((operation) => {
35
- return test(operation) ?
36
- leftLink.request(operation) || rxjs_1.EMPTY
37
- : rightLink.request(operation) || rxjs_1.EMPTY;
38
- });
39
- }
40
- else {
41
- ret = new ApolloLink((operation, forward) => {
42
- return test(operation) ?
43
- leftLink.request(operation, forward) || rxjs_1.EMPTY
44
- : rightLink.request(operation, forward) || rxjs_1.EMPTY;
45
- });
46
- }
47
- return Object.assign(ret, { left: leftLink, right: rightLink });
79
+ /**
80
+ * Creates a link that conditionally routes a request to different links.
81
+ *
82
+ * @example
83
+ *
84
+ * ```ts
85
+ * import { ApolloLink, HttpLink } from "@apollo/client";
86
+ *
87
+ * const link = ApolloLink.split(
88
+ * (operation) => operation.getContext().version === 1,
89
+ * new HttpLink({ uri: "http://localhost:4000/v1/graphql" }),
90
+ * new HttpLink({ uri: "http://localhost:4000/v2/graphql" })
91
+ * );
92
+ * ```
93
+ *
94
+ * @param test - A predicate function that receives the current `operation`
95
+ * and returns a boolean indicating which link to execute. Returning `true`
96
+ * executes the `left` link. Returning `false` executes the `right` link.
97
+ *
98
+ * @param left - The link that executes when the `test` function returns
99
+ * `true`.
100
+ *
101
+ * @param right - The link that executes when the `test` function returns
102
+ * `false`. If the `right` link is not provided, the request is forwarded to
103
+ * the next link in the chain.
104
+ */
105
+ static split(test, left, right = new ApolloLink((op, forward) => forward(op))) {
106
+ const link = new ApolloLink((operation, forward) => {
107
+ const result = test(operation);
108
+ if (environment_1.__DEV__) {
109
+ if (typeof result !== "boolean") {
110
+ __DEV__ && invariant_1.invariant.warn(61, result);
111
+ }
112
+ }
113
+ return result ?
114
+ left.request(operation, forward)
115
+ : right.request(operation, forward);
116
+ });
117
+ return Object.assign(link, { left, right });
48
118
  }
49
- static execute(link, operation, context) {
50
- return (link.request((0, utils_1.createOperation)(operation.context, (0, utils_1.transformOperation)((0, utils_1.validateOperation)(operation)), context)) || rxjs_1.EMPTY);
119
+ /**
120
+ * Executes a GraphQL request against a link. The `execute` function begins
121
+ * the request by calling the request handler of the link.
122
+ *
123
+ * @example
124
+ *
125
+ * ```ts
126
+ * const observable = ApolloLink.execute(link, { query, variables }, { client });
127
+ *
128
+ * observable.subscribe({
129
+ * next(value) {
130
+ * console.log("Received", value);
131
+ * },
132
+ * error(error) {
133
+ * console.error("Oops got error", error);
134
+ * },
135
+ * complete() {
136
+ * console.log("Request complete");
137
+ * },
138
+ * });
139
+ * ```
140
+ *
141
+ * @param link - The `ApolloLink` instance to execute the request.
142
+ *
143
+ * @param request - The GraphQL request details, such as the `query` and
144
+ * `variables`.
145
+ *
146
+ * @param context - The execution context for the request, such as the
147
+ * `client` making the request.
148
+ */
149
+ static execute(link, request, context) {
150
+ return link.request((0, utils_1.createOperation)(request, context), () => {
151
+ if (environment_1.__DEV__) {
152
+ __DEV__ && invariant_1.invariant.warn(62);
153
+ }
154
+ return rxjs_1.EMPTY;
155
+ });
51
156
  }
52
- static concat(first, second) {
53
- const firstLink = toLink(first);
54
- if (isTerminating(firstLink)) {
55
- __DEV__ && invariant_1.invariant.warn(62, firstLink);
56
- return firstLink;
57
- }
58
- const nextLink = toLink(second);
59
- let ret;
60
- if (isTerminating(nextLink)) {
61
- ret = new ApolloLink((operation) => firstLink.request(operation, (op) => nextLink.request(op) || rxjs_1.EMPTY) ||
62
- rxjs_1.EMPTY);
63
- }
64
- else {
65
- ret = new ApolloLink((operation, forward) => {
66
- return (firstLink.request(operation, (op) => {
67
- return nextLink.request(op, forward) || rxjs_1.EMPTY;
68
- }) || rxjs_1.EMPTY);
69
- });
70
- }
71
- return Object.assign(ret, { left: firstLink, right: nextLink });
157
+ /**
158
+ * Combines multiple links into a single composed link.
159
+ *
160
+ * @example
161
+ *
162
+ * ```ts
163
+ * const link = ApolloLink.concat(firstLink, secondLink, thirdLink);
164
+ * ```
165
+ *
166
+ * @param links - The links to concatenate into a single link. Each link will
167
+ * execute in serial order.
168
+ *
169
+ * @deprecated Use `ApolloLink.from` instead. `ApolloLink.concat` will be
170
+ * removed in a future major version.
171
+ */
172
+ static concat(...links) {
173
+ return ApolloLink.from(links);
72
174
  }
73
175
  constructor(request) {
74
176
  if (request)
75
177
  this.request = request;
76
178
  }
179
+ /**
180
+ * Concatenates a link that conditionally routes a request to different links.
181
+ *
182
+ * @example
183
+ *
184
+ * ```ts
185
+ * import { ApolloLink, HttpLink } from "@apollo/client";
186
+ *
187
+ * const previousLink = new ApolloLink((operation, forward) => {
188
+ * // Handle the request
189
+ *
190
+ * return forward(operation);
191
+ * });
192
+ *
193
+ * const link = previousLink.split(
194
+ * (operation) => operation.getContext().version === 1,
195
+ * new HttpLink({ uri: "http://localhost:4000/v1/graphql" }),
196
+ * new HttpLink({ uri: "http://localhost:4000/v2/graphql" })
197
+ * );
198
+ * ```
199
+ *
200
+ * @param test - A predicate function that receives the current `operation`
201
+ * and returns a boolean indicating which link to execute. Returning `true`
202
+ * executes the `left` link. Returning `false` executes the `right` link.
203
+ *
204
+ * @param left - The link that executes when the `test` function returns
205
+ * `true`.
206
+ *
207
+ * @param right - The link that executes when the `test` function returns
208
+ * `false`. If the `right` link is not provided, the request is forwarded to
209
+ * the next link in the chain.
210
+ */
77
211
  split(test, left, right) {
78
- return this.concat(ApolloLink.split(test, left, right || new ApolloLink(passthrough)));
212
+ return this.concat(ApolloLink.split(test, left, right));
79
213
  }
80
- concat(next) {
81
- return ApolloLink.concat(this, next);
214
+ /**
215
+ * Combines the link with other links into a single composed link.
216
+ *
217
+ * @example
218
+ *
219
+ * ```ts
220
+ * import { ApolloLink, HttpLink } from "@apollo/client";
221
+ *
222
+ * const previousLink = new ApolloLink((operation, forward) => {
223
+ * // Handle the request
224
+ *
225
+ * return forward(operation);
226
+ * });
227
+ *
228
+ * const link = previousLink.concat(
229
+ * link1,
230
+ * link2,
231
+ * new HttpLink({ uri: "http://localhost:4000/graphql" })
232
+ * );
233
+ * ```
234
+ */
235
+ concat(...links) {
236
+ if (links.length === 0) {
237
+ return this;
238
+ }
239
+ return links.reduce(this.combine.bind(this), this);
82
240
  }
241
+ combine(left, right) {
242
+ const link = new ApolloLink((operation, forward) => {
243
+ return left.request(operation, (op) => right.request(op, forward));
244
+ });
245
+ return Object.assign(link, { left, right });
246
+ }
247
+ /**
248
+ * Runs the request handler for the provided operation.
249
+ *
250
+ * > [!NOTE]
251
+ * > This is called by the `ApolloLink.execute` function for you and should
252
+ * > not be called directly. Prefer using `ApolloLink.execute` to make the
253
+ * > request instead.
254
+ */
83
255
  request(operation, forward) {
84
256
  throw (0, invariant_1.newInvariantError)(63);
85
257
  }
@@ -1 +1 @@
1
- {"version":3,"file":"ApolloLink.cjs","sources":["../../../../src/link/core/ApolloLink.ts"],"sourcesContent":["import type { Observable } from \"rxjs\";\nimport { EMPTY } from \"rxjs\";\n\nimport {\n createOperation,\n transformOperation,\n validateOperation,\n} from \"@apollo/client/link/utils\";\nimport {\n invariant,\n newInvariantError,\n} from \"@apollo/client/utilities/invariant\";\n\nimport type {\n ExecuteContext,\n FetchResult,\n GraphQLRequest,\n NextLink,\n Operation,\n RequestHandler,\n} from \"./types.js\";\n\nfunction passthrough(op: Operation, forward: NextLink) {\n return (forward ? forward(op) : EMPTY) as Observable<FetchResult>;\n}\n\nfunction toLink(handler: RequestHandler | ApolloLink) {\n return typeof handler === \"function\" ? new ApolloLink(handler) : handler;\n}\n\nfunction isTerminating(link: ApolloLink): boolean {\n return link.request.length <= 1;\n}\n\nexport class ApolloLink {\n public static empty(): ApolloLink {\n return new ApolloLink(() => EMPTY);\n }\n\n public static from(links: (ApolloLink | RequestHandler)[]): ApolloLink {\n if (links.length === 0) return ApolloLink.empty();\n return links.map(toLink).reduce((x, y) => x.concat(y)) as ApolloLink;\n }\n\n public static split(\n test: (op: Operation) => boolean,\n left: ApolloLink | RequestHandler,\n right?: ApolloLink | RequestHandler\n ): ApolloLink {\n const leftLink = toLink(left);\n const rightLink = toLink(right || new ApolloLink(passthrough));\n\n let ret: ApolloLink;\n if (isTerminating(leftLink) && isTerminating(rightLink)) {\n ret = new ApolloLink((operation) => {\n return test(operation) ?\n leftLink.request(operation) || EMPTY\n : rightLink.request(operation) || EMPTY;\n });\n } else {\n ret = new ApolloLink((operation, forward) => {\n return test(operation) ?\n leftLink.request(operation, forward) || EMPTY\n : rightLink.request(operation, forward) || EMPTY;\n });\n }\n return Object.assign(ret, { left: leftLink, right: rightLink });\n }\n\n public static execute(\n link: ApolloLink,\n operation: GraphQLRequest,\n context: ExecuteContext\n ): Observable<FetchResult> {\n return (\n link.request(\n createOperation(\n operation.context,\n transformOperation(validateOperation(operation)),\n context\n )\n ) || EMPTY\n );\n }\n\n public static concat(\n first: ApolloLink | RequestHandler,\n second: ApolloLink | RequestHandler\n ) {\n const firstLink = toLink(first);\n if (isTerminating(firstLink)) {\n invariant.warn(\n `You are calling concat on a terminating link, which will have no effect %o`,\n firstLink\n );\n return firstLink;\n }\n const nextLink = toLink(second);\n\n let ret: ApolloLink;\n if (isTerminating(nextLink)) {\n ret = new ApolloLink(\n (operation) =>\n firstLink.request(operation, (op) => nextLink.request(op) || EMPTY) ||\n EMPTY\n );\n } else {\n ret = new ApolloLink((operation, forward) => {\n return (\n firstLink.request(operation, (op) => {\n return nextLink.request(op, forward) || EMPTY;\n }) || EMPTY\n );\n });\n }\n return Object.assign(ret, { left: firstLink, right: nextLink });\n }\n\n constructor(request?: RequestHandler) {\n if (request) this.request = request;\n }\n\n public split(\n test: (op: Operation) => boolean,\n left: ApolloLink | RequestHandler,\n right?: ApolloLink | RequestHandler\n ): ApolloLink {\n return this.concat(\n ApolloLink.split(test, left, right || new ApolloLink(passthrough))\n );\n }\n\n public concat(next: ApolloLink | RequestHandler): ApolloLink {\n return ApolloLink.concat(this, next);\n }\n\n public request(\n operation: Operation,\n forward?: NextLink\n ): Observable<FetchResult> | null {\n throw newInvariantError(\"request is not implemented\");\n }\n\n /**\n * @internal\n * Used to iterate through all links that are concatenations or `split` links.\n */\n readonly left?: ApolloLink;\n /**\n * @internal\n * Used to iterate through all links that are concatenations or `split` links.\n */\n readonly right?: ApolloLink;\n\n /**\n * @internal\n * Can be provided by a link that has an internal cache to report it's memory details.\n */\n getMemoryInternals?: () => unknown;\n}\n"],"names":[],"mappings":";;;;;;;AACA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAEA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,EAAA,CAAA,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AA,CAA4B,CAAC,CAA7B,CAAA,CAAA,CAAiC,EAAE,CAAnC,CAAA,CAAA,CAAuC,CAAC;IACtC;IAEO,CAAT,CAAA,CAAA,CAAA,CAAA,CAAA,CAAgB,CACZ,CADJ,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CACwB,EACpB,CAFJ,CAAA,CAAA,CAAA,CAAA,CAAA,CAEsB,EAFtB;QAII,CAAJ,CAAA,CAAA,CAAA,GAAA,GAAU,CAAV,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,MAAyD;IACvD;;;;;;;IAMS,CAAX,CAAA,CAAA,CAAe;;;;;;;IAKJ,CAAX,CAAA,CAAA,CAAA,CAAgB;;;;;;;IAMd,CAAF,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAoB;AACpB;AA7HA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;"}
1
+ {"version":3,"file":"ApolloLink.cjs","sources":["../../../../src/link/core/ApolloLink.ts"],"sourcesContent":["import type {\n DocumentNode,\n FormattedExecutionResult,\n OperationTypeNode,\n} from \"graphql\";\nimport type { Observable } from \"rxjs\";\nimport { EMPTY } from \"rxjs\";\n\nimport type {\n ApolloClient,\n DefaultContext,\n OperationVariables,\n} from \"@apollo/client\";\nimport { createOperation } from \"@apollo/client/link/utils\";\nimport { __DEV__ } from \"@apollo/client/utilities/environment\";\nimport {\n invariant,\n newInvariantError,\n} from \"@apollo/client/utilities/invariant\";\n\nimport type { AdditionalApolloLinkResultTypes } from \"./types.js\";\n\nexport declare namespace ApolloLink {\n /**\n * Context provided for link execution, such as the client executing the\n * request. It is separate from the request operation context.\n */\n export interface ExecuteContext {\n /**\n * The Apollo Client instance that executed the GraphQL request.\n */\n client: ApolloClient;\n }\n\n /** {@inheritDoc @apollo/client/link!ApolloLink.DocumentationTypes.ForwardFunction:function(1)} */\n export type ForwardFunction = (\n operation: ApolloLink.Operation\n ) => Observable<ApolloLink.Result>;\n\n /**\n * The input object provided to `ApolloLink.execute` to send a GraphQL request through\n * the link chain.\n */\n export interface Request {\n /**\n * The parsed GraphQL document that will be sent with the GraphQL request to\n * the server.\n */\n query: DocumentNode;\n\n /**\n * The variables provided for the query.\n */\n variables?: OperationVariables;\n\n /**\n * Context provided to the link chain. Context is not sent to the server and\n * is used to communicate additional metadata from a request to individual\n * links in the link chain.\n */\n context?: DefaultContext;\n\n /**\n * A map of extensions that will be sent with the GraphQL request to the\n * server.\n */\n extensions?: Record<string, any>;\n }\n\n /** {@inheritDoc @apollo/client/link!ApolloLink.DocumentationTypes.RequestHandler:function(1)} */\n export type RequestHandler = (\n operation: ApolloLink.Operation,\n forward: ApolloLink.ForwardFunction\n ) => Observable<ApolloLink.Result>;\n\n export type Result<\n TData = Record<string, any>,\n TExtensions = Record<string, any>,\n > =\n | FormattedExecutionResult<TData, TExtensions>\n | AdditionalApolloLinkResultTypes<\n TData,\n TExtensions\n >[keyof AdditionalApolloLinkResultTypes<TData, TExtensions>];\n\n /**\n * The currently executed operation object provided to an `ApolloLink.RequestHandler`\n * for each link in the link chain.\n */\n export interface Operation {\n /**\n * A `DocumentNode` that describes the operation taking place.\n */\n query: DocumentNode;\n\n /**\n * A map of GraphQL variables being sent with the operation.\n */\n variables: OperationVariables;\n\n /**\n * The string name of the GraphQL operation. If it is anonymous,\n * `operationName` will be `undefined`.\n */\n operationName: string | undefined;\n\n /**\n * The type of the GraphQL operation, such as query or mutation.\n */\n operationType: OperationTypeNode;\n\n /**\n * A map that stores extensions data to be sent to the server.\n */\n extensions: Record<string, any>;\n\n /**\n * A function that takes either a new context object, or a function which\n * takes in the previous context and returns a new one. See [managing\n * context](https://apollographql.com/docs/react/api/link/introduction#managing-context).\n */\n setContext: {\n (context: Partial<ApolloLink.OperationContext>): void;\n (\n updateContext: (\n previousContext: Readonly<ApolloLink.OperationContext>\n ) => Partial<ApolloLink.OperationContext>\n ): void;\n };\n\n /**\n * A function that gets the current context of the request. This can be used\n * by links to determine which actions to perform. See [managing context](https://apollographql.com/docs/react/api/link/introduction#managing-context)\n */\n getContext: () => Readonly<ApolloLink.OperationContext>;\n\n /**\n * The Apollo Client instance executing the request.\n */\n readonly client: ApolloClient;\n }\n\n /**\n * The `context` object that can be read and modified by links using the\n * `operation.getContext()` and `operation.setContext()` methods.\n */\n export interface OperationContext extends DefaultContext {}\n\n export namespace DocumentationTypes {\n /**\n * A request handler is responsible for performing some logic and executing the\n * request, either by [forwarding](https://apollographql.com/docs/react/api/link/introduction#the-request-handler) the operation to the next link in the\n * chain, or sending the operation to the destination that executes it, such as\n * a GraphQL server.\n *\n * @param operation - The `Operation` object that provides information about the\n * currently executed GraphQL request.\n *\n * @param forward - A function that is called to execute the next link in the\n * chain.\n */\n export function RequestHandler(\n operation: ApolloLink.Operation,\n forward: ApolloLink.ForwardFunction\n ): Observable<ApolloLink.Result>;\n\n /**\n * A function that when called will execute the next link in the link chain.\n *\n * @example\n *\n * ```ts\n * const link = new ApolloLink((operation, forward) => {\n * // process the request\n *\n * // Call `forward` to execute the next link in the chain\n * return forward(operation);\n * });\n * ```\n *\n * @param operation - The current `ApolloLink.Operation` object for the\n * request.\n */\n export function ForwardFunction(\n operation: ApolloLink.Operation\n ): Observable<ApolloLink.Result>;\n }\n}\n\n/**\n * The base class for all links in Apollo Client. A link represents either a\n * self-contained modification to a GraphQL operation or a side effect (such as\n * logging).\n *\n * @remarks\n *\n * Links enable you to customize Apollo Client's request flow by composing\n * together different pieces of functionality into a chain of links. Each\n * link represents a specific capability, such as adding authentication headers,\n * retrying failed requests, batching operations, or sending requests to a\n * GraphQL server.\n *\n * Every link must define a request handler via its constructor or by extending\n * this class and implementing the `request` method.\n *\n * @example\n *\n * ```ts\n * import { ApolloLink } from \"@apollo/client\";\n *\n * const link = new ApolloLink((operation, forward) => {\n * console.log(\"Operation:\", operation.operationName);\n * return forward(operation);\n * });\n * ```\n */\nexport class ApolloLink {\n /**\n * Creates a link that completes immediately and does not emit a result.\n *\n * @example\n *\n * ```ts\n * const link = ApolloLink.empty();\n * ```\n */\n public static empty(): ApolloLink {\n return new ApolloLink(() => EMPTY);\n }\n\n /**\n * Composes multiple links into a single composed link that executes each\n * provided link in serial order.\n *\n * @example\n *\n * ```ts\n * import { from, HttpLink, ApolloLink } from \"@apollo/client\";\n * import { RetryLink } from \"@apollo/client/link/retry\";\n * import MyAuthLink from \"../auth\";\n *\n * const link = ApolloLink.from([\n * new RetryLink(),\n * new MyAuthLink(),\n * new HttpLink({ uri: \"http://localhost:4000/graphql\" }),\n * ]);\n * ```\n *\n * @param links - An array of `ApolloLink` instances or request handlers that\n * are executed in serial order.\n */\n public static from(links: ApolloLink[]): ApolloLink {\n if (links.length === 0) return ApolloLink.empty();\n\n const [first, ...rest] = links;\n return first.concat(...rest);\n }\n\n /**\n * Creates a link that conditionally routes a request to different links.\n *\n * @example\n *\n * ```ts\n * import { ApolloLink, HttpLink } from \"@apollo/client\";\n *\n * const link = ApolloLink.split(\n * (operation) => operation.getContext().version === 1,\n * new HttpLink({ uri: \"http://localhost:4000/v1/graphql\" }),\n * new HttpLink({ uri: \"http://localhost:4000/v2/graphql\" })\n * );\n * ```\n *\n * @param test - A predicate function that receives the current `operation`\n * and returns a boolean indicating which link to execute. Returning `true`\n * executes the `left` link. Returning `false` executes the `right` link.\n *\n * @param left - The link that executes when the `test` function returns\n * `true`.\n *\n * @param right - The link that executes when the `test` function returns\n * `false`. If the `right` link is not provided, the request is forwarded to\n * the next link in the chain.\n */\n public static split(\n test: (op: ApolloLink.Operation) => boolean,\n left: ApolloLink,\n right: ApolloLink = new ApolloLink((op, forward) => forward(op))\n ): ApolloLink {\n const link = new ApolloLink((operation, forward) => {\n const result = test(operation);\n\n if (__DEV__) {\n if (typeof result !== \"boolean\") {\n invariant.warn(\n \"[ApolloLink.split]: The test function returned a non-boolean value which could result in subtle bugs (e.g. such as using an `async` function which always returns a truthy value). Got `%o`.\",\n result\n );\n }\n }\n\n return result ?\n left.request(operation, forward)\n : right.request(operation, forward);\n });\n return Object.assign(link, { left, right });\n }\n\n /**\n * Executes a GraphQL request against a link. The `execute` function begins\n * the request by calling the request handler of the link.\n *\n * @example\n *\n * ```ts\n * const observable = ApolloLink.execute(link, { query, variables }, { client });\n *\n * observable.subscribe({\n * next(value) {\n * console.log(\"Received\", value);\n * },\n * error(error) {\n * console.error(\"Oops got error\", error);\n * },\n * complete() {\n * console.log(\"Request complete\");\n * },\n * });\n * ```\n *\n * @param link - The `ApolloLink` instance to execute the request.\n *\n * @param request - The GraphQL request details, such as the `query` and\n * `variables`.\n *\n * @param context - The execution context for the request, such as the\n * `client` making the request.\n */\n public static execute(\n link: ApolloLink,\n request: ApolloLink.Request,\n context: ApolloLink.ExecuteContext\n ): Observable<ApolloLink.Result> {\n return link.request(createOperation(request, context), () => {\n if (__DEV__) {\n invariant.warn(\n \"The terminating link provided to `ApolloLink.execute` called `forward` instead of handling the request. \" +\n \"This results in an observable that immediately completes and does not emit a value. \" +\n \"Please provide a terminating link that properly handles the request.\\n\\n\" +\n \"If you are using a split link, ensure each branch contains a terminating link that handles the request.\"\n );\n }\n return EMPTY;\n });\n }\n\n /**\n * Combines multiple links into a single composed link.\n *\n * @example\n *\n * ```ts\n * const link = ApolloLink.concat(firstLink, secondLink, thirdLink);\n * ```\n *\n * @param links - The links to concatenate into a single link. Each link will\n * execute in serial order.\n *\n * @deprecated Use `ApolloLink.from` instead. `ApolloLink.concat` will be\n * removed in a future major version.\n */\n public static concat(...links: ApolloLink[]) {\n return ApolloLink.from(links);\n }\n\n constructor(request?: ApolloLink.RequestHandler) {\n if (request) this.request = request;\n }\n\n /**\n * Concatenates a link that conditionally routes a request to different links.\n *\n * @example\n *\n * ```ts\n * import { ApolloLink, HttpLink } from \"@apollo/client\";\n *\n * const previousLink = new ApolloLink((operation, forward) => {\n * // Handle the request\n *\n * return forward(operation);\n * });\n *\n * const link = previousLink.split(\n * (operation) => operation.getContext().version === 1,\n * new HttpLink({ uri: \"http://localhost:4000/v1/graphql\" }),\n * new HttpLink({ uri: \"http://localhost:4000/v2/graphql\" })\n * );\n * ```\n *\n * @param test - A predicate function that receives the current `operation`\n * and returns a boolean indicating which link to execute. Returning `true`\n * executes the `left` link. Returning `false` executes the `right` link.\n *\n * @param left - The link that executes when the `test` function returns\n * `true`.\n *\n * @param right - The link that executes when the `test` function returns\n * `false`. If the `right` link is not provided, the request is forwarded to\n * the next link in the chain.\n */\n public split(\n test: (op: ApolloLink.Operation) => boolean,\n left: ApolloLink,\n right?: ApolloLink\n ): ApolloLink {\n return this.concat(ApolloLink.split(test, left, right));\n }\n\n /**\n * Combines the link with other links into a single composed link.\n *\n * @example\n *\n * ```ts\n * import { ApolloLink, HttpLink } from \"@apollo/client\";\n *\n * const previousLink = new ApolloLink((operation, forward) => {\n * // Handle the request\n *\n * return forward(operation);\n * });\n *\n * const link = previousLink.concat(\n * link1,\n * link2,\n * new HttpLink({ uri: \"http://localhost:4000/graphql\" })\n * );\n * ```\n */\n public concat(...links: ApolloLink[]): ApolloLink {\n if (links.length === 0) {\n return this;\n }\n\n return links.reduce(this.combine.bind(this), this);\n }\n\n private combine(left: ApolloLink, right: ApolloLink) {\n const link = new ApolloLink((operation, forward) => {\n return left.request(operation, (op) => right.request(op, forward));\n });\n\n return Object.assign(link, { left, right });\n }\n\n /**\n * Runs the request handler for the provided operation.\n *\n * > [!NOTE]\n * > This is called by the `ApolloLink.execute` function for you and should\n * > not be called directly. Prefer using `ApolloLink.execute` to make the\n * > request instead.\n */\n public request(\n operation: ApolloLink.Operation,\n forward: ApolloLink.ForwardFunction\n ): Observable<ApolloLink.Result> {\n throw newInvariantError(\"request is not implemented\");\n }\n\n /**\n * @internal\n * Used to iterate through all links that are concatenations or `split` links.\n */\n readonly left?: ApolloLink;\n /**\n * @internal\n * Used to iterate through all links that are concatenations or `split` links.\n */\n readonly right?: ApolloLink;\n\n /**\n * @internal\n * Can be provided by a link that has an internal cache to report it's memory details.\n */\n getMemoryInternals?: () => unknown;\n}\n"],"names":[],"mappings":";;;;;;;AAMA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAOA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AACA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AACA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,C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