@apollo/client 4.0.12-beta.0 → 4.0.13

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 (340) hide show
  1. package/CHANGELOG.md +10 -194
  2. package/__cjs/cache/core/cache.cjs +48 -169
  3. package/__cjs/cache/core/cache.cjs.map +1 -1
  4. package/__cjs/cache/core/cache.d.cts +25 -94
  5. package/__cjs/cache/core/types/Cache.d.cts +17 -49
  6. package/__cjs/cache/index.cjs.map +1 -1
  7. package/__cjs/cache/index.d.cts +1 -1
  8. package/__cjs/cache/inmemory/entityStore.cjs +4 -6
  9. package/__cjs/cache/inmemory/entityStore.cjs.map +1 -1
  10. package/__cjs/cache/inmemory/fragmentRegistry.cjs +5 -0
  11. package/__cjs/cache/inmemory/fragmentRegistry.cjs.map +1 -1
  12. package/__cjs/cache/inmemory/helpers.d.cts +1 -1
  13. package/__cjs/cache/inmemory/inMemoryCache.cjs +1 -15
  14. package/__cjs/cache/inmemory/inMemoryCache.cjs.map +1 -1
  15. package/__cjs/cache/inmemory/inMemoryCache.d.cts +0 -1
  16. package/__cjs/cache/inmemory/key-extractor.cjs +1 -1
  17. package/__cjs/cache/inmemory/key-extractor.cjs.map +1 -1
  18. package/__cjs/cache/inmemory/policies.cjs +17 -56
  19. package/__cjs/cache/inmemory/policies.cjs.map +1 -1
  20. package/__cjs/cache/inmemory/policies.d.cts +6 -30
  21. package/__cjs/cache/inmemory/readFromStore.cjs +3 -3
  22. package/__cjs/cache/inmemory/readFromStore.cjs.map +1 -1
  23. package/__cjs/cache/inmemory/types.d.cts +0 -2
  24. package/__cjs/cache/inmemory/writeToStore.cjs +10 -24
  25. package/__cjs/cache/inmemory/writeToStore.cjs.map +1 -1
  26. package/__cjs/cache/inmemory/writeToStore.d.cts +1 -2
  27. package/__cjs/core/ApolloClient.cjs +49 -31
  28. package/__cjs/core/ApolloClient.cjs.map +1 -1
  29. package/__cjs/core/ApolloClient.d.cts +17 -143
  30. package/__cjs/core/ObservableQuery.cjs +128 -162
  31. package/__cjs/core/ObservableQuery.cjs.map +1 -1
  32. package/__cjs/core/ObservableQuery.d.cts +0 -1
  33. package/__cjs/core/QueryInfo.cjs +1 -9
  34. package/__cjs/core/QueryInfo.cjs.map +1 -1
  35. package/__cjs/core/QueryInfo.d.cts +1 -2
  36. package/__cjs/core/QueryManager.cjs +24 -46
  37. package/__cjs/core/QueryManager.cjs.map +1 -1
  38. package/__cjs/core/QueryManager.d.cts +2 -18
  39. package/__cjs/incremental/handlers/defer20220824.cjs +19 -44
  40. package/__cjs/incremental/handlers/defer20220824.cjs.map +1 -1
  41. package/__cjs/incremental/handlers/defer20220824.d.cts +7 -15
  42. package/__cjs/incremental/handlers/notImplemented.cjs +1 -1
  43. package/__cjs/incremental/handlers/notImplemented.cjs.map +1 -1
  44. package/__cjs/incremental/index.cjs +1 -3
  45. package/__cjs/incremental/index.cjs.map +1 -1
  46. package/__cjs/incremental/index.d.cts +0 -1
  47. package/__cjs/incremental/types.d.cts +0 -9
  48. package/__cjs/invariantErrorCodes.cjs +62 -78
  49. package/__cjs/link/client-awareness/ClientAwarenessLink.cjs +1 -13
  50. package/__cjs/link/client-awareness/ClientAwarenessLink.cjs.map +1 -1
  51. package/__cjs/link/client-awareness/ClientAwarenessLink.d.cts +1 -1
  52. package/__cjs/link/core/ApolloLink.cjs +3 -3
  53. package/__cjs/link/http/checkFetcher.cjs +1 -1
  54. package/__cjs/link/http/parseAndCheckHttpResponse.cjs +1 -1
  55. package/__cjs/link/persisted-queries/index.cjs +2 -2
  56. package/__cjs/link/remove-typename/removeTypenameFromVariables.cjs +51 -50
  57. package/__cjs/link/remove-typename/removeTypenameFromVariables.cjs.map +1 -1
  58. package/__cjs/link/remove-typename/removeTypenameFromVariables.d.cts +3 -0
  59. package/__cjs/link/ws/index.cjs +1 -1
  60. package/__cjs/local-state/LocalState.cjs +14 -28
  61. package/__cjs/local-state/LocalState.cjs.map +1 -1
  62. package/__cjs/local-state/LocalState.d.cts +2 -3
  63. package/__cjs/masking/types.d.cts +1 -2
  64. package/__cjs/react/hooks/internal/useDeepMemo.cjs +0 -2
  65. package/__cjs/react/hooks/internal/useDeepMemo.cjs.map +1 -1
  66. package/__cjs/react/hooks/useApolloClient.cjs +1 -1
  67. package/__cjs/react/hooks/useApolloClient.cjs.map +1 -1
  68. package/__cjs/react/hooks/useApolloClient.d.cts +1 -1
  69. package/__cjs/react/hooks/useBackgroundQuery.cjs +3 -1
  70. package/__cjs/react/hooks/useBackgroundQuery.cjs.map +1 -1
  71. package/__cjs/react/hooks/useFragment.cjs +87 -38
  72. package/__cjs/react/hooks/useFragment.cjs.map +1 -1
  73. package/__cjs/react/hooks/useFragment.d.cts +6 -65
  74. package/__cjs/react/hooks/useLazyQuery.cjs +0 -2
  75. package/__cjs/react/hooks/useLazyQuery.cjs.map +1 -1
  76. package/__cjs/react/hooks/useMutation.cjs +1 -7
  77. package/__cjs/react/hooks/useMutation.cjs.map +1 -1
  78. package/__cjs/react/hooks/useMutation.d.cts +1 -13
  79. package/__cjs/react/hooks/useQuery.cjs +4 -1
  80. package/__cjs/react/hooks/useQuery.cjs.map +1 -1
  81. package/__cjs/react/hooks/useQuery.d.cts +1 -1
  82. package/__cjs/react/hooks/useQueryRefHandlers.cjs +3 -1
  83. package/__cjs/react/hooks/useQueryRefHandlers.cjs.map +1 -1
  84. package/__cjs/react/hooks/useReadQuery.cjs +3 -1
  85. package/__cjs/react/hooks/useReadQuery.cjs.map +1 -1
  86. package/__cjs/react/hooks/useSubscription.cjs +1 -1
  87. package/__cjs/react/hooks/useSubscription.cjs.map +1 -1
  88. package/__cjs/react/hooks/useSuspenseFragment.cjs +16 -16
  89. package/__cjs/react/hooks/useSuspenseFragment.cjs.map +1 -1
  90. package/__cjs/react/hooks/useSuspenseFragment.d.cts +7 -33
  91. package/__cjs/react/hooks/useSuspenseQuery.cjs +4 -4
  92. package/__cjs/react/hooks/useSuspenseQuery.cjs.map +1 -1
  93. package/__cjs/react/internal/cache/FragmentReference.cjs +22 -3
  94. package/__cjs/react/internal/cache/FragmentReference.cjs.map +1 -1
  95. package/__cjs/react/internal/cache/FragmentReference.d.cts +4 -2
  96. package/__cjs/react/internal/cache/QueryReference.cjs +0 -16
  97. package/__cjs/react/internal/cache/QueryReference.cjs.map +1 -1
  98. package/__cjs/react/internal/cache/QueryReference.d.cts +0 -5
  99. package/__cjs/react/internal/cache/SuspenseCache.cjs.map +1 -1
  100. package/__cjs/react/internal/cache/SuspenseCache.d.cts +1 -1
  101. package/__cjs/react/internal/cache/types.d.cts +2 -2
  102. package/__cjs/react/query-preloader/createQueryPreloader.cjs +1 -41
  103. package/__cjs/react/query-preloader/createQueryPreloader.cjs.map +1 -1
  104. package/__cjs/react/ssr/useSSRQuery.cjs +0 -1
  105. package/__cjs/react/ssr/useSSRQuery.cjs.map +1 -1
  106. package/__cjs/utilities/DeepPartial.cjs.map +1 -1
  107. package/__cjs/utilities/DeepPartial.d.cts +1 -1
  108. package/__cjs/utilities/internal/DeepMerger.cjs +4 -36
  109. package/__cjs/utilities/internal/DeepMerger.cjs.map +1 -1
  110. package/__cjs/utilities/internal/DeepMerger.d.cts +4 -20
  111. package/__cjs/utilities/internal/bindCacheKey.cjs +21 -0
  112. package/__cjs/utilities/internal/bindCacheKey.cjs.map +1 -0
  113. package/__cjs/utilities/internal/bindCacheKey.d.cts +15 -0
  114. package/__cjs/utilities/internal/compact.cjs +1 -1
  115. package/__cjs/utilities/internal/compact.cjs.map +1 -1
  116. package/__cjs/utilities/internal/constants.cjs +1 -17
  117. package/__cjs/utilities/internal/constants.cjs.map +1 -1
  118. package/__cjs/utilities/internal/constants.d.cts +0 -16
  119. package/__cjs/utilities/internal/getStoreKeyName.cjs +0 -1
  120. package/__cjs/utilities/internal/getStoreKeyName.cjs.map +1 -1
  121. package/__cjs/utilities/internal/index.cjs +4 -8
  122. package/__cjs/utilities/internal/index.cjs.map +1 -1
  123. package/__cjs/utilities/internal/index.d.cts +2 -4
  124. package/__cjs/utilities/internal/memoize.cjs +2 -2
  125. package/__cjs/utilities/internal/memoize.cjs.map +1 -1
  126. package/__cjs/utilities/internal/memoize.d.cts +1 -2
  127. package/__cjs/version.cjs +1 -1
  128. package/__cjs/version.cjs.map +1 -1
  129. package/cache/core/cache.d.ts +25 -94
  130. package/cache/core/cache.js +51 -172
  131. package/cache/core/cache.js.map +1 -1
  132. package/cache/core/types/Cache.d.ts +17 -49
  133. package/cache/core/types/Cache.js.map +1 -1
  134. package/cache/index.d.ts +1 -1
  135. package/cache/index.js.map +1 -1
  136. package/cache/inmemory/entityStore.js +4 -6
  137. package/cache/inmemory/entityStore.js.map +1 -1
  138. package/cache/inmemory/fragmentRegistry.js +6 -1
  139. package/cache/inmemory/fragmentRegistry.js.map +1 -1
  140. package/cache/inmemory/helpers.d.ts +1 -1
  141. package/cache/inmemory/inMemoryCache.d.ts +0 -1
  142. package/cache/inmemory/inMemoryCache.js +1 -15
  143. package/cache/inmemory/inMemoryCache.js.map +1 -1
  144. package/cache/inmemory/key-extractor.js +1 -1
  145. package/cache/inmemory/key-extractor.js.map +1 -1
  146. package/cache/inmemory/policies.d.ts +6 -30
  147. package/cache/inmemory/policies.js +7 -45
  148. package/cache/inmemory/policies.js.map +1 -1
  149. package/cache/inmemory/readFromStore.js +3 -3
  150. package/cache/inmemory/readFromStore.js.map +1 -1
  151. package/cache/inmemory/types.d.ts +0 -2
  152. package/cache/inmemory/types.js.map +1 -1
  153. package/cache/inmemory/writeToStore.d.ts +1 -2
  154. package/cache/inmemory/writeToStore.js +12 -26
  155. package/cache/inmemory/writeToStore.js.map +1 -1
  156. package/core/ApolloClient.d.ts +17 -143
  157. package/core/ApolloClient.js +50 -32
  158. package/core/ApolloClient.js.map +1 -1
  159. package/core/ObservableQuery.d.ts +0 -1
  160. package/core/ObservableQuery.js +131 -165
  161. package/core/ObservableQuery.js.map +1 -1
  162. package/core/QueryInfo.d.ts +1 -2
  163. package/core/QueryInfo.js +2 -10
  164. package/core/QueryInfo.js.map +1 -1
  165. package/core/QueryManager.d.ts +2 -18
  166. package/core/QueryManager.js +25 -47
  167. package/core/QueryManager.js.map +1 -1
  168. package/incremental/handlers/defer20220824.d.ts +7 -15
  169. package/incremental/handlers/defer20220824.js +19 -44
  170. package/incremental/handlers/defer20220824.js.map +1 -1
  171. package/incremental/handlers/notImplemented.js +1 -1
  172. package/incremental/handlers/notImplemented.js.map +1 -1
  173. package/incremental/index.d.ts +0 -1
  174. package/incremental/index.js +2 -3
  175. package/incremental/index.js.map +1 -1
  176. package/incremental/types.d.ts +0 -9
  177. package/incremental/types.js.map +1 -1
  178. package/invariantErrorCodes.js +62 -78
  179. package/link/client-awareness/ClientAwarenessLink.d.ts +1 -1
  180. package/link/client-awareness/ClientAwarenessLink.js +1 -13
  181. package/link/client-awareness/ClientAwarenessLink.js.map +1 -1
  182. package/link/core/ApolloLink.js +3 -3
  183. package/link/http/checkFetcher.js +1 -1
  184. package/link/http/parseAndCheckHttpResponse.js +1 -1
  185. package/link/persisted-queries/index.js +2 -2
  186. package/link/remove-typename/removeTypenameFromVariables.d.ts +3 -0
  187. package/link/remove-typename/removeTypenameFromVariables.js +51 -50
  188. package/link/remove-typename/removeTypenameFromVariables.js.map +1 -1
  189. package/link/ws/index.js +1 -1
  190. package/local-state/LocalState.d.ts +2 -3
  191. package/local-state/LocalState.js +14 -28
  192. package/local-state/LocalState.js.map +1 -1
  193. package/masking/types.d.ts +1 -2
  194. package/masking/types.js.map +1 -1
  195. package/package.json +1 -15
  196. package/react/hooks/internal/useDeepMemo.js +0 -2
  197. package/react/hooks/internal/useDeepMemo.js.map +1 -1
  198. package/react/hooks/useApolloClient.d.ts +1 -1
  199. package/react/hooks/useApolloClient.js +1 -1
  200. package/react/hooks/useApolloClient.js.map +1 -1
  201. package/react/hooks/useBackgroundQuery.js +3 -1
  202. package/react/hooks/useBackgroundQuery.js.map +1 -1
  203. package/react/hooks/useFragment.d.ts +6 -65
  204. package/react/hooks/useFragment.js +87 -38
  205. package/react/hooks/useFragment.js.map +1 -1
  206. package/react/hooks/useLazyQuery.js +0 -2
  207. package/react/hooks/useLazyQuery.js.map +1 -1
  208. package/react/hooks/useMutation.d.ts +1 -13
  209. package/react/hooks/useMutation.js +1 -7
  210. package/react/hooks/useMutation.js.map +1 -1
  211. package/react/hooks/useQuery.js +4 -1
  212. package/react/hooks/useQuery.js.map +1 -1
  213. package/react/hooks/useQueryRefHandlers.js +3 -1
  214. package/react/hooks/useQueryRefHandlers.js.map +1 -1
  215. package/react/hooks/useReadQuery.js +3 -1
  216. package/react/hooks/useReadQuery.js.map +1 -1
  217. package/react/hooks/useSubscription.js +1 -1
  218. package/react/hooks/useSubscription.js.map +1 -1
  219. package/react/hooks/useSuspenseFragment.d.ts +7 -33
  220. package/react/hooks/useSuspenseFragment.js +17 -17
  221. package/react/hooks/useSuspenseFragment.js.map +1 -1
  222. package/react/hooks/useSuspenseQuery.js +4 -4
  223. package/react/hooks/useSuspenseQuery.js.map +1 -1
  224. package/react/hooks-compiled/internal/useDeepMemo.js +0 -2
  225. package/react/hooks-compiled/internal/useDeepMemo.js.map +1 -1
  226. package/react/hooks-compiled/internal/useSuspenseHookCacheKey.js +2 -0
  227. package/react/hooks-compiled/internal/useSuspenseHookCacheKey.js.map +1 -1
  228. package/react/hooks-compiled/useApolloClient.d.ts +1 -1
  229. package/react/hooks-compiled/useApolloClient.js +1 -1
  230. package/react/hooks-compiled/useApolloClient.js.map +1 -1
  231. package/react/hooks-compiled/useBackgroundQuery.js +3 -1
  232. package/react/hooks-compiled/useBackgroundQuery.js.map +1 -1
  233. package/react/hooks-compiled/useFragment.d.ts +6 -65
  234. package/react/hooks-compiled/useFragment.js +88 -110
  235. package/react/hooks-compiled/useFragment.js.map +1 -1
  236. package/react/hooks-compiled/useLazyQuery.js +0 -2
  237. package/react/hooks-compiled/useLazyQuery.js.map +1 -1
  238. package/react/hooks-compiled/useLoadableQuery.js +75 -69
  239. package/react/hooks-compiled/useMutation.d.ts +1 -13
  240. package/react/hooks-compiled/useMutation.js +13 -5
  241. package/react/hooks-compiled/useMutation.js.map +1 -1
  242. package/react/hooks-compiled/useQuery.js +56 -44
  243. package/react/hooks-compiled/useQuery.js.map +1 -1
  244. package/react/hooks-compiled/useQueryRefHandlers.js +5 -1
  245. package/react/hooks-compiled/useQueryRefHandlers.js.map +1 -1
  246. package/react/hooks-compiled/useReadQuery.js +14 -77
  247. package/react/hooks-compiled/useReadQuery.js.map +1 -1
  248. package/react/hooks-compiled/useSubscription.js +93 -237
  249. package/react/hooks-compiled/useSubscription.js.map +1 -1
  250. package/react/hooks-compiled/useSuspenseFragment.d.ts +7 -33
  251. package/react/hooks-compiled/useSuspenseFragment.js +17 -17
  252. package/react/hooks-compiled/useSuspenseFragment.js.map +1 -1
  253. package/react/hooks-compiled/useSuspenseQuery.js +8 -4
  254. package/react/hooks-compiled/useSuspenseQuery.js.map +1 -1
  255. package/react/index.compiled.d.ts +1 -1
  256. package/react/index.compiled.js +1 -1
  257. package/react/index.compiled.js.map +1 -1
  258. package/react/internal/cache/FragmentReference.d.ts +4 -2
  259. package/react/internal/cache/FragmentReference.js +22 -3
  260. package/react/internal/cache/FragmentReference.js.map +1 -1
  261. package/react/internal/cache/QueryReference.d.ts +0 -5
  262. package/react/internal/cache/QueryReference.js +0 -16
  263. package/react/internal/cache/QueryReference.js.map +1 -1
  264. package/react/internal/cache/SuspenseCache.d.ts +1 -1
  265. package/react/internal/cache/SuspenseCache.js.map +1 -1
  266. package/react/internal/cache/types.d.ts +2 -2
  267. package/react/internal/cache/types.js.map +1 -1
  268. package/react/query-preloader/createQueryPreloader.js +1 -41
  269. package/react/query-preloader/createQueryPreloader.js.map +1 -1
  270. package/react/ssr/useSSRQuery.js +0 -1
  271. package/react/ssr/useSSRQuery.js.map +1 -1
  272. package/utilities/DeepPartial.d.ts +1 -1
  273. package/utilities/DeepPartial.js.map +1 -1
  274. package/utilities/internal/DeepMerger.d.ts +4 -20
  275. package/utilities/internal/DeepMerger.js +4 -36
  276. package/utilities/internal/DeepMerger.js.map +1 -1
  277. package/utilities/internal/bindCacheKey.d.ts +15 -0
  278. package/utilities/internal/bindCacheKey.js +18 -0
  279. package/utilities/internal/bindCacheKey.js.map +1 -0
  280. package/utilities/internal/compact.js +1 -1
  281. package/utilities/internal/compact.js.map +1 -1
  282. package/utilities/internal/constants.d.ts +0 -16
  283. package/utilities/internal/constants.js +0 -16
  284. package/utilities/internal/constants.js.map +1 -1
  285. package/utilities/internal/getStoreKeyName.js +0 -1
  286. package/utilities/internal/getStoreKeyName.js.map +1 -1
  287. package/utilities/internal/index.d.ts +2 -4
  288. package/utilities/internal/index.js +2 -3
  289. package/utilities/internal/index.js.map +1 -1
  290. package/utilities/internal/memoize.d.ts +1 -2
  291. package/utilities/internal/memoize.js +2 -2
  292. package/utilities/internal/memoize.js.map +1 -1
  293. package/version.js +1 -1
  294. package/version.js.map +1 -1
  295. package/__cjs/incremental/handlers/graphql17Alpha9.cjs +0 -222
  296. package/__cjs/incremental/handlers/graphql17Alpha9.cjs.map +0 -1
  297. package/__cjs/incremental/handlers/graphql17Alpha9.d.cts +0 -98
  298. package/__cjs/utilities/internal/combineLatestBatched.cjs +0 -71
  299. package/__cjs/utilities/internal/combineLatestBatched.cjs.map +0 -1
  300. package/__cjs/utilities/internal/combineLatestBatched.d.cts +0 -14
  301. package/__cjs/utilities/internal/mapObservableFragment.cjs +0 -27
  302. package/__cjs/utilities/internal/mapObservableFragment.cjs.map +0 -1
  303. package/__cjs/utilities/internal/mapObservableFragment.d.cts +0 -3
  304. package/__cjs/utilities/internal/ponyfills/FinalizationRegistry.cjs +0 -61
  305. package/__cjs/utilities/internal/ponyfills/FinalizationRegistry.cjs.map +0 -1
  306. package/__cjs/utilities/internal/ponyfills/FinalizationRegistry.d.cts +0 -11
  307. package/__cjs/utilities/internal/ponyfills/index.cjs +0 -6
  308. package/__cjs/utilities/internal/ponyfills/index.cjs.map +0 -1
  309. package/__cjs/utilities/internal/ponyfills/index.d.cts +0 -3
  310. package/__cjs/utilities/internal/ponyfills/index.react-native.cjs +0 -6
  311. package/__cjs/utilities/internal/ponyfills/index.react-native.cjs.map +0 -1
  312. package/__cjs/utilities/internal/ponyfills/index.react-native.d.cts +0 -2
  313. package/__cjs/utilities/internal/types/ExtensionsWithStreamDetails.cjs +0 -3
  314. package/__cjs/utilities/internal/types/ExtensionsWithStreamDetails.cjs.map +0 -1
  315. package/__cjs/utilities/internal/types/ExtensionsWithStreamDetails.d.cts +0 -24
  316. package/incremental/handlers/graphql17Alpha9.d.ts +0 -98
  317. package/incremental/handlers/graphql17Alpha9.js +0 -218
  318. package/incremental/handlers/graphql17Alpha9.js.map +0 -1
  319. package/legacyEntryPoints/utilities/internal/ponyfills/index.d.ts +0 -1
  320. package/legacyEntryPoints/utilities/internal/ponyfills/index.js +0 -1
  321. package/legacyEntryPoints/utilities/internal/ponyfills/ponyfills.cjs +0 -1
  322. package/legacyEntryPoints/utilities/internal/ponyfills/ponyfills.d.cts +0 -1
  323. package/utilities/internal/combineLatestBatched.d.ts +0 -14
  324. package/utilities/internal/combineLatestBatched.js +0 -68
  325. package/utilities/internal/combineLatestBatched.js.map +0 -1
  326. package/utilities/internal/mapObservableFragment.d.ts +0 -3
  327. package/utilities/internal/mapObservableFragment.js +0 -24
  328. package/utilities/internal/mapObservableFragment.js.map +0 -1
  329. package/utilities/internal/ponyfills/FinalizationRegistry.d.ts +0 -11
  330. package/utilities/internal/ponyfills/FinalizationRegistry.js +0 -57
  331. package/utilities/internal/ponyfills/FinalizationRegistry.js.map +0 -1
  332. package/utilities/internal/ponyfills/index.d.ts +0 -3
  333. package/utilities/internal/ponyfills/index.js +0 -3
  334. package/utilities/internal/ponyfills/index.js.map +0 -1
  335. package/utilities/internal/ponyfills/index.react-native.d.ts +0 -2
  336. package/utilities/internal/ponyfills/index.react-native.js +0 -2
  337. package/utilities/internal/ponyfills/index.react-native.js.map +0 -1
  338. package/utilities/internal/types/ExtensionsWithStreamDetails.d.ts +0 -24
  339. package/utilities/internal/types/ExtensionsWithStreamDetails.js +0 -2
  340. package/utilities/internal/types/ExtensionsWithStreamDetails.js.map +0 -1
@@ -272,24 +272,24 @@ you have an infinite render loop in your application.`
272
272
  message: "No fragment named %s"
273
273
  },
274
274
 
275
- 55: {
275
+ 53: {
276
276
  file: "@apollo/client/local-state/LocalState.js",
277
277
  message: "Could not resolve __typename on object %o returned from resolver '%s'. '__typename' needs to be returned to properly resolve child fields."
278
278
  },
279
279
 
280
- 56: {
280
+ 54: {
281
281
  file: "@apollo/client/local-state/LocalState.js",
282
282
  condition: "fragment",
283
283
  message: `No fragment named %s`
284
284
  },
285
285
 
286
- 57: {
286
+ 55: {
287
287
  file: "@apollo/client/local-state/LocalState.js",
288
288
  condition: "cache.fragmentMatches",
289
289
  message: "The configured cache does not support fragment matching which will lead to incorrect results when executing local resolvers. Please use a cache that implements `fragmetMatches`."
290
290
  },
291
291
 
292
- 59: {
292
+ 57: {
293
293
  file: "@apollo/client/link/persisted-queries/index.js",
294
294
  condition: "options &&\n (typeof options.sha256 === \"function\" ||\n typeof options.generateHash === \"function\")",
295
295
 
@@ -298,13 +298,13 @@ you have an infinite render loop in your application.`
298
298
  "parameter."
299
299
  },
300
300
 
301
- 60: {
301
+ 58: {
302
302
  file: "@apollo/client/link/persisted-queries/index.js",
303
303
  condition: "forward",
304
304
  message: "PersistedQueryLink cannot be the last link in the chain."
305
305
  },
306
306
 
307
- 61: {
307
+ 59: {
308
308
  file: "@apollo/client/link/http/checkFetcher.js",
309
309
  condition: "fetcher || typeof fetch !== \"undefined\"",
310
310
 
@@ -322,30 +322,24 @@ const client = new ApolloClient({
322
322
  `
323
323
  },
324
324
 
325
- 62: {
325
+ 60: {
326
326
  file: "@apollo/client/link/http/parseAndCheckHttpResponse.js",
327
327
  condition: "response.body && typeof response.body.getReader === \"function\"",
328
328
  message: "Unknown type for `response.body`. Please use a `fetch` implementation that is WhatWG-compliant and that uses WhatWG ReadableStreams for `body`."
329
329
  },
330
330
 
331
- 65: {
331
+ 63: {
332
332
  file: "@apollo/client/link/core/ApolloLink.js",
333
333
  message: "request is not implemented"
334
334
  },
335
335
 
336
- 66: {
337
- file: "@apollo/client/incremental/handlers/graphql17Alpha9.js",
338
- condition: "pending",
339
- message: "Could not find pending chunk for incremental value. Please file an issue for the Apollo Client team to investigate."
340
- },
341
-
342
- 67: {
336
+ 64: {
343
337
  file: "@apollo/client/incremental/handlers/notImplemented.js",
344
- condition: "!hasDirectives([\"defer\", \"stream\"], request.query)",
345
- message: "`@defer` and `@stream` are not supported without specifying an incremental handler. Please pass a handler as the `incrementalHandler` option to the `ApolloClient` constructor."
338
+ condition: "!hasDirectives([\"defer\"], request.query)",
339
+ message: "`@defer` is not supported without specifying an incremental handler. Please pass a handler as the `incrementalHandler` option to the `ApolloClient` constructor."
346
340
  },
347
341
 
348
- 68: {
342
+ 65: {
349
343
  file: "@apollo/client/core/ApolloClient.js",
350
344
  condition: "options.cache",
351
345
 
@@ -354,7 +348,7 @@ const client = new ApolloClient({
354
348
  "For more information, please visit: https://go.apollo.dev/c/docs"
355
349
  },
356
350
 
357
- 69: {
351
+ 66: {
358
352
  file: "@apollo/client/core/ApolloClient.js",
359
353
  condition: "options.link",
360
354
 
@@ -363,7 +357,7 @@ const client = new ApolloClient({
363
357
  "For more information, please visit: https://go.apollo.dev/c/docs"
364
358
  },
365
359
 
366
- 70: {
360
+ 67: {
367
361
  file: "@apollo/client/core/ApolloClient.js",
368
362
  condition: "options.fetchPolicy !== \"cache-and-network\"",
369
363
 
@@ -373,7 +367,7 @@ const client = new ApolloClient({
373
367
  "using a different fetchPolicy, such as cache-first or network-only."
374
368
  },
375
369
 
376
- 71: {
370
+ 68: {
377
371
  file: "@apollo/client/core/ApolloClient.js",
378
372
  condition: "options.fetchPolicy !== \"standby\"",
379
373
 
@@ -382,7 +376,7 @@ const client = new ApolloClient({
382
376
  "as cache-first or network-only."
383
377
  },
384
378
 
385
- 72: {
379
+ 69: {
386
380
  file: "@apollo/client/core/ApolloClient.js",
387
381
  condition: "options.query",
388
382
 
@@ -390,164 +384,164 @@ const client = new ApolloClient({
390
384
  "in the query option."
391
385
  },
392
386
 
393
- 73: {
387
+ 70: {
394
388
  file: "@apollo/client/core/ApolloClient.js",
395
389
  condition: "options.query.kind === \"Document\"",
396
390
  message: 'You must wrap the query string in a "gql" tag.'
397
391
  },
398
392
 
399
- 74: {
393
+ 71: {
400
394
  file: "@apollo/client/core/ApolloClient.js",
401
395
  condition: "!options.returnPartialData",
402
396
  message: "returnPartialData option only supported on watchQuery."
403
397
  },
404
398
 
405
- 75: {
399
+ 72: {
406
400
  file: "@apollo/client/core/ApolloClient.js",
407
401
  condition: "!options.pollInterval",
408
402
  message: "pollInterval option only supported on watchQuery."
409
403
  },
410
404
 
411
- 76: {
405
+ 73: {
412
406
  file: "@apollo/client/core/ApolloClient.js",
413
407
  condition: "!options.notifyOnNetworkStatusChange",
414
408
  message: "notifyOnNetworkStatusChange option only supported on watchQuery."
415
409
  },
416
410
 
417
- 77: {
411
+ 74: {
418
412
  file: "@apollo/client/core/ApolloClient.js",
419
413
  condition: "optionsWithDefaults.mutation",
420
414
  message: "The `mutation` option is required. Please provide a GraphQL document in the `mutation` option."
421
415
  },
422
416
 
423
- 78: {
417
+ 75: {
424
418
  file: "@apollo/client/core/ApolloClient.js",
425
419
  condition: "optionsWithDefaults.fetchPolicy === \"network-only\" ||\n optionsWithDefaults.fetchPolicy === \"no-cache\"",
426
420
  message: "Mutations only support 'network-only' or 'no-cache' fetch policies. The default 'network-only' behavior automatically writes mutation results to the cache. Passing 'no-cache' skips the cache write."
427
421
  },
428
422
 
429
- 80: {
423
+ 77: {
430
424
  file: "@apollo/client/core/ObservableQuery.js",
431
425
  condition: "fetchPolicy === \"standby\"",
432
426
  message: "The `variablesUnknown` option can only be used together with a `standby` fetch policy."
433
427
  },
434
428
 
435
- 82: {
429
+ 79: {
436
430
  file: "@apollo/client/core/ObservableQuery.js",
437
431
  condition: "this.options.fetchPolicy !== \"cache-only\"",
438
432
  message: "Cannot execute `fetchMore` for 'cache-only' query '%s'. Please use a different fetch policy."
439
433
  },
440
434
 
441
- 83: {
435
+ 80: {
442
436
  file: "@apollo/client/core/ObservableQuery.js",
443
437
  condition: "updateQuery",
444
438
  message: "You must provide an `updateQuery` function when using `fetchMore` with a `no-cache` fetch policy."
445
439
  },
446
440
 
447
- 87: {
441
+ 84: {
448
442
  file: "@apollo/client/core/QueryManager.js",
449
443
  message: "QueryManager stopped while query was in flight"
450
444
  },
451
445
 
452
- 88: {
446
+ 85: {
453
447
  file: "@apollo/client/core/QueryManager.js",
454
448
  condition: "this.localState",
455
449
  message: "Mutation '%s' contains `@client` fields with variables provided by `@export` but local state has not been configured."
456
450
  },
457
451
 
458
- 89: {
452
+ 86: {
459
453
  file: "@apollo/client/core/QueryManager.js",
460
454
  message: "Store reset while query was in flight (not completed in link chain)"
461
455
  },
462
456
 
463
- 92: {
457
+ 89: {
464
458
  file: "@apollo/client/core/QueryManager.js",
465
459
  condition: "!this.getDocumentInfo(query).hasClientExports || this.localState",
466
460
  message: "Subscription '%s' contains `@client` fields with variables provided by `@export` but local state has not been configured."
467
461
  },
468
462
 
469
- 93: {
463
+ 90: {
470
464
  file: "@apollo/client/core/QueryManager.js",
471
465
  condition: "this.localState",
472
466
  message: "%s '%s' contains `@client` fields but local state has not been configured."
473
467
  },
474
468
 
475
- 94: {
469
+ 91: {
476
470
  file: "@apollo/client/core/QueryManager.js",
477
471
  condition: "!hasIncrementalDirective",
478
472
  message: "%s '%s' contains `@client` and `@defer` directives. These cannot be used together."
479
473
  },
480
474
 
481
- 95: {
475
+ 92: {
482
476
  file: "@apollo/client/core/QueryManager.js",
483
477
  condition: "this.localState",
484
478
  message: "Query '%s' contains `@client` fields with variables provided by `@export` but local state has not been configured."
485
479
  },
486
480
 
487
- 97: {
481
+ 94: {
488
482
  file: "@apollo/client/core/QueryManager.js",
489
483
  condition: "this.localState",
490
484
  message: "Query '%s' contains `@client` fields but local state has not been configured."
491
485
  },
492
486
 
493
- 98: {
487
+ 95: {
494
488
  file: "@apollo/client/core/QueryManager.js",
495
489
  condition: "didEmitValue",
496
490
  message: "The link chain completed without emitting a value. This is likely unintentional and should be updated to emit a value before completing."
497
491
  },
498
492
 
499
- 99: {
493
+ 96: {
500
494
  file: "@apollo/client/cache/inmemory/entityStore.js",
501
495
  condition: "typeof dataId === \"string\"",
502
496
  message: "store.merge expects a string ID"
503
497
  },
504
498
 
505
- 102: {
499
+ 99: {
506
500
  file: "@apollo/client/cache/inmemory/key-extractor.js",
507
501
  condition: "extracted !== void 0",
508
502
  message: `Missing field '%s' while extracting keyFields from %s`
509
503
  },
510
504
 
511
- 103: {
505
+ 100: {
512
506
  file: "@apollo/client/cache/inmemory/policies.js",
513
507
  condition: "!old || old === which",
514
508
  message: `Cannot change root %s __typename more than once`
515
509
  },
516
510
 
517
- 106: {
511
+ 103: {
518
512
  file: "@apollo/client/cache/inmemory/policies.js",
519
513
  message: "Cannot automatically merge arrays"
520
514
  },
521
515
 
522
- 107: {
516
+ 104: {
523
517
  file: "@apollo/client/cache/inmemory/readFromStore.js",
524
518
  message: `No fragment named %s`
525
519
  },
526
520
 
527
- 108: {
521
+ 105: {
528
522
  file: "@apollo/client/cache/inmemory/readFromStore.js",
529
523
  condition: "!isReference(value)",
530
524
  message: `Missing selection set for object of type %s returned for query field %s`
531
525
  },
532
526
 
533
- 109: {
527
+ 106: {
534
528
  file: "@apollo/client/cache/inmemory/writeToStore.js",
535
529
  message: `Could not identify object %s`
536
530
  },
537
531
 
538
- 111: {
532
+ 108: {
539
533
  file: "@apollo/client/cache/inmemory/writeToStore.js",
540
534
  message: `No fragment named %s`
541
535
  }
542
536
  };
543
537
 
544
538
  export const devDebug = {
545
- 79: {
539
+ 76: {
546
540
  file: "@apollo/client/core/ApolloClient.js",
547
541
  message: `In client.refetchQueries, Promise.all promise rejected with error %o`
548
542
  },
549
543
 
550
- 86: {
544
+ 83: {
551
545
  file: "@apollo/client/core/ObservableQuery.js",
552
546
  message: `Missing cache result fields: %o`
553
547
  }
@@ -582,41 +576,31 @@ export const devWarn = {
582
576
  },
583
577
 
584
578
  50: {
585
- file: "@apollo/client/local-state/LocalState.js",
586
- message: "The '%s' field resolves the value from the cache, for example from a 'read' function, but a 'no-cache' fetch policy was used. The field value has been set to `null`. Either define a local resolver or use a fetch policy that uses the cache to ensure the field is resolved correctly."
587
- },
588
-
589
- 51: {
590
- file: "@apollo/client/local-state/LocalState.js",
591
- message: "Could not find a resolver for the '%s' field nor does the cache resolve the field. The field value has been set to `null`. Either define a resolver for the field or ensure the cache can resolve the value, for example, by adding a 'read' function to a field policy in 'InMemoryCache'."
592
- },
593
-
594
- 52: {
595
579
  file: "@apollo/client/local-state/LocalState.js",
596
580
  message: "The '%s' resolver returned `undefined` instead of a value. This is likely a bug in the resolver. If you didn't mean to return a value, return `null` instead."
597
581
  },
598
582
 
599
- 53: {
583
+ 51: {
600
584
  file: "@apollo/client/local-state/LocalState.js",
601
585
  message: "The '%s' field had no cached value and only forced resolvers were run. The value was set to `null`."
602
586
  },
603
587
 
604
- 54: {
588
+ 52: {
605
589
  file: "@apollo/client/local-state/LocalState.js",
606
590
  message: "The '%s' field on object %o returned `undefined` instead of a value. The parent resolver did not include the property in the returned value and there was no resolver defined for the field."
607
591
  },
608
592
 
609
- 58: {
593
+ 56: {
610
594
  file: "@apollo/client/link/ws/index.js",
611
595
  message: "`WebSocketLink` uses the deprecated and unmaintained `subscriptions-transport-ws` library. This link is no longer maintained and will be removed in a future major version of Apollo Client. We recommend switching to `GraphQLWsLink` which uses the `graphql-ws` library to send GraphQL operations through WebSocket connections (https://the-guild.dev/graphql/ws)."
612
596
  },
613
597
 
614
- 63: {
598
+ 61: {
615
599
  file: "@apollo/client/link/core/ApolloLink.js",
616
600
  message: "[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`."
617
601
  },
618
602
 
619
- 64: {
603
+ 62: {
620
604
  file: "@apollo/client/link/core/ApolloLink.js",
621
605
 
622
606
  message: "The terminating link provided to `ApolloLink.execute` called `forward` instead of handling the request. " +
@@ -625,34 +609,34 @@ export const devWarn = {
625
609
  "If you are using a split link, ensure each branch contains a terminating link that handles the request."
626
610
  },
627
611
 
628
- 81: {
612
+ 78: {
629
613
  file: "@apollo/client/core/ObservableQuery.js",
630
614
 
631
615
  message: `Called refetch(%o) for query %o, which does not declare a $variables variable.
632
616
  Did you mean to call refetch(variables) instead of refetch({ variables })?`
633
617
  },
634
618
 
635
- 85: {
619
+ 82: {
636
620
  file: "@apollo/client/core/ObservableQuery.js",
637
621
  message: "Cannot poll on 'cache-only' query '%s' and as such, polling is disabled. Please use a different fetch policy."
638
622
  },
639
623
 
640
- 90: {
624
+ 87: {
641
625
  file: "@apollo/client/core/QueryManager.js",
642
626
  message: `Unknown query named "%s" requested in refetchQueries options.include array`
643
627
  },
644
628
 
645
- 91: {
629
+ 88: {
646
630
  file: "@apollo/client/core/QueryManager.js",
647
631
  message: `Unknown anonymous query requested in refetchQueries options.include array`
648
632
  },
649
633
 
650
- 96: {
634
+ 93: {
651
635
  file: "@apollo/client/core/QueryManager.js",
652
636
  message: '[%s]: Fragments masked by data masking are inaccessible when using fetch policy "no-cache". Please add `@unmask` to each fragment spread to access the data.'
653
637
  },
654
638
 
655
- 100: {
639
+ 97: {
656
640
  file: "@apollo/client/cache/inmemory/entityStore.js",
657
641
 
658
642
  message: "cache.modify: You are trying to write a Reference that is not part of the store: %o\n" +
@@ -660,24 +644,24 @@ Did you mean to call refetch(variables) instead of refetch({ variables })?`
660
644
  "`toReference(object, true)`"
661
645
  },
662
646
 
663
- 101: {
647
+ 98: {
664
648
  file: "@apollo/client/cache/inmemory/entityStore.js",
665
649
 
666
650
  message: "cache.modify: Writing an array with a mix of both References and Objects will not result in the Objects being normalized correctly.\n" +
667
651
  "Please convert the object instance %o to a Reference before writing it to the cache by calling `toReference(object, true)`."
668
652
  },
669
653
 
670
- 104: {
654
+ 101: {
671
655
  file: "@apollo/client/cache/inmemory/policies.js",
672
656
  message: `Inferring subtype %s of supertype %s`
673
657
  },
674
658
 
675
- 105: {
659
+ 102: {
676
660
  file: "@apollo/client/cache/inmemory/policies.js",
677
661
  message: `Undefined 'from' passed to readField with arguments %s`
678
662
  },
679
663
 
680
- 112: {
664
+ 109: {
681
665
  file: "@apollo/client/cache/inmemory/writeToStore.js",
682
666
 
683
667
  message: `Cache data may be lost when replacing the %s field of a %s object.
@@ -696,7 +680,7 @@ For more information about these options, please refer to the documentation:
696
680
  `
697
681
  },
698
682
 
699
- 113: {
683
+ 110: {
700
684
  file: "@apollo/client/cache/core/cache.js",
701
685
  message: "Could not identify object passed to `from` for '%s' fragment, either because the object is non-normalized or the key fields are missing. If you are masking this object, please ensure the key fields are requested by the parent object."
702
686
  }
@@ -713,12 +697,12 @@ export const devError = {
713
697
  message: "The result of getSnapshot should be cached to avoid an infinite loop"
714
698
  },
715
699
 
716
- 84: {
700
+ 81: {
717
701
  file: "@apollo/client/core/ObservableQuery.js",
718
702
  message: "Unhandled GraphQL subscription error"
719
703
  },
720
704
 
721
- 110: {
705
+ 107: {
722
706
  file: "@apollo/client/cache/inmemory/writeToStore.js",
723
707
  message: `Missing field '%s' while writing result %o`
724
708
  }
@@ -56,7 +56,7 @@ export declare namespace ClientAwarenessLink {
56
56
  *
57
57
  * @defaultValue "extensions"
58
58
  */
59
- transport?: "headers" | "extensions" | false;
59
+ transport?: "extensions" | false;
60
60
  }
61
61
  interface Options {
62
62
  /**
@@ -42,7 +42,7 @@ export class ClientAwarenessLink extends ApolloLink {
42
42
  {
43
43
  const { name, version, transport = "headers", } = compact({}, clientOptions.clientAwareness, options.clientAwareness, context.clientAwareness);
44
44
  if (transport === "headers") {
45
- operation.setContext(({ headers }) => {
45
+ operation.setContext(({ headers, extensions }) => {
46
46
  return {
47
47
  headers: compact(
48
48
  // setting these first so that they can be overridden by user-provided headers
@@ -66,18 +66,6 @@ export class ClientAwarenessLink extends ApolloLink {
66
66
  },
67
67
  }, operation.extensions);
68
68
  }
69
- if (transport === "headers") {
70
- operation.setContext(({ headers }) => {
71
- return {
72
- headers: compact(
73
- // setting these first so that they can be overridden by user-provided headers
74
- {
75
- "apollographql-library-name": "@apollo/client",
76
- "apollographql-library-version": client.version,
77
- }, headers),
78
- };
79
- });
80
- }
81
69
  }
82
70
  return forward(operation);
83
71
  });
@@ -1 +1 @@
1
- {"version":3,"file":"ClientAwarenessLink.js","sourceRoot":"","sources":["../../../src/link/client-awareness/ClientAwarenessLink.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,OAAO,EAAE,MAAM,mCAAmC,CAAC;AA4E5D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,MAAM,OAAO,mBAAoB,SAAQ,UAAU;IACjD,YAAY,UAAuC,EAAE;QACnD,KAAK,CAAC,CAAC,SAAS,EAAE,OAAO,EAAE,EAAE;YAC3B,MAAM,MAAM,GAAG,SAAS,CAAC,MAAM,CAAC;YAEhC,MAAM,aAAa,GAAG,MAAM,CAAC,cAAc,CAAC,CAAC,aAAa,CAAC;YAC3D,MAAM,OAAO,GAAG,SAAS,CAAC,UAAU,EAAE,CAAC;YACvC,CAAC;gBACC,MAAM,EACJ,IAAI,EACJ,OAAO,EACP,SAAS,GAAG,SAAS,GACtB,GAAG,OAAO,CACT,EAAE,EACF,aAAa,CAAC,eAAe,EAC7B,OAAO,CAAC,eAAe,EACvB,OAAO,CAAC,eAAe,CACxB,CAAC;gBAEF,IAAI,SAAS,KAAK,SAAS,EAAE,CAAC;oBAC5B,SAAS,CAAC,UAAU,CAAC,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE;wBACnC,OAAO;4BACL,OAAO,EAAE,OAAO;4BACd,8EAA8E;4BAC9E;gCACE,2BAA2B,EAAE,IAAI;gCACjC,8BAA8B,EAAE,OAAO;6BACxC,EACD,OAAO,CACR;yBACF,CAAC;oBACJ,CAAC,CAAC,CAAC;gBACL,CAAC;YACH,CAAC;YACD,CAAC;gBACC,MAAM,EAAE,SAAS,GAAG,YAAY,EAAE,GAAG,OAAO,CAC1C,EAAE,EACF,aAAa,CAAC,uBAAuB,EACrC,OAAO,CAAC,uBAAuB,CAChC,CAAC;gBACF,IAAI,SAAS,KAAK,YAAY,EAAE,CAAC;oBAC/B,SAAS,CAAC,UAAU,GAAG,OAAO;oBAC5B,+EAA+E;oBAC/E;wBACE,aAAa,EAAE;4BACb,IAAI,EAAE,gBAAgB;4BACtB,OAAO,EAAE,MAAM,CAAC,OAAO;yBACxB;qBACF,EACD,SAAS,CAAC,UAAU,CACrB,CAAC;gBACJ,CAAC;gBAED,IAAI,SAAS,KAAK,SAAS,EAAE,CAAC;oBAC5B,SAAS,CAAC,UAAU,CAAC,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE;wBACnC,OAAO;4BACL,OAAO,EAAE,OAAO;4BACd,8EAA8E;4BAC9E;gCACE,4BAA4B,EAAE,gBAAgB;gCAC9C,+BAA+B,EAAE,MAAM,CAAC,OAAO;6BAChD,EACD,OAAO,CACR;yBACF,CAAC;oBACJ,CAAC,CAAC,CAAC;gBACL,CAAC;YACH,CAAC;YAED,OAAO,OAAO,CAAC,SAAS,CAAC,CAAC;QAC5B,CAAC,CAAC,CAAC;IACL,CAAC;CACF","sourcesContent":["import { ApolloLink } from \"@apollo/client/link\";\nimport { compact } from \"@apollo/client/utilities/internal\";\n\nexport declare namespace ClientAwarenessLink {\n /**\n * Options passed to `ClientAwarenessLink` through [request context](https://apollographql.com/docs/react/api/link/introduction#managing-context). Previous\n * non-terminating links in the link chain also can set these values to\n * customize the behavior of `ClientAwarenessLink` for each operation.\n *\n * > [!NOTE]\n * > Some of these values can also be provided to the `ClientAwarenessLink`\n * > constructor. If a value is provided to both, the value in `context` takes\n * > precedence.\n */\n export interface ContextOptions {\n /** {@inheritDoc @apollo/client/link/client-awareness!ClientAwarenessLink.Options#clientAwareness:member} */\n clientAwareness?: ClientAwarenessLink.ClientAwarenessOptions;\n }\n\n export interface ClientAwarenessOptions {\n /**\n * A custom name (e.g., `iOS`) that identifies this particular client among your set of clients. Apollo Server and Apollo Studio use this property as part of the [client awareness](https://www.apollographql.com/docs/apollo-server/monitoring/metrics#identifying-distinct-clients) feature.\n *\n * This option can either be set as part of the Apollo Client constructor call or when manually constructing a `HttpLink`, `BatchHttpLink` or `ClientAwarenessLink`.\n */\n name?: string;\n /**\n * A custom version that identifies the current version of this particular client (e.g., `1.2`). Apollo Server and Apollo Studio use this property as part of the [client awareness](https://www.apollographql.com/docs/apollo-server/monitoring/metrics#identifying-distinct-clients) feature.\n *\n * This is **not** the version of Apollo Client that you are using, but rather any version string that helps you differentiate between versions of your client.\n *\n * This option can either be set as part of the Apollo Client constructor call or when manually constructing a `HttpLink`, `BatchHttpLink` or `ClientAwarenessLink`.\n */\n version?: string;\n /**\n * Determines how `name` and `version` are sent in outgoing requests.\n *\n * If `name` and `version` are not provided, this option will be ignored.\n * (These options can either be set as part of the Apollo Client constructor call or when manually constructing a `HttpLink`, `BatchHttpLink` or `ClientAwarenessLink`.)\n *\n * - If set to `\"headers\"`, `name` and `version` will be sent in the request headers as `apollographql-client-name` and `apollographql-client-version`, respectively.\n * - If set to `false`, `name` and `version` will not be included in outgoing requests.\n *\n * @defaultValue \"headers\"\n */\n transport?: \"headers\" | false;\n }\n export interface EnhancedClientAwarenessOptions {\n /**\n * Determines how the the version information of Apollo Client is sent in outgoing requests.\n *\n * - If set to `\"extensions\"`, library `name` and `version` will be sent in an object in the request extensions as `clientLibrary`.\n * - If set to `false`, library name and version will not be included in outgoing requests.\n *\n * @defaultValue \"extensions\"\n */\n transport?: \"headers\" | \"extensions\" | false;\n }\n\n export interface Options {\n /**\n * Configures the \"client awareness\" feature.\n * This feature allows you to identify distinct applications in Apollo Studio\n * and Apollo Server logs (and other monitoring or analytics tools) by adding\n * information about the your application to outgoing requests.\n */\n clientAwareness?: ClientAwarenessLink.ClientAwarenessOptions;\n /**\n * Configures the \"enhanced client awareness\" feature.\n * This feature allows you to identify the version of the Apollo Client library\n * used in your application in Apollo Studio (and other monitoring or analytics tools)\n * by adding information about the Apollo Client library to outgoing requests.\n */\n enhancedClientAwareness?: ClientAwarenessLink.EnhancedClientAwarenessOptions;\n }\n}\n\n/**\n * `ClientAwarenessLink` provides support for providing client awareness\n * features.\n *\n * @remarks\n *\n * Client awareness adds identifying information about the client to HTTP\n * requests for use with metrics reporting tools, such as [Apollo GraphOS](https://apollographql.com/docs/graphos/platform).\n * It is included in the functionality of [`HttpLink`](https://apollographql.com/docs/react/api/link/apollo-link-http) by default.\n *\n * Client awareness distinguishes between user-provided client awareness\n * (provided by the `clientAwareness` option) and enhanced client awareness\n * (provided by the `enhancedClientAwareness` option). User-provided client\n * awareness enables you to set a customized client name and version for\n * identification in metrics reporting tools. Enhanced client awareness enables\n * the identification of the Apollo Client package name and version.\n *\n * @example\n *\n * ```ts\n * import { ClientAwarenessLink } from \"@apollo/client/link/client-awareness\";\n *\n * const link = new ClientAwarenessLink({\n * clientAwareness: {\n * name: \"My Client\",\n * version: \"1\",\n * },\n * enhancedClientAwareness: {\n * transport: \"extensions\",\n * },\n * });\n * ```\n */\nexport class ClientAwarenessLink extends ApolloLink {\n constructor(options: ClientAwarenessLink.Options = {}) {\n super((operation, forward) => {\n const client = operation.client;\n\n const clientOptions = client[\"queryManager\"].clientOptions;\n const context = operation.getContext();\n {\n const {\n name,\n version,\n transport = \"headers\",\n } = compact(\n {},\n clientOptions.clientAwareness,\n options.clientAwareness,\n context.clientAwareness\n );\n\n if (transport === \"headers\") {\n operation.setContext(({ headers }) => {\n return {\n headers: compact(\n // setting these first so that they can be overridden by user-provided headers\n {\n \"apollographql-client-name\": name,\n \"apollographql-client-version\": version,\n },\n headers\n ),\n };\n });\n }\n }\n {\n const { transport = \"extensions\" } = compact(\n {},\n clientOptions.enhancedClientAwareness,\n options.enhancedClientAwareness\n );\n if (transport === \"extensions\") {\n operation.extensions = compact(\n // setting these first so that it can be overridden by user-provided extensions\n {\n clientLibrary: {\n name: \"@apollo/client\",\n version: client.version,\n },\n },\n operation.extensions\n );\n }\n\n if (transport === \"headers\") {\n operation.setContext(({ headers }) => {\n return {\n headers: compact(\n // setting these first so that they can be overridden by user-provided headers\n {\n \"apollographql-library-name\": \"@apollo/client\",\n \"apollographql-library-version\": client.version,\n },\n headers\n ),\n };\n });\n }\n }\n\n return forward(operation);\n });\n }\n}\n"]}
1
+ {"version":3,"file":"ClientAwarenessLink.js","sourceRoot":"","sources":["../../../src/link/client-awareness/ClientAwarenessLink.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,OAAO,EAAE,MAAM,mCAAmC,CAAC;AA4E5D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,MAAM,OAAO,mBAAoB,SAAQ,UAAU;IACjD,YAAY,UAAuC,EAAE;QACnD,KAAK,CAAC,CAAC,SAAS,EAAE,OAAO,EAAE,EAAE;YAC3B,MAAM,MAAM,GAAG,SAAS,CAAC,MAAM,CAAC;YAEhC,MAAM,aAAa,GAAG,MAAM,CAAC,cAAc,CAAC,CAAC,aAAa,CAAC;YAC3D,MAAM,OAAO,GAAG,SAAS,CAAC,UAAU,EAAE,CAAC;YACvC,CAAC;gBACC,MAAM,EACJ,IAAI,EACJ,OAAO,EACP,SAAS,GAAG,SAAS,GACtB,GAAG,OAAO,CACT,EAAE,EACF,aAAa,CAAC,eAAe,EAC7B,OAAO,CAAC,eAAe,EACvB,OAAO,CAAC,eAAe,CACxB,CAAC;gBAEF,IAAI,SAAS,KAAK,SAAS,EAAE,CAAC;oBAC5B,SAAS,CAAC,UAAU,CAAC,CAAC,EAAE,OAAO,EAAE,UAAU,EAAE,EAAE,EAAE;wBAC/C,OAAO;4BACL,OAAO,EAAE,OAAO;4BACd,8EAA8E;4BAC9E;gCACE,2BAA2B,EAAE,IAAI;gCACjC,8BAA8B,EAAE,OAAO;6BACxC,EACD,OAAO,CACR;yBACF,CAAC;oBACJ,CAAC,CAAC,CAAC;gBACL,CAAC;YACH,CAAC;YACD,CAAC;gBACC,MAAM,EAAE,SAAS,GAAG,YAAY,EAAE,GAAG,OAAO,CAC1C,EAAE,EACF,aAAa,CAAC,uBAAuB,EACrC,OAAO,CAAC,uBAAuB,CAChC,CAAC;gBACF,IAAI,SAAS,KAAK,YAAY,EAAE,CAAC;oBAC/B,SAAS,CAAC,UAAU,GAAG,OAAO;oBAC5B,+EAA+E;oBAC/E;wBACE,aAAa,EAAE;4BACb,IAAI,EAAE,gBAAgB;4BACtB,OAAO,EAAE,MAAM,CAAC,OAAO;yBACxB;qBACF,EACD,SAAS,CAAC,UAAU,CACrB,CAAC;gBACJ,CAAC;YACH,CAAC;YAED,OAAO,OAAO,CAAC,SAAS,CAAC,CAAC;QAC5B,CAAC,CAAC,CAAC;IACL,CAAC;CACF","sourcesContent":["import { ApolloLink } from \"@apollo/client/link\";\nimport { compact } from \"@apollo/client/utilities/internal\";\n\nexport declare namespace ClientAwarenessLink {\n /**\n * Options passed to `ClientAwarenessLink` through [request context](https://apollographql.com/docs/react/api/link/introduction#managing-context). Previous\n * non-terminating links in the link chain also can set these values to\n * customize the behavior of `ClientAwarenessLink` for each operation.\n *\n * > [!NOTE]\n * > Some of these values can also be provided to the `ClientAwarenessLink`\n * > constructor. If a value is provided to both, the value in `context` takes\n * > precedence.\n */\n export interface ContextOptions {\n /** {@inheritDoc @apollo/client/link/client-awareness!ClientAwarenessLink.Options#clientAwareness:member} */\n clientAwareness?: ClientAwarenessLink.ClientAwarenessOptions;\n }\n\n export interface ClientAwarenessOptions {\n /**\n * A custom name (e.g., `iOS`) that identifies this particular client among your set of clients. Apollo Server and Apollo Studio use this property as part of the [client awareness](https://www.apollographql.com/docs/apollo-server/monitoring/metrics#identifying-distinct-clients) feature.\n *\n * This option can either be set as part of the Apollo Client constructor call or when manually constructing a `HttpLink`, `BatchHttpLink` or `ClientAwarenessLink`.\n */\n name?: string;\n /**\n * A custom version that identifies the current version of this particular client (e.g., `1.2`). Apollo Server and Apollo Studio use this property as part of the [client awareness](https://www.apollographql.com/docs/apollo-server/monitoring/metrics#identifying-distinct-clients) feature.\n *\n * This is **not** the version of Apollo Client that you are using, but rather any version string that helps you differentiate between versions of your client.\n *\n * This option can either be set as part of the Apollo Client constructor call or when manually constructing a `HttpLink`, `BatchHttpLink` or `ClientAwarenessLink`.\n */\n version?: string;\n /**\n * Determines how `name` and `version` are sent in outgoing requests.\n *\n * If `name` and `version` are not provided, this option will be ignored.\n * (These options can either be set as part of the Apollo Client constructor call or when manually constructing a `HttpLink`, `BatchHttpLink` or `ClientAwarenessLink`.)\n *\n * - If set to `\"headers\"`, `name` and `version` will be sent in the request headers as `apollographql-client-name` and `apollographql-client-version`, respectively.\n * - If set to `false`, `name` and `version` will not be included in outgoing requests.\n *\n * @defaultValue \"headers\"\n */\n transport?: \"headers\" | false;\n }\n export interface EnhancedClientAwarenessOptions {\n /**\n * Determines how the the version information of Apollo Client is sent in outgoing requests.\n *\n * - If set to `\"extensions\"`, library `name` and `version` will be sent in an object in the request extensions as `clientLibrary`.\n * - If set to `false`, library name and version will not be included in outgoing requests.\n *\n * @defaultValue \"extensions\"\n */\n transport?: \"extensions\" | false;\n }\n\n export interface Options {\n /**\n * Configures the \"client awareness\" feature.\n * This feature allows you to identify distinct applications in Apollo Studio\n * and Apollo Server logs (and other monitoring or analytics tools) by adding\n * information about the your application to outgoing requests.\n */\n clientAwareness?: ClientAwarenessLink.ClientAwarenessOptions;\n /**\n * Configures the \"enhanced client awareness\" feature.\n * This feature allows you to identify the version of the Apollo Client library\n * used in your application in Apollo Studio (and other monitoring or analytics tools)\n * by adding information about the Apollo Client library to outgoing requests.\n */\n enhancedClientAwareness?: ClientAwarenessLink.EnhancedClientAwarenessOptions;\n }\n}\n\n/**\n * `ClientAwarenessLink` provides support for providing client awareness\n * features.\n *\n * @remarks\n *\n * Client awareness adds identifying information about the client to HTTP\n * requests for use with metrics reporting tools, such as [Apollo GraphOS](https://apollographql.com/docs/graphos/platform).\n * It is included in the functionality of [`HttpLink`](https://apollographql.com/docs/react/api/link/apollo-link-http) by default.\n *\n * Client awareness distinguishes between user-provided client awareness\n * (provided by the `clientAwareness` option) and enhanced client awareness\n * (provided by the `enhancedClientAwareness` option). User-provided client\n * awareness enables you to set a customized client name and version for\n * identification in metrics reporting tools. Enhanced client awareness enables\n * the identification of the Apollo Client package name and version.\n *\n * @example\n *\n * ```ts\n * import { ClientAwarenessLink } from \"@apollo/client/link/client-awareness\";\n *\n * const link = new ClientAwarenessLink({\n * clientAwareness: {\n * name: \"My Client\",\n * version: \"1\",\n * },\n * enhancedClientAwareness: {\n * transport: \"extensions\",\n * },\n * });\n * ```\n */\nexport class ClientAwarenessLink extends ApolloLink {\n constructor(options: ClientAwarenessLink.Options = {}) {\n super((operation, forward) => {\n const client = operation.client;\n\n const clientOptions = client[\"queryManager\"].clientOptions;\n const context = operation.getContext();\n {\n const {\n name,\n version,\n transport = \"headers\",\n } = compact(\n {},\n clientOptions.clientAwareness,\n options.clientAwareness,\n context.clientAwareness\n );\n\n if (transport === \"headers\") {\n operation.setContext(({ headers, extensions }) => {\n return {\n headers: compact(\n // setting these first so that they can be overridden by user-provided headers\n {\n \"apollographql-client-name\": name,\n \"apollographql-client-version\": version,\n },\n headers\n ),\n };\n });\n }\n }\n {\n const { transport = \"extensions\" } = compact(\n {},\n clientOptions.enhancedClientAwareness,\n options.enhancedClientAwareness\n );\n if (transport === \"extensions\") {\n operation.extensions = compact(\n // setting these first so that it can be overridden by user-provided extensions\n {\n clientLibrary: {\n name: \"@apollo/client\",\n version: client.version,\n },\n },\n operation.extensions\n );\n }\n }\n\n return forward(operation);\n });\n }\n}\n"]}
@@ -100,7 +100,7 @@ export class ApolloLink {
100
100
  const result = test(operation);
101
101
  if (__DEV__) {
102
102
  if (typeof result !== "boolean") {
103
- __DEV__ && invariant.warn(63, result);
103
+ __DEV__ && invariant.warn(61, result);
104
104
  }
105
105
  }
106
106
  return result ?
@@ -142,7 +142,7 @@ export class ApolloLink {
142
142
  static execute(link, request, context) {
143
143
  return link.request(createOperation(request, context), () => {
144
144
  if (__DEV__) {
145
- __DEV__ && invariant.warn(64);
145
+ __DEV__ && invariant.warn(62);
146
146
  }
147
147
  return EMPTY;
148
148
  });
@@ -246,7 +246,7 @@ export class ApolloLink {
246
246
  * > request instead.
247
247
  */
248
248
  request(operation, forward) {
249
- throw newInvariantError(65);
249
+ throw newInvariantError(63);
250
250
  }
251
251
  /**
252
252
  * @internal
@@ -1,5 +1,5 @@
1
1
  import { invariant } from "@apollo/client/utilities/invariant";
2
2
  export const checkFetcher = (fetcher) => {
3
- invariant(fetcher || typeof fetch !== "undefined", 61);
3
+ invariant(fetcher || typeof fetch !== "undefined", 59);
4
4
  };
5
5
  //# sourceMappingURL=checkFetcher.js.map
@@ -33,7 +33,7 @@ async function* consumeMultipartBody(response) {
33
33
  /;\s*boundary=(?:'([^']+)'|"([^"]+)"|([^"'].+?))\s*(?:;|$)/i);
34
34
  const boundary = "\r\n--" + (match ? match[1] ?? match[2] ?? match[3] ?? "-" : "-");
35
35
  let buffer = "";
36
- invariant(response.body && typeof response.body.getReader === "function", 62);
36
+ invariant(response.body && typeof response.body.getReader === "function", 60);
37
37
  const stream = response.body;
38
38
  const reader = stream.getReader();
39
39
  let done = false;
@@ -66,7 +66,7 @@ export class PersistedQueryLink extends ApolloLink {
66
66
  // hashing with something other than SHA-256.
67
67
  invariant(options &&
68
68
  (typeof options.sha256 === "function" ||
69
- typeof options.generateHash === "function"), 59);
69
+ typeof options.generateHash === "function"), 57);
70
70
  const { sha256,
71
71
  // If both a `sha256` and `generateHash` option are provided, the
72
72
  // `sha256` option will be ignored. Developers can configure and
@@ -92,7 +92,7 @@ export class PersistedQueryLink extends ApolloLink {
92
92
  return hash;
93
93
  }
94
94
  super((operation, forward) => {
95
- invariant(forward, 60);
95
+ invariant(forward, 58);
96
96
  const { query } = operation;
97
97
  return new Observable((observer) => {
98
98
  let subscription;
@@ -130,5 +130,8 @@ export declare function removeTypenameFromVariables(options?: RemoveTypenameFrom
130
130
  */
131
131
  export declare class RemoveTypenameFromVariablesLink extends ApolloLink {
132
132
  constructor(options?: RemoveTypenameFromVariablesLink.Options);
133
+ private maybeStripTypenameUsingConfig;
134
+ private maybeStripTypename;
135
+ private getVariableDefinitions;
133
136
  }
134
137
  //# sourceMappingURL=removeTypenameFromVariables.d.ts.map