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

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 (512) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/README.md +40 -40
  3. package/__cjs/cache/core/cache.cjs +2 -6
  4. package/__cjs/cache/core/cache.cjs.map +1 -1
  5. package/__cjs/cache/core/cache.d.cts +65 -64
  6. package/__cjs/cache/core/types/Cache.cjs +0 -4
  7. package/__cjs/cache/core/types/Cache.cjs.map +1 -1
  8. package/__cjs/cache/core/types/Cache.d.cts +200 -15
  9. package/__cjs/cache/{core/types/DataProxy.cjs → deprecated.cjs} +1 -1
  10. package/__cjs/cache/deprecated.cjs.map +1 -0
  11. package/__cjs/cache/deprecated.d.cts +6 -0
  12. package/__cjs/cache/index.cjs.map +1 -1
  13. package/__cjs/cache/index.d.cts +2 -2
  14. package/__cjs/cache/inmemory/entityStore.cjs +25 -28
  15. package/__cjs/cache/inmemory/entityStore.cjs.map +1 -1
  16. package/__cjs/cache/inmemory/entityStore.d.cts +17 -16
  17. package/__cjs/cache/inmemory/inMemoryCache.cjs.map +1 -1
  18. package/__cjs/cache/inmemory/inMemoryCache.d.cts +4 -4
  19. package/__cjs/cache/inmemory/key-extractor.cjs +1 -1
  20. package/__cjs/cache/inmemory/policies.cjs +4 -4
  21. package/__cjs/cache/inmemory/policies.cjs.map +1 -1
  22. package/__cjs/cache/inmemory/policies.d.cts +3 -2
  23. package/__cjs/cache/inmemory/readFromStore.cjs +2 -2
  24. package/__cjs/cache/inmemory/writeToStore.cjs +4 -4
  25. package/__cjs/cache/inmemory/writeToStore.cjs.map +1 -1
  26. package/__cjs/cache/inmemory/writeToStore.d.cts +1 -1
  27. package/__cjs/core/ApolloClient.cjs +92 -110
  28. package/__cjs/core/ApolloClient.cjs.map +1 -1
  29. package/__cjs/core/ApolloClient.d.cts +774 -180
  30. package/__cjs/core/ObservableQuery.cjs +10 -10
  31. package/__cjs/core/ObservableQuery.cjs.map +1 -1
  32. package/__cjs/core/ObservableQuery.d.cts +120 -68
  33. package/__cjs/core/QueryInfo.cjs.map +1 -1
  34. package/__cjs/core/QueryInfo.d.cts +5 -4
  35. package/__cjs/core/QueryManager.cjs +15 -13
  36. package/__cjs/core/QueryManager.cjs.map +1 -1
  37. package/__cjs/core/QueryManager.d.cts +17 -17
  38. package/__cjs/core/deprecated.cjs +3 -0
  39. package/__cjs/core/deprecated.cjs.map +1 -0
  40. package/__cjs/core/deprecated.d.cts +29 -0
  41. package/__cjs/core/index.cjs.map +1 -1
  42. package/__cjs/core/index.d.cts +9 -5
  43. package/__cjs/core/types.d.cts +29 -129
  44. package/__cjs/core/watchQueryOptions.d.cts +8 -297
  45. package/__cjs/dev/setErrorMessageHandler.cjs.map +1 -1
  46. package/__cjs/dev/setErrorMessageHandler.d.cts +4 -4
  47. package/__cjs/errors/CombinedGraphQLErrors.cjs +59 -11
  48. package/__cjs/errors/CombinedGraphQLErrors.cjs.map +1 -1
  49. package/__cjs/errors/CombinedGraphQLErrors.d.cts +146 -11
  50. package/__cjs/errors/CombinedProtocolErrors.cjs +48 -1
  51. package/__cjs/errors/CombinedProtocolErrors.cjs.map +1 -1
  52. package/__cjs/errors/CombinedProtocolErrors.d.cts +126 -2
  53. package/__cjs/errors/LinkError.cjs +45 -2
  54. package/__cjs/errors/LinkError.cjs.map +1 -1
  55. package/__cjs/errors/LinkError.d.cts +45 -2
  56. package/__cjs/errors/LocalStateError.cjs +35 -5
  57. package/__cjs/errors/LocalStateError.cjs.map +1 -1
  58. package/__cjs/errors/LocalStateError.d.cts +41 -5
  59. package/__cjs/errors/ServerError.cjs +50 -8
  60. package/__cjs/errors/ServerError.cjs.map +1 -1
  61. package/__cjs/errors/ServerError.d.cts +70 -11
  62. package/__cjs/errors/ServerParseError.cjs +45 -8
  63. package/__cjs/errors/ServerParseError.cjs.map +1 -1
  64. package/__cjs/errors/ServerParseError.d.cts +71 -16
  65. package/__cjs/errors/UnconventionalError.cjs +46 -2
  66. package/__cjs/errors/UnconventionalError.cjs.map +1 -1
  67. package/__cjs/errors/UnconventionalError.d.cts +46 -2
  68. package/__cjs/incremental/handlers/notImplemented.cjs +1 -1
  69. package/__cjs/invariantErrorCodes.cjs +72 -80
  70. package/__cjs/link/batch/batchLink.cjs.map +1 -1
  71. package/__cjs/link/batch-http/batchHttpLink.cjs +2 -2
  72. package/__cjs/link/batch-http/batchHttpLink.cjs.map +1 -1
  73. package/__cjs/link/client-awareness/ClientAwarenessLink.cjs.map +1 -1
  74. package/__cjs/link/client-awareness/ClientAwarenessLink.d.cts +4 -4
  75. package/__cjs/link/context/index.cjs +1 -1
  76. package/__cjs/link/context/index.cjs.map +1 -1
  77. package/__cjs/link/context/index.d.cts +1 -1
  78. package/__cjs/link/core/ApolloLink.cjs +2 -2
  79. package/__cjs/link/core/types.d.cts +2 -2
  80. package/__cjs/link/error/index.cjs.map +1 -1
  81. package/__cjs/link/error/index.d.cts +16 -1
  82. package/__cjs/link/http/HttpLink.cjs.map +1 -1
  83. package/__cjs/link/http/HttpLink.d.cts +2 -1
  84. package/__cjs/link/http/checkFetcher.cjs +1 -1
  85. package/__cjs/link/http/parseAndCheckHttpResponse.cjs +1 -1
  86. package/__cjs/link/http/serializeFetchParameter.cjs +1 -1
  87. package/__cjs/link/persisted-queries/index.cjs +2 -2
  88. package/__cjs/link/persisted-queries/index.cjs.map +1 -1
  89. package/__cjs/link/persisted-queries/index.d.cts +11 -11
  90. package/__cjs/link/retry/delayFunction.cjs.map +1 -1
  91. package/__cjs/link/retry/delayFunction.d.cts +1 -1
  92. package/__cjs/link/retry/retryFunction.cjs.map +1 -1
  93. package/__cjs/link/retry/retryFunction.d.cts +1 -1
  94. package/__cjs/link/retry/retryLink.cjs.map +1 -1
  95. package/__cjs/link/schema/index.cjs.map +1 -1
  96. package/__cjs/link/utils/validateOperation.cjs +1 -1
  97. package/__cjs/link/ws/index.cjs.map +1 -1
  98. package/__cjs/local-state/LocalState.cjs +55 -9
  99. package/__cjs/local-state/LocalState.cjs.map +1 -1
  100. package/__cjs/local-state/LocalState.d.cts +94 -0
  101. package/__cjs/masking/GraphQLCodegenDataMasking.d.cts +6 -7
  102. package/__cjs/masking/internal/types.d.cts +70 -70
  103. package/__cjs/masking/maskDefinition.cjs +2 -2
  104. package/__cjs/masking/maskFragment.cjs +2 -2
  105. package/__cjs/masking/maskOperation.cjs +1 -1
  106. package/__cjs/masking/utils.cjs +3 -3
  107. package/__cjs/react/context/ApolloContext.cjs +1 -1
  108. package/__cjs/react/context/ApolloProvider.cjs +1 -1
  109. package/__cjs/react/hooks/internal/useDeepMemo.cjs +0 -3
  110. package/__cjs/react/hooks/internal/useDeepMemo.cjs.map +1 -1
  111. package/__cjs/react/hooks/internal/validateSuspenseHookOptions.cjs.map +1 -1
  112. package/__cjs/react/hooks/internal/validateSuspenseHookOptions.d.cts +2 -2
  113. package/__cjs/react/hooks/internal/wrapHook.cjs +1 -0
  114. package/__cjs/react/hooks/internal/wrapHook.cjs.map +1 -1
  115. package/__cjs/react/hooks/internal/wrapHook.d.cts +8 -7
  116. package/__cjs/react/hooks/useApolloClient.cjs +2 -2
  117. package/__cjs/react/hooks/useApolloClient.cjs.map +1 -1
  118. package/__cjs/react/hooks/useApolloClient.d.cts +2 -2
  119. package/__cjs/react/hooks/useBackgroundQuery.cjs.map +1 -1
  120. package/__cjs/react/hooks/useBackgroundQuery.d.cts +814 -86
  121. package/__cjs/react/hooks/useFragment.cjs +7 -0
  122. package/__cjs/react/hooks/useFragment.cjs.map +1 -1
  123. package/__cjs/react/hooks/useFragment.d.cts +53 -2
  124. package/__cjs/react/hooks/useLazyQuery.cjs +0 -38
  125. package/__cjs/react/hooks/useLazyQuery.cjs.map +1 -1
  126. package/__cjs/react/hooks/useLazyQuery.d.cts +309 -119
  127. package/__cjs/react/hooks/useLoadableQuery.cjs.map +1 -1
  128. package/__cjs/react/hooks/useLoadableQuery.d.cts +113 -126
  129. package/__cjs/react/hooks/useMutation.cjs +6 -7
  130. package/__cjs/react/hooks/useMutation.cjs.map +1 -1
  131. package/__cjs/react/hooks/useMutation.d.cts +57 -17
  132. package/__cjs/react/hooks/useQuery.cjs +1 -35
  133. package/__cjs/react/hooks/useQuery.cjs.map +1 -1
  134. package/__cjs/react/hooks/useQuery.d.cts +163 -18
  135. package/__cjs/react/hooks/useQueryRefHandlers.cjs +2 -1
  136. package/__cjs/react/hooks/useQueryRefHandlers.cjs.map +1 -1
  137. package/__cjs/react/hooks/useQueryRefHandlers.d.cts +21 -1
  138. package/__cjs/react/hooks/useReactiveVar.cjs +2 -1
  139. package/__cjs/react/hooks/useReactiveVar.cjs.map +1 -1
  140. package/__cjs/react/hooks/useReactiveVar.d.cts +2 -1
  141. package/__cjs/react/hooks/useReadQuery.cjs +29 -0
  142. package/__cjs/react/hooks/useReadQuery.cjs.map +1 -1
  143. package/__cjs/react/hooks/useReadQuery.d.cts +95 -16
  144. package/__cjs/react/hooks/useSubscription.cjs +8 -9
  145. package/__cjs/react/hooks/useSubscription.cjs.map +1 -1
  146. package/__cjs/react/hooks/useSubscription.d.cts +99 -32
  147. package/__cjs/react/hooks/useSuspenseFragment.cjs.map +1 -1
  148. package/__cjs/react/hooks/useSuspenseFragment.d.cts +61 -29
  149. package/__cjs/react/hooks/useSuspenseQuery.cjs +4 -1
  150. package/__cjs/react/hooks/useSuspenseQuery.cjs.map +1 -1
  151. package/__cjs/react/hooks/useSuspenseQuery.d.cts +438 -17
  152. package/__cjs/react/index.cjs +1 -3
  153. package/__cjs/react/index.cjs.map +1 -1
  154. package/__cjs/react/index.d.cts +0 -1
  155. package/__cjs/react/index.react-server.cjs +1 -3
  156. package/__cjs/react/index.react-server.cjs.map +1 -1
  157. package/__cjs/react/index.react-server.d.cts +0 -1
  158. package/__cjs/react/internal/cache/FragmentReference.cjs.map +1 -1
  159. package/__cjs/react/internal/cache/FragmentReference.d.cts +2 -3
  160. package/__cjs/react/internal/cache/QueryReference.cjs.map +1 -1
  161. package/__cjs/react/internal/cache/QueryReference.d.cts +11 -11
  162. package/__cjs/react/internal/cache/SuspenseCache.cjs.map +1 -1
  163. package/__cjs/react/internal/cache/SuspenseCache.d.cts +2 -2
  164. package/__cjs/react/internal/cache/getSuspenseCache.cjs.map +1 -1
  165. package/__cjs/react/internal/cache/getSuspenseCache.d.cts +6 -4
  166. package/__cjs/react/internal/index.cjs +1 -0
  167. package/__cjs/react/internal/index.cjs.map +1 -1
  168. package/__cjs/react/internal/index.d.cts +1 -1
  169. package/__cjs/react/internal/types.d.cts +3 -3
  170. package/__cjs/react/query-preloader/createQueryPreloader.cjs +1 -1
  171. package/__cjs/react/query-preloader/createQueryPreloader.cjs.map +1 -1
  172. package/__cjs/react/query-preloader/createQueryPreloader.d.cts +31 -31
  173. package/__cjs/react/ssr/prerenderStatic.cjs +5 -4
  174. package/__cjs/react/ssr/prerenderStatic.cjs.map +1 -1
  175. package/__cjs/react/ssr/prerenderStatic.d.cts +11 -9
  176. package/__cjs/react/ssr/useSSRQuery.cjs.map +1 -1
  177. package/__cjs/react/types/deprecated.d.cts +1 -1
  178. package/__cjs/react/types/types.documentation.d.cts +10 -10
  179. package/__cjs/testing/core/mocking/mockLink.cjs.map +1 -1
  180. package/__cjs/testing/core/mocking/mockLink.d.cts +3 -2
  181. package/__cjs/testing/core/types/deprecated.d.cts +3 -2
  182. package/__cjs/testing/react/MockedProvider.cjs.map +1 -1
  183. package/__cjs/testing/react/MockedProvider.d.cts +2 -3
  184. package/__cjs/utilities/HKT.d.cts +8 -7
  185. package/__cjs/utilities/caching/sizes.cjs +3 -3
  186. package/__cjs/utilities/caching/sizes.cjs.map +1 -1
  187. package/__cjs/utilities/caching/sizes.d.cts +4 -6
  188. package/__cjs/utilities/graphql/DocumentTransform.cjs +2 -2
  189. package/__cjs/utilities/graphql/DocumentTransform.cjs.map +1 -1
  190. package/__cjs/utilities/index.cjs +2 -3
  191. package/__cjs/utilities/index.cjs.map +1 -1
  192. package/__cjs/utilities/index.d.cts +1 -2
  193. package/__cjs/utilities/{shared → internal}/canonicalStringify.cjs +5 -7
  194. package/__cjs/utilities/internal/canonicalStringify.cjs.map +1 -0
  195. package/__cjs/utilities/{shared → internal}/canonicalStringify.d.cts +1 -1
  196. package/__cjs/utilities/internal/checkDocument.cjs +2 -2
  197. package/__cjs/utilities/internal/checkDocument.cjs.map +1 -1
  198. package/__cjs/utilities/internal/createFragmentMap.cjs.map +1 -1
  199. package/__cjs/{core → utilities/internal}/equalByQuery.cjs +13 -7
  200. package/__cjs/utilities/internal/equalByQuery.cjs.map +1 -0
  201. package/__cjs/utilities/internal/equalByQuery.d.cts +5 -0
  202. package/__cjs/utilities/internal/getFragmentQueryDocument.cjs +13 -3
  203. package/__cjs/utilities/internal/getFragmentQueryDocument.cjs.map +1 -1
  204. package/__cjs/utilities/internal/getFragmentQueryDocument.d.cts +13 -3
  205. package/__cjs/utilities/internal/getMemoryInternals.cjs.map +1 -1
  206. package/__cjs/utilities/internal/getStoreKeyName.cjs +1 -2
  207. package/__cjs/utilities/internal/getStoreKeyName.cjs.map +1 -1
  208. package/__cjs/utilities/internal/index.cjs +6 -2
  209. package/__cjs/utilities/internal/index.cjs.map +1 -1
  210. package/__cjs/utilities/internal/index.d.cts +2 -0
  211. package/__cjs/utilities/internal/mergeOptions.cjs.map +1 -1
  212. package/__cjs/utilities/internal/mergeOptions.d.cts +2 -2
  213. package/__cjs/utilities/internal/toQueryResult.cjs.map +1 -1
  214. package/__cjs/utilities/internal/toQueryResult.d.cts +2 -2
  215. package/__cjs/utilities/internal/types/DocumentationTypes.d.cts +16 -2
  216. package/__cjs/utilities/internal/types/NoInfer.d.cts +31 -25
  217. package/__cjs/utilities/subscriptions/relay/index.cjs +2 -0
  218. package/__cjs/utilities/subscriptions/relay/index.cjs.map +1 -1
  219. package/__cjs/version.cjs +1 -1
  220. package/cache/core/cache.d.ts +65 -64
  221. package/cache/core/cache.js +3 -7
  222. package/cache/core/cache.js.map +1 -1
  223. package/cache/core/types/Cache.d.ts +200 -15
  224. package/cache/core/types/Cache.js +1 -3
  225. package/cache/core/types/Cache.js.map +1 -1
  226. package/cache/deprecated.d.ts +6 -0
  227. package/cache/deprecated.js +2 -0
  228. package/cache/deprecated.js.map +1 -0
  229. package/cache/index.d.ts +2 -2
  230. package/cache/index.js.map +1 -1
  231. package/cache/inmemory/entityStore.d.ts +17 -16
  232. package/cache/inmemory/entityStore.js +25 -28
  233. package/cache/inmemory/entityStore.js.map +1 -1
  234. package/cache/inmemory/inMemoryCache.d.ts +4 -4
  235. package/cache/inmemory/inMemoryCache.js.map +1 -1
  236. package/cache/inmemory/key-extractor.js +1 -1
  237. package/cache/inmemory/policies.d.ts +3 -2
  238. package/cache/inmemory/policies.js +4 -4
  239. package/cache/inmemory/policies.js.map +1 -1
  240. package/cache/inmemory/readFromStore.js +2 -2
  241. package/cache/inmemory/writeToStore.d.ts +1 -1
  242. package/cache/inmemory/writeToStore.js +4 -4
  243. package/cache/inmemory/writeToStore.js.map +1 -1
  244. package/core/ApolloClient.d.ts +774 -180
  245. package/core/ApolloClient.js +92 -110
  246. package/core/ApolloClient.js.map +1 -1
  247. package/core/ObservableQuery.d.ts +120 -68
  248. package/core/ObservableQuery.js +10 -10
  249. package/core/ObservableQuery.js.map +1 -1
  250. package/core/QueryInfo.d.ts +5 -4
  251. package/core/QueryInfo.js.map +1 -1
  252. package/core/QueryManager.d.ts +17 -17
  253. package/core/QueryManager.js +15 -13
  254. package/core/QueryManager.js.map +1 -1
  255. package/core/deprecated.d.ts +29 -0
  256. package/core/deprecated.js +2 -0
  257. package/core/deprecated.js.map +1 -0
  258. package/core/index.d.ts +9 -5
  259. package/core/index.js.map +1 -1
  260. package/core/types.d.ts +29 -129
  261. package/core/types.js.map +1 -1
  262. package/core/watchQueryOptions.d.ts +9 -298
  263. package/core/watchQueryOptions.js.map +1 -1
  264. package/dev/setErrorMessageHandler.d.ts +4 -4
  265. package/dev/setErrorMessageHandler.js.map +1 -1
  266. package/errors/CombinedGraphQLErrors.d.ts +147 -12
  267. package/errors/CombinedGraphQLErrors.js +60 -12
  268. package/errors/CombinedGraphQLErrors.js.map +1 -1
  269. package/errors/CombinedProtocolErrors.d.ts +127 -3
  270. package/errors/CombinedProtocolErrors.js +49 -2
  271. package/errors/CombinedProtocolErrors.js.map +1 -1
  272. package/errors/LinkError.d.ts +45 -2
  273. package/errors/LinkError.js +45 -2
  274. package/errors/LinkError.js.map +1 -1
  275. package/errors/LocalStateError.d.ts +42 -6
  276. package/errors/LocalStateError.js +36 -6
  277. package/errors/LocalStateError.js.map +1 -1
  278. package/errors/ServerError.d.ts +71 -12
  279. package/errors/ServerError.js +51 -9
  280. package/errors/ServerError.js.map +1 -1
  281. package/errors/ServerParseError.d.ts +72 -17
  282. package/errors/ServerParseError.js +46 -9
  283. package/errors/ServerParseError.js.map +1 -1
  284. package/errors/UnconventionalError.d.ts +46 -2
  285. package/errors/UnconventionalError.js +46 -2
  286. package/errors/UnconventionalError.js.map +1 -1
  287. package/incremental/handlers/notImplemented.js +1 -1
  288. package/invariantErrorCodes.js +72 -80
  289. package/link/batch/batchLink.js.map +1 -1
  290. package/link/batch-http/batchHttpLink.js +1 -1
  291. package/link/batch-http/batchHttpLink.js.map +1 -1
  292. package/link/client-awareness/ClientAwarenessLink.d.ts +4 -4
  293. package/link/client-awareness/ClientAwarenessLink.js.map +1 -1
  294. package/link/context/index.d.ts +1 -1
  295. package/link/context/index.js +1 -1
  296. package/link/context/index.js.map +1 -1
  297. package/link/core/ApolloLink.js +2 -2
  298. package/link/core/types.d.ts +2 -2
  299. package/link/core/types.js.map +1 -1
  300. package/link/error/index.d.ts +16 -1
  301. package/link/error/index.js.map +1 -1
  302. package/link/http/HttpLink.d.ts +2 -1
  303. package/link/http/HttpLink.js.map +1 -1
  304. package/link/http/checkFetcher.js +1 -1
  305. package/link/http/parseAndCheckHttpResponse.js +1 -1
  306. package/link/http/serializeFetchParameter.js +1 -1
  307. package/link/persisted-queries/index.d.ts +11 -11
  308. package/link/persisted-queries/index.js +2 -2
  309. package/link/persisted-queries/index.js.map +1 -1
  310. package/link/retry/delayFunction.d.ts +1 -1
  311. package/link/retry/delayFunction.js.map +1 -1
  312. package/link/retry/retryFunction.d.ts +1 -1
  313. package/link/retry/retryFunction.js.map +1 -1
  314. package/link/retry/retryLink.js.map +1 -1
  315. package/link/schema/index.js.map +1 -1
  316. package/link/utils/validateOperation.js +1 -1
  317. package/link/ws/index.js.map +1 -1
  318. package/local-state/LocalState.d.ts +94 -0
  319. package/local-state/LocalState.js +55 -9
  320. package/local-state/LocalState.js.map +1 -1
  321. package/masking/GraphQLCodegenDataMasking.d.ts +6 -7
  322. package/masking/GraphQLCodegenDataMasking.js.map +1 -1
  323. package/masking/internal/types.d.ts +70 -70
  324. package/masking/internal/types.js.map +1 -1
  325. package/masking/maskDefinition.js +2 -2
  326. package/masking/maskFragment.js +2 -2
  327. package/masking/maskOperation.js +1 -1
  328. package/masking/types.js.map +1 -1
  329. package/masking/utils.js +3 -3
  330. package/package.json +1 -1
  331. package/react/context/ApolloContext.js +1 -1
  332. package/react/context/ApolloProvider.js +1 -1
  333. package/react/hooks/internal/useDeepMemo.js +0 -3
  334. package/react/hooks/internal/useDeepMemo.js.map +1 -1
  335. package/react/hooks/internal/validateSuspenseHookOptions.d.ts +2 -2
  336. package/react/hooks/internal/validateSuspenseHookOptions.js.map +1 -1
  337. package/react/hooks/internal/wrapHook.d.ts +8 -7
  338. package/react/hooks/internal/wrapHook.js +1 -0
  339. package/react/hooks/internal/wrapHook.js.map +1 -1
  340. package/react/hooks/useApolloClient.d.ts +2 -2
  341. package/react/hooks/useApolloClient.js +2 -2
  342. package/react/hooks/useApolloClient.js.map +1 -1
  343. package/react/hooks/useBackgroundQuery.d.ts +814 -86
  344. package/react/hooks/useBackgroundQuery.js.map +1 -1
  345. package/react/hooks/useFragment.d.ts +54 -3
  346. package/react/hooks/useFragment.js +7 -0
  347. package/react/hooks/useFragment.js.map +1 -1
  348. package/react/hooks/useLazyQuery.d.ts +309 -119
  349. package/react/hooks/useLazyQuery.js +0 -38
  350. package/react/hooks/useLazyQuery.js.map +1 -1
  351. package/react/hooks/useLoadableQuery.d.ts +113 -126
  352. package/react/hooks/useLoadableQuery.js.map +1 -1
  353. package/react/hooks/useMutation.d.ts +57 -17
  354. package/react/hooks/useMutation.js +6 -7
  355. package/react/hooks/useMutation.js.map +1 -1
  356. package/react/hooks/useQuery.d.ts +163 -18
  357. package/react/hooks/useQuery.js +1 -35
  358. package/react/hooks/useQuery.js.map +1 -1
  359. package/react/hooks/useQueryRefHandlers.d.ts +21 -1
  360. package/react/hooks/useQueryRefHandlers.js +2 -1
  361. package/react/hooks/useQueryRefHandlers.js.map +1 -1
  362. package/react/hooks/useReactiveVar.d.ts +2 -1
  363. package/react/hooks/useReactiveVar.js +2 -1
  364. package/react/hooks/useReactiveVar.js.map +1 -1
  365. package/react/hooks/useReadQuery.d.ts +96 -17
  366. package/react/hooks/useReadQuery.js +29 -0
  367. package/react/hooks/useReadQuery.js.map +1 -1
  368. package/react/hooks/useSubscription.d.ts +99 -32
  369. package/react/hooks/useSubscription.js +8 -9
  370. package/react/hooks/useSubscription.js.map +1 -1
  371. package/react/hooks/useSuspenseFragment.d.ts +62 -30
  372. package/react/hooks/useSuspenseFragment.js.map +1 -1
  373. package/react/hooks/useSuspenseQuery.d.ts +438 -17
  374. package/react/hooks/useSuspenseQuery.js +4 -1
  375. package/react/hooks/useSuspenseQuery.js.map +1 -1
  376. package/react/hooks-compiled/internal/useDeepMemo.js +0 -3
  377. package/react/hooks-compiled/internal/useDeepMemo.js.map +1 -1
  378. package/react/hooks-compiled/internal/validateSuspenseHookOptions.d.ts +2 -2
  379. package/react/hooks-compiled/internal/validateSuspenseHookOptions.js.map +1 -1
  380. package/react/hooks-compiled/internal/wrapHook.d.ts +8 -7
  381. package/react/hooks-compiled/internal/wrapHook.js +1 -0
  382. package/react/hooks-compiled/internal/wrapHook.js.map +1 -1
  383. package/react/hooks-compiled/useApolloClient.d.ts +2 -2
  384. package/react/hooks-compiled/useApolloClient.js +2 -2
  385. package/react/hooks-compiled/useApolloClient.js.map +1 -1
  386. package/react/hooks-compiled/useBackgroundQuery.d.ts +814 -86
  387. package/react/hooks-compiled/useBackgroundQuery.js.map +1 -1
  388. package/react/hooks-compiled/useFragment.d.ts +54 -3
  389. package/react/hooks-compiled/useFragment.js +7 -0
  390. package/react/hooks-compiled/useFragment.js.map +1 -1
  391. package/react/hooks-compiled/useLazyQuery.d.ts +309 -119
  392. package/react/hooks-compiled/useLazyQuery.js +0 -38
  393. package/react/hooks-compiled/useLazyQuery.js.map +1 -1
  394. package/react/hooks-compiled/useLoadableQuery.d.ts +113 -126
  395. package/react/hooks-compiled/useLoadableQuery.js.map +1 -1
  396. package/react/hooks-compiled/useMutation.d.ts +57 -17
  397. package/react/hooks-compiled/useMutation.js +6 -7
  398. package/react/hooks-compiled/useMutation.js.map +1 -1
  399. package/react/hooks-compiled/useQuery.d.ts +163 -18
  400. package/react/hooks-compiled/useQuery.js +1 -35
  401. package/react/hooks-compiled/useQuery.js.map +1 -1
  402. package/react/hooks-compiled/useQueryRefHandlers.d.ts +21 -1
  403. package/react/hooks-compiled/useQueryRefHandlers.js +2 -1
  404. package/react/hooks-compiled/useQueryRefHandlers.js.map +1 -1
  405. package/react/hooks-compiled/useReactiveVar.d.ts +2 -1
  406. package/react/hooks-compiled/useReactiveVar.js +2 -1
  407. package/react/hooks-compiled/useReactiveVar.js.map +1 -1
  408. package/react/hooks-compiled/useReadQuery.d.ts +96 -17
  409. package/react/hooks-compiled/useReadQuery.js +29 -0
  410. package/react/hooks-compiled/useReadQuery.js.map +1 -1
  411. package/react/hooks-compiled/useSubscription.d.ts +99 -32
  412. package/react/hooks-compiled/useSubscription.js +8 -9
  413. package/react/hooks-compiled/useSubscription.js.map +1 -1
  414. package/react/hooks-compiled/useSuspenseFragment.d.ts +62 -30
  415. package/react/hooks-compiled/useSuspenseFragment.js.map +1 -1
  416. package/react/hooks-compiled/useSuspenseQuery.d.ts +438 -17
  417. package/react/hooks-compiled/useSuspenseQuery.js.map +1 -1
  418. package/react/index.compiled.d.ts +0 -1
  419. package/react/index.compiled.js +0 -1
  420. package/react/index.compiled.js.map +1 -1
  421. package/react/index.d.ts +0 -1
  422. package/react/index.js +0 -1
  423. package/react/index.js.map +1 -1
  424. package/react/index.react-server.d.ts +0 -1
  425. package/react/index.react-server.js +0 -2
  426. package/react/index.react-server.js.map +1 -1
  427. package/react/internal/cache/FragmentReference.d.ts +2 -3
  428. package/react/internal/cache/FragmentReference.js.map +1 -1
  429. package/react/internal/cache/QueryReference.d.ts +11 -11
  430. package/react/internal/cache/QueryReference.js.map +1 -1
  431. package/react/internal/cache/SuspenseCache.d.ts +2 -2
  432. package/react/internal/cache/SuspenseCache.js.map +1 -1
  433. package/react/internal/cache/getSuspenseCache.d.ts +6 -4
  434. package/react/internal/cache/getSuspenseCache.js.map +1 -1
  435. package/react/internal/index.d.ts +1 -1
  436. package/react/internal/index.js +1 -0
  437. package/react/internal/index.js.map +1 -1
  438. package/react/internal/types.d.ts +3 -3
  439. package/react/internal/types.js.map +1 -1
  440. package/react/query-preloader/createQueryPreloader.d.ts +31 -31
  441. package/react/query-preloader/createQueryPreloader.js +1 -1
  442. package/react/query-preloader/createQueryPreloader.js.map +1 -1
  443. package/react/ssr/prerenderStatic.d.ts +11 -9
  444. package/react/ssr/prerenderStatic.js +5 -4
  445. package/react/ssr/prerenderStatic.js.map +1 -1
  446. package/react/ssr/useSSRQuery.js.map +1 -1
  447. package/react/types/deprecated.d.ts +1 -1
  448. package/react/types/deprecated.js.map +1 -1
  449. package/react/types/types.documentation.d.ts +10 -10
  450. package/react/types/types.documentation.js.map +1 -1
  451. package/testing/core/mocking/mockLink.d.ts +3 -2
  452. package/testing/core/mocking/mockLink.js.map +1 -1
  453. package/testing/core/types/deprecated.d.ts +3 -2
  454. package/testing/core/types/deprecated.js.map +1 -1
  455. package/testing/react/MockedProvider.d.ts +2 -3
  456. package/testing/react/MockedProvider.js.map +1 -1
  457. package/utilities/HKT.d.ts +8 -7
  458. package/utilities/HKT.js.map +1 -1
  459. package/utilities/caching/sizes.d.ts +4 -6
  460. package/utilities/caching/sizes.js +3 -3
  461. package/utilities/caching/sizes.js.map +1 -1
  462. package/utilities/graphql/DocumentTransform.js +1 -1
  463. package/utilities/graphql/DocumentTransform.js.map +1 -1
  464. package/utilities/index.d.ts +1 -2
  465. package/utilities/index.js +1 -2
  466. package/utilities/index.js.map +1 -1
  467. package/utilities/{shared → internal}/canonicalStringify.d.ts +1 -1
  468. package/utilities/{shared → internal}/canonicalStringify.js +4 -6
  469. package/utilities/internal/canonicalStringify.js.map +1 -0
  470. package/utilities/internal/checkDocument.js +1 -1
  471. package/utilities/internal/checkDocument.js.map +1 -1
  472. package/utilities/internal/createFragmentMap.js.map +1 -1
  473. package/utilities/internal/equalByQuery.d.ts +5 -0
  474. package/{core → utilities/internal}/equalByQuery.js +7 -1
  475. package/utilities/internal/equalByQuery.js.map +1 -0
  476. package/utilities/internal/getFragmentQueryDocument.d.ts +13 -3
  477. package/utilities/internal/getFragmentQueryDocument.js +13 -3
  478. package/utilities/internal/getFragmentQueryDocument.js.map +1 -1
  479. package/utilities/internal/getMemoryInternals.js.map +1 -1
  480. package/utilities/internal/getStoreKeyName.js +1 -2
  481. package/utilities/internal/getStoreKeyName.js.map +1 -1
  482. package/utilities/internal/index.d.ts +2 -0
  483. package/utilities/internal/index.js +2 -0
  484. package/utilities/internal/index.js.map +1 -1
  485. package/utilities/internal/mergeOptions.d.ts +2 -2
  486. package/utilities/internal/mergeOptions.js.map +1 -1
  487. package/utilities/internal/toQueryResult.d.ts +2 -2
  488. package/utilities/internal/toQueryResult.js.map +1 -1
  489. package/utilities/internal/types/DocumentationTypes.d.ts +16 -2
  490. package/utilities/internal/types/DocumentationTypes.js.map +1 -1
  491. package/utilities/internal/types/NoInfer.d.ts +31 -25
  492. package/utilities/internal/types/NoInfer.js.map +1 -1
  493. package/utilities/subscriptions/relay/index.js +2 -0
  494. package/utilities/subscriptions/relay/index.js.map +1 -1
  495. package/version.js +1 -1
  496. package/__cjs/cache/core/types/DataProxy.cjs.map +0 -1
  497. package/__cjs/cache/core/types/DataProxy.d.cts +0 -140
  498. package/__cjs/core/equalByQuery.cjs.map +0 -1
  499. package/__cjs/core/equalByQuery.d.cts +0 -4
  500. package/__cjs/react/context/ApolloConsumer.cjs +0 -16
  501. package/__cjs/react/context/ApolloConsumer.cjs.map +0 -1
  502. package/__cjs/react/context/ApolloConsumer.d.cts +0 -10
  503. package/__cjs/utilities/shared/canonicalStringify.cjs.map +0 -1
  504. package/cache/core/types/DataProxy.d.ts +0 -140
  505. package/cache/core/types/DataProxy.js +0 -2
  506. package/cache/core/types/DataProxy.js.map +0 -1
  507. package/core/equalByQuery.d.ts +0 -4
  508. package/core/equalByQuery.js.map +0 -1
  509. package/react/context/ApolloConsumer.d.ts +0 -10
  510. package/react/context/ApolloConsumer.js +0 -11
  511. package/react/context/ApolloConsumer.js.map +0 -1
  512. package/utilities/shared/canonicalStringify.js.map +0 -1
@@ -212,14 +212,6 @@ you have an infinite render loop in your application.`
212
212
  },
213
213
 
214
214
  37: {
215
- file: "@apollo/client/react/context/ApolloConsumer.js",
216
- condition: "context && context.client",
217
-
218
- message: 'Could not find "client" in the context of ApolloConsumer. ' +
219
- "Wrap the root component in an <ApolloProvider>."
220
- },
221
-
222
- 38: {
223
215
  file: "@apollo/client/react/context/ApolloContext.js",
224
216
  condition: "\"createContext\" in React",
225
217
 
@@ -230,7 +222,7 @@ you have an infinite render loop in your application.`
230
222
  "For more information, see https://nextjs.org/docs/getting-started/react-essentials#client-components"
231
223
  },
232
224
 
233
- 39: {
225
+ 38: {
234
226
  file: "@apollo/client/react/context/ApolloProvider.js",
235
227
  condition: "context.client",
236
228
 
@@ -238,71 +230,71 @@ you have an infinite render loop in your application.`
238
230
  'sure you pass in your client via the "client" prop.'
239
231
  },
240
232
 
241
- 40: {
233
+ 39: {
242
234
  file: "@apollo/client/masking/maskDefinition.js",
243
235
  condition: "fragment",
244
236
  message: "Could not find fragment with name '%s'."
245
237
  },
246
238
 
247
- 42: {
239
+ 41: {
248
240
  file: "@apollo/client/masking/maskFragment.js",
249
241
  condition: "fragments.length === 1",
250
242
  message: `Found %s fragments. \`fragmentName\` must be provided when there is not exactly 1 fragment.`
251
243
  },
252
244
 
253
- 43: {
245
+ 42: {
254
246
  file: "@apollo/client/masking/maskFragment.js",
255
247
  condition: "!!fragment",
256
248
  message: `Could not find fragment with name "%s".`
257
249
  },
258
250
 
259
- 44: {
251
+ 43: {
260
252
  file: "@apollo/client/masking/maskOperation.js",
261
253
  condition: "definition",
262
254
  message: "Expected a parsed GraphQL document with a query, mutation, or subscription."
263
255
  },
264
256
 
265
- 48: {
257
+ 47: {
266
258
  file: "@apollo/client/local-state/LocalState.js",
267
259
  condition: "hasDirectives([\"client\"], document)",
268
260
  message: "Expected document to contain `@client` fields."
269
261
  },
270
262
 
271
- 49: {
263
+ 48: {
272
264
  file: "@apollo/client/local-state/LocalState.js",
273
265
  condition: "hasDirectives([\"client\"], document)",
274
266
  message: "Expected document to contain `@client` fields."
275
267
  },
276
268
 
277
- 50: {
269
+ 49: {
278
270
  file: "@apollo/client/local-state/LocalState.js",
279
271
  condition: "fragment",
280
272
  message: "No fragment named %s"
281
273
  },
282
274
 
283
- 54: {
275
+ 53: {
284
276
  file: "@apollo/client/local-state/LocalState.js",
285
277
  message: "Could not resolve __typename on object %o returned from resolver '%s'. '__typename' needs to be returned to properly resolve child fields."
286
278
  },
287
279
 
288
- 55: {
280
+ 54: {
289
281
  file: "@apollo/client/local-state/LocalState.js",
290
282
  condition: "fragment",
291
283
  message: `No fragment named %s`
292
284
  },
293
285
 
294
- 56: {
286
+ 55: {
295
287
  file: "@apollo/client/local-state/LocalState.js",
296
288
  condition: "cache.fragmentMatches",
297
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`."
298
290
  },
299
291
 
300
- 57: {
292
+ 56: {
301
293
  file: "@apollo/client/link/utils/validateOperation.js",
302
294
  message: `illegal argument: %s`
303
295
  },
304
296
 
305
- 58: {
297
+ 57: {
306
298
  file: "@apollo/client/link/persisted-queries/index.js",
307
299
  condition: "options &&\n (typeof options.sha256 === \"function\" ||\n typeof options.generateHash === \"function\")",
308
300
 
@@ -311,13 +303,13 @@ you have an infinite render loop in your application.`
311
303
  "parameter."
312
304
  },
313
305
 
314
- 59: {
306
+ 58: {
315
307
  file: "@apollo/client/link/persisted-queries/index.js",
316
308
  condition: "forward",
317
309
  message: "PersistedQueryLink cannot be the last link in the chain."
318
310
  },
319
311
 
320
- 60: {
312
+ 59: {
321
313
  file: "@apollo/client/link/http/checkFetcher.js",
322
314
  condition: "fetcher || typeof fetch !== \"undefined\"",
323
315
 
@@ -335,29 +327,29 @@ const client = new ApolloClient({
335
327
  `
336
328
  },
337
329
 
338
- 61: {
330
+ 60: {
339
331
  file: "@apollo/client/link/http/parseAndCheckHttpResponse.js",
340
332
  condition: "response.body && typeof response.body.getReader === \"function\"",
341
333
  message: "Unknown type for `response.body`. Please use a `fetch` implementation that is WhatWG-compliant and that uses WhatWG ReadableStreams for `body`."
342
334
  },
343
335
 
344
- 62: {
336
+ 61: {
345
337
  file: "@apollo/client/link/http/serializeFetchParameter.js",
346
338
  message: `Network request failed. %s is not serializable: %s`
347
339
  },
348
340
 
349
- 64: {
341
+ 63: {
350
342
  file: "@apollo/client/link/core/ApolloLink.js",
351
343
  message: "request is not implemented"
352
344
  },
353
345
 
354
- 65: {
346
+ 64: {
355
347
  file: "@apollo/client/incremental/handlers/notImplemented.js",
356
348
  condition: "!hasDirectives([\"defer\"], request.query)",
357
349
  message: "`@defer` is not supported without specifying an incremental handler. Please pass a handler as the `incrementalHandler` option to the `ApolloClient` constructor."
358
350
  },
359
351
 
360
- 66: {
352
+ 65: {
361
353
  file: "@apollo/client/core/ApolloClient.js",
362
354
  condition: "options.cache",
363
355
 
@@ -366,7 +358,7 @@ const client = new ApolloClient({
366
358
  "For more information, please visit: https://go.apollo.dev/c/docs"
367
359
  },
368
360
 
369
- 67: {
361
+ 66: {
370
362
  file: "@apollo/client/core/ApolloClient.js",
371
363
  condition: "options.link",
372
364
 
@@ -375,7 +367,7 @@ const client = new ApolloClient({
375
367
  "For more information, please visit: https://go.apollo.dev/c/docs"
376
368
  },
377
369
 
378
- 68: {
370
+ 67: {
379
371
  file: "@apollo/client/core/ApolloClient.js",
380
372
  condition: "options.fetchPolicy !== \"cache-and-network\"",
381
373
 
@@ -385,7 +377,7 @@ const client = new ApolloClient({
385
377
  "using a different fetchPolicy, such as cache-first or network-only."
386
378
  },
387
379
 
388
- 69: {
380
+ 68: {
389
381
  file: "@apollo/client/core/ApolloClient.js",
390
382
  condition: "options.fetchPolicy !== \"standby\"",
391
383
 
@@ -394,7 +386,7 @@ const client = new ApolloClient({
394
386
  "as cache-first or network-only."
395
387
  },
396
388
 
397
- 70: {
389
+ 69: {
398
390
  file: "@apollo/client/core/ApolloClient.js",
399
391
  condition: "options.query",
400
392
 
@@ -402,158 +394,158 @@ const client = new ApolloClient({
402
394
  "in the query option."
403
395
  },
404
396
 
405
- 71: {
397
+ 70: {
406
398
  file: "@apollo/client/core/ApolloClient.js",
407
399
  condition: "options.query.kind === \"Document\"",
408
400
  message: 'You must wrap the query string in a "gql" tag.'
409
401
  },
410
402
 
411
- 72: {
403
+ 71: {
412
404
  file: "@apollo/client/core/ApolloClient.js",
413
405
  condition: "!options.returnPartialData",
414
406
  message: "returnPartialData option only supported on watchQuery."
415
407
  },
416
408
 
417
- 73: {
409
+ 72: {
418
410
  file: "@apollo/client/core/ApolloClient.js",
419
411
  condition: "!options.pollInterval",
420
412
  message: "pollInterval option only supported on watchQuery."
421
413
  },
422
414
 
423
- 74: {
415
+ 73: {
424
416
  file: "@apollo/client/core/ApolloClient.js",
425
417
  condition: "!options.notifyOnNetworkStatusChange",
426
418
  message: "notifyOnNetworkStatusChange option only supported on watchQuery."
427
419
  },
428
420
 
429
- 75: {
421
+ 74: {
430
422
  file: "@apollo/client/core/ApolloClient.js",
431
423
  condition: "optionsWithDefaults.mutation",
432
424
  message: "The `mutation` option is required. Please provide a GraphQL document in the `mutation` option."
433
425
  },
434
426
 
435
- 76: {
427
+ 75: {
436
428
  file: "@apollo/client/core/ApolloClient.js",
437
429
  condition: "optionsWithDefaults.fetchPolicy === \"network-only\" ||\n optionsWithDefaults.fetchPolicy === \"no-cache\"",
438
430
  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."
439
431
  },
440
432
 
441
- 79: {
433
+ 78: {
442
434
  file: "@apollo/client/core/ObservableQuery.js",
443
435
  condition: "this.options.fetchPolicy !== \"cache-only\"",
444
436
  message: "Cannot execute `fetchMore` for 'cache-only' query '%s'. Please use a different fetch policy."
445
437
  },
446
438
 
447
- 80: {
439
+ 79: {
448
440
  file: "@apollo/client/core/ObservableQuery.js",
449
441
  condition: "updateQuery",
450
442
  message: "You must provide an `updateQuery` function when using `fetchMore` with a `no-cache` fetch policy."
451
443
  },
452
444
 
453
- 84: {
445
+ 83: {
454
446
  file: "@apollo/client/core/QueryManager.js",
455
447
  message: "QueryManager stopped while query was in flight"
456
448
  },
457
449
 
458
- 85: {
450
+ 84: {
459
451
  file: "@apollo/client/core/QueryManager.js",
460
452
  condition: "this.localState",
461
453
  message: "Mutation '%s' contains `@client` fields with variables provided by `@export` but local state has not been configured."
462
454
  },
463
455
 
464
- 86: {
456
+ 85: {
465
457
  file: "@apollo/client/core/QueryManager.js",
466
458
  message: "Store reset while query was in flight (not completed in link chain)"
467
459
  },
468
460
 
469
- 89: {
461
+ 88: {
470
462
  file: "@apollo/client/core/QueryManager.js",
471
463
  condition: "!this.getDocumentInfo(query).hasClientExports || this.localState",
472
464
  message: "Subscription '%s' contains `@client` fields with variables provided by `@export` but local state has not been configured."
473
465
  },
474
466
 
475
- 90: {
467
+ 89: {
476
468
  file: "@apollo/client/core/QueryManager.js",
477
469
  condition: "this.localState",
478
470
  message: "%s '%s' contains `@client` fields but local state has not been configured."
479
471
  },
480
472
 
481
- 91: {
473
+ 90: {
482
474
  file: "@apollo/client/core/QueryManager.js",
483
475
  condition: "!hasIncrementalDirective",
484
476
  message: "%s '%s' contains `@client` and `@defer` directives. These cannot be used together."
485
477
  },
486
478
 
487
- 92: {
479
+ 91: {
488
480
  file: "@apollo/client/core/QueryManager.js",
489
481
  condition: "this.localState",
490
482
  message: "Query '%s' contains `@client` fields with variables provided by `@export` but local state has not been configured."
491
483
  },
492
484
 
493
- 94: {
485
+ 93: {
494
486
  file: "@apollo/client/core/QueryManager.js",
495
487
  condition: "this.localState",
496
488
  message: "Query '%s' contains `@client` fields but local state has not been configured."
497
489
  },
498
490
 
499
- 95: {
491
+ 94: {
500
492
  file: "@apollo/client/core/QueryManager.js",
501
493
  condition: "didEmitValue",
502
494
  message: "The link chain completed without emitting a value. This is likely unintentional and should be updated to emit a value before completing."
503
495
  },
504
496
 
505
- 96: {
497
+ 95: {
506
498
  file: "@apollo/client/cache/inmemory/entityStore.js",
507
499
  condition: "typeof dataId === \"string\"",
508
500
  message: "store.merge expects a string ID"
509
501
  },
510
502
 
511
- 99: {
503
+ 98: {
512
504
  file: "@apollo/client/cache/inmemory/key-extractor.js",
513
505
  condition: "extracted !== void 0",
514
506
  message: `Missing field '%s' while extracting keyFields from %s`
515
507
  },
516
508
 
517
- 100: {
509
+ 99: {
518
510
  file: "@apollo/client/cache/inmemory/policies.js",
519
511
  condition: "!old || old === which",
520
512
  message: `Cannot change root %s __typename more than once`
521
513
  },
522
514
 
523
- 103: {
515
+ 102: {
524
516
  file: "@apollo/client/cache/inmemory/policies.js",
525
517
  message: "Cannot automatically merge arrays"
526
518
  },
527
519
 
528
- 104: {
520
+ 103: {
529
521
  file: "@apollo/client/cache/inmemory/readFromStore.js",
530
522
  message: `No fragment named %s`
531
523
  },
532
524
 
533
- 105: {
525
+ 104: {
534
526
  file: "@apollo/client/cache/inmemory/readFromStore.js",
535
527
  condition: "!isReference(value)",
536
528
  message: `Missing selection set for object of type %s returned for query field %s`
537
529
  },
538
530
 
539
- 106: {
531
+ 105: {
540
532
  file: "@apollo/client/cache/inmemory/writeToStore.js",
541
533
  message: `Could not identify object %s`
542
534
  },
543
535
 
544
- 108: {
536
+ 107: {
545
537
  file: "@apollo/client/cache/inmemory/writeToStore.js",
546
538
  message: `No fragment named %s`
547
539
  }
548
540
  };
549
541
 
550
542
  export const devDebug = {
551
- 77: {
543
+ 76: {
552
544
  file: "@apollo/client/core/ApolloClient.js",
553
545
  message: `In client.refetchQueries, Promise.all promise rejected with error %o`
554
546
  },
555
547
 
556
- 83: {
548
+ 82: {
557
549
  file: "@apollo/client/core/ObservableQuery.js",
558
550
  message: `Missing cache result fields: %o`
559
551
  }
@@ -567,74 +559,74 @@ export const devWarn = {
567
559
  message: "Using `returnPartialData` with a `no-cache` fetch policy has no effect. To read partial data from the cache, consider using an alternate fetch policy."
568
560
  },
569
561
 
570
- 41: {
562
+ 40: {
571
563
  file: "@apollo/client/masking/maskDefinition.js",
572
564
  message: "Accessing unmasked field on %s at path '%s'. This field will not be available when masking is enabled. Please read the field from the fragment instead."
573
565
  },
574
566
 
575
- 45: {
567
+ 44: {
576
568
  file: "@apollo/client/masking/utils.js",
577
569
  message: "@unmask 'mode' argument does not support variables."
578
570
  },
579
571
 
580
- 46: {
572
+ 45: {
581
573
  file: "@apollo/client/masking/utils.js",
582
574
  message: "@unmask 'mode' argument must be of type string."
583
575
  },
584
576
 
585
- 47: {
577
+ 46: {
586
578
  file: "@apollo/client/masking/utils.js",
587
579
  message: "@unmask 'mode' argument does not recognize value '%s'."
588
580
  },
589
581
 
590
- 51: {
582
+ 50: {
591
583
  file: "@apollo/client/local-state/LocalState.js",
592
584
  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."
593
585
  },
594
586
 
595
- 52: {
587
+ 51: {
596
588
  file: "@apollo/client/local-state/LocalState.js",
597
589
  message: "The '%s' field had no cached value and only forced resolvers were run. The value was set to `null`."
598
590
  },
599
591
 
600
- 53: {
592
+ 52: {
601
593
  file: "@apollo/client/local-state/LocalState.js",
602
594
  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."
603
595
  },
604
596
 
605
- 63: {
597
+ 62: {
606
598
  file: "@apollo/client/link/core/ApolloLink.js",
607
599
  message: `You are calling concat on a terminating link, which will have no effect %o`
608
600
  },
609
601
 
610
- 78: {
602
+ 77: {
611
603
  file: "@apollo/client/core/ObservableQuery.js",
612
604
 
613
605
  message: `Called refetch(%o) for query %o, which does not declare a $variables variable.
614
606
  Did you mean to call refetch(variables) instead of refetch({ variables })?`
615
607
  },
616
608
 
617
- 82: {
609
+ 81: {
618
610
  file: "@apollo/client/core/ObservableQuery.js",
619
611
  message: "Cannot poll on 'cache-only' query '%s' and as such, polling is disabled. Please use a different fetch policy."
620
612
  },
621
613
 
622
- 87: {
614
+ 86: {
623
615
  file: "@apollo/client/core/QueryManager.js",
624
616
  message: `Unknown query named "%s" requested in refetchQueries options.include array`
625
617
  },
626
618
 
627
- 88: {
619
+ 87: {
628
620
  file: "@apollo/client/core/QueryManager.js",
629
621
  message: `Unknown anonymous query requested in refetchQueries options.include array`
630
622
  },
631
623
 
632
- 93: {
624
+ 92: {
633
625
  file: "@apollo/client/core/QueryManager.js",
634
626
  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.'
635
627
  },
636
628
 
637
- 97: {
629
+ 96: {
638
630
  file: "@apollo/client/cache/inmemory/entityStore.js",
639
631
 
640
632
  message: "cache.modify: You are trying to write a Reference that is not part of the store: %o\n" +
@@ -642,24 +634,24 @@ Did you mean to call refetch(variables) instead of refetch({ variables })?`
642
634
  "`toReference(object, true)`"
643
635
  },
644
636
 
645
- 98: {
637
+ 97: {
646
638
  file: "@apollo/client/cache/inmemory/entityStore.js",
647
639
 
648
640
  message: "cache.modify: Writing an array with a mix of both References and Objects will not result in the Objects being normalized correctly.\n" +
649
641
  "Please convert the object instance %o to a Reference before writing it to the cache by calling `toReference(object, true)`."
650
642
  },
651
643
 
652
- 101: {
644
+ 100: {
653
645
  file: "@apollo/client/cache/inmemory/policies.js",
654
646
  message: `Inferring subtype %s of supertype %s`
655
647
  },
656
648
 
657
- 102: {
649
+ 101: {
658
650
  file: "@apollo/client/cache/inmemory/policies.js",
659
651
  message: `Undefined 'from' passed to readField with arguments %s`
660
652
  },
661
653
 
662
- 109: {
654
+ 108: {
663
655
  file: "@apollo/client/cache/inmemory/writeToStore.js",
664
656
 
665
657
  message: `Cache data may be lost when replacing the %s field of a %s object.
@@ -678,7 +670,7 @@ For more information about these options, please refer to the documentation:
678
670
  `
679
671
  },
680
672
 
681
- 110: {
673
+ 109: {
682
674
  file: "@apollo/client/cache/core/cache.js",
683
675
  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."
684
676
  }
@@ -695,12 +687,12 @@ export const devError = {
695
687
  message: "The result of getSnapshot should be cached to avoid an infinite loop"
696
688
  },
697
689
 
698
- 81: {
690
+ 80: {
699
691
  file: "@apollo/client/core/ObservableQuery.js",
700
692
  message: "Unhandled GraphQL subscription error"
701
693
  },
702
694
 
703
- 107: {
695
+ 106: {
704
696
  file: "@apollo/client/cache/inmemory/writeToStore.js",
705
697
  message: `Missing field '%s' while writing result %o`
706
698
  }
@@ -1 +1 @@
1
- {"version":3,"file":"batchLink.js","sourceRoot":"","sources":["../../../src/link/batch/batchLink.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAGjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAEjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAqCjD,MAAM,OAAO,SAAU,SAAQ,UAAU;IAC/B,OAAO,CAAmB;IAElC,YAAY,WAA+B;QACzC,KAAK,EAAE,CAAC;QAER,MAAM,EACJ,aAAa,EACb,aAAa,GAAG,EAAE,EAClB,QAAQ,GAAG,CAAC,EACZ,YAAY,GAAG,GAAG,EAAE,CAAC,IAAI,EACzB,QAAQ,GAAG,GAAG,EAAE,CAAC,EAAE,GACpB,GAAG,WAAW,IAAI,EAAE,CAAC;QAEtB,IAAI,CAAC,OAAO,GAAG,IAAI,gBAAgB,CAAC;YAClC,aAAa;YACb,aAAa;YACb,QAAQ;YACR,YAAY;YACZ,QAAQ;SACT,CAAC,CAAC;QAEH,4BAA4B;QAC5B,IAAI,WAAY,CAAC,YAAa,CAAC,MAAM,IAAI,CAAC,EAAE,CAAC;YAC3C,IAAI,CAAC,OAAO,GAAG,CAAC,SAAS,EAAE,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,cAAc,CAAC,EAAE,SAAS,EAAE,CAAC,CAAC;QAC3E,CAAC;IACH,CAAC;IAEM,OAAO,CACZ,SAAoB,EACpB,OAAkB;QAElB,OAAO,IAAI,CAAC,OAAO,CAAC,cAAc,CAAC;YACjC,SAAS;YACT,OAAO;SACR,CAAC,CAAC;IACL,CAAC;CACF","sourcesContent":["import type { Observable } from \"rxjs\";\n\nimport type { FetchResult, NextLink, Operation } from \"@apollo/client/link\";\nimport { ApolloLink } from \"@apollo/client/link\";\n\nimport type { BatchHandler } from \"./batching.js\";\nimport { OperationBatcher } from \"./batching.js\";\nexport type { BatchableRequest, BatchHandler } from \"./batching.js\";\nexport { OperationBatcher } from \"./batching.js\";\n\nexport namespace BatchLink {\n export interface Options {\n /**\n * The interval at which to batch, in milliseconds.\n *\n * Defaults to 10.\n */\n batchInterval?: number;\n\n /**\n * \"batchInterval\" is a throttling behavior by default, if you instead wish\n * to debounce outbound requests, set \"batchDebounce\" to true. More useful\n * for mutations than queries.\n */\n batchDebounce?: boolean;\n\n /**\n * The maximum number of operations to include in one fetch.\n *\n * Defaults to 0 (infinite operations within the interval).\n */\n batchMax?: number;\n\n /**\n * The handler that should execute a batch of operations.\n */\n batchHandler?: BatchHandler;\n\n /**\n * creates the key for a batch\n */\n batchKey?: (operation: Operation) => string;\n }\n}\n\nexport class BatchLink extends ApolloLink {\n private batcher: OperationBatcher;\n\n constructor(fetchParams?: BatchLink.Options) {\n super();\n\n const {\n batchDebounce,\n batchInterval = 10,\n batchMax = 0,\n batchHandler = () => null,\n batchKey = () => \"\",\n } = fetchParams || {};\n\n this.batcher = new OperationBatcher({\n batchDebounce,\n batchInterval,\n batchMax,\n batchHandler,\n batchKey,\n });\n\n //make this link terminating\n if (fetchParams!.batchHandler!.length <= 1) {\n this.request = (operation) => this.batcher.enqueueRequest({ operation });\n }\n }\n\n public request(\n operation: Operation,\n forward?: NextLink\n ): Observable<FetchResult> | null {\n return this.batcher.enqueueRequest({\n operation,\n forward,\n });\n }\n}\n"]}
1
+ {"version":3,"file":"batchLink.js","sourceRoot":"","sources":["../../../src/link/batch/batchLink.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAGjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAEjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAqCjD,MAAM,OAAO,SAAU,SAAQ,UAAU;IAC/B,OAAO,CAAmB;IAElC,YAAY,WAA+B;QACzC,KAAK,EAAE,CAAC;QAER,MAAM,EACJ,aAAa,EACb,aAAa,GAAG,EAAE,EAClB,QAAQ,GAAG,CAAC,EACZ,YAAY,GAAG,GAAG,EAAE,CAAC,IAAI,EACzB,QAAQ,GAAG,GAAG,EAAE,CAAC,EAAE,GACpB,GAAG,WAAW,IAAI,EAAE,CAAC;QAEtB,IAAI,CAAC,OAAO,GAAG,IAAI,gBAAgB,CAAC;YAClC,aAAa;YACb,aAAa;YACb,QAAQ;YACR,YAAY;YACZ,QAAQ;SACT,CAAC,CAAC;QAEH,4BAA4B;QAC5B,IAAI,WAAY,CAAC,YAAa,CAAC,MAAM,IAAI,CAAC,EAAE,CAAC;YAC3C,IAAI,CAAC,OAAO,GAAG,CAAC,SAAS,EAAE,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,cAAc,CAAC,EAAE,SAAS,EAAE,CAAC,CAAC;QAC3E,CAAC;IACH,CAAC;IAEM,OAAO,CACZ,SAAoB,EACpB,OAAkB;QAElB,OAAO,IAAI,CAAC,OAAO,CAAC,cAAc,CAAC;YACjC,SAAS;YACT,OAAO;SACR,CAAC,CAAC;IACL,CAAC;CACF","sourcesContent":["import type { Observable } from \"rxjs\";\n\nimport type { FetchResult, NextLink, Operation } from \"@apollo/client/link\";\nimport { ApolloLink } from \"@apollo/client/link\";\n\nimport type { BatchHandler } from \"./batching.js\";\nimport { OperationBatcher } from \"./batching.js\";\nexport type { BatchableRequest, BatchHandler } from \"./batching.js\";\nexport { OperationBatcher } from \"./batching.js\";\n\nexport declare namespace BatchLink {\n export interface Options {\n /**\n * The interval at which to batch, in milliseconds.\n *\n * Defaults to 10.\n */\n batchInterval?: number;\n\n /**\n * \"batchInterval\" is a throttling behavior by default, if you instead wish\n * to debounce outbound requests, set \"batchDebounce\" to true. More useful\n * for mutations than queries.\n */\n batchDebounce?: boolean;\n\n /**\n * The maximum number of operations to include in one fetch.\n *\n * Defaults to 0 (infinite operations within the interval).\n */\n batchMax?: number;\n\n /**\n * The handler that should execute a batch of operations.\n */\n batchHandler?: BatchHandler;\n\n /**\n * creates the key for a batch\n */\n batchKey?: (operation: Operation) => string;\n }\n}\n\nexport class BatchLink extends ApolloLink {\n private batcher: OperationBatcher;\n\n constructor(fetchParams?: BatchLink.Options) {\n super();\n\n const {\n batchDebounce,\n batchInterval = 10,\n batchMax = 0,\n batchHandler = () => null,\n batchKey = () => \"\",\n } = fetchParams || {};\n\n this.batcher = new OperationBatcher({\n batchDebounce,\n batchInterval,\n batchMax,\n batchHandler,\n batchKey,\n });\n\n //make this link terminating\n if (fetchParams!.batchHandler!.length <= 1) {\n this.request = (operation) => this.batcher.enqueueRequest({ operation });\n }\n }\n\n public request(\n operation: Operation,\n forward?: NextLink\n ): Observable<FetchResult> | null {\n return this.batcher.enqueueRequest({\n operation,\n forward,\n });\n }\n}\n"]}
@@ -3,10 +3,10 @@ import { ApolloLink } from "@apollo/client/link";
3
3
  import { BatchLink } from "@apollo/client/link/batch";
4
4
  import { ClientAwarenessLink } from "@apollo/client/link/client-awareness";
5
5
  import { checkFetcher, defaultPrinter, fallbackHttpConfig, parseAndCheckHttpResponse, selectHttpOptionsAndBodyInternal, selectURI, serializeFetchParameter, } from "@apollo/client/link/http";
6
+ import { filterOperationVariables } from "@apollo/client/link/utils";
6
7
  import { __DEV__ } from "@apollo/client/utilities/environment";
7
8
  import { compact } from "@apollo/client/utilities/internal";
8
9
  import { maybe } from "@apollo/client/utilities/internal/globals";
9
- import { filterOperationVariables } from "../utils/filterOperationVariables.js";
10
10
  const backupFetch = maybe(() => fetch);
11
11
  /**
12
12
  * Transforms Operation for into HTTP results.
@@ -1 +1 @@
1
- {"version":3,"file":"batchHttpLink.js","sourceRoot":"","sources":["../../../src/link/batch-http/batchHttpLink.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAG9C,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEjD,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AACtD,OAAO,EAAE,mBAAmB,EAAE,MAAM,sCAAsC,CAAC;AAE3E,OAAO,EACL,YAAY,EACZ,cAAc,EACd,kBAAkB,EAClB,yBAAyB,EACzB,gCAAgC,EAChC,SAAS,EACT,uBAAuB,GACxB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,OAAO,EAAE,MAAM,sCAAsC,CAAC;AAC/D,OAAO,EAAE,OAAO,EAAE,MAAM,mCAAmC,CAAC;AAC5D,OAAO,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zC,CAAC;CACF","sourcesContent":["import { Observable, throwError } from \"rxjs\";\n\nimport type { FetchResult, Operation } from \"@apollo/client/link\";\nimport { ApolloLink } from \"@apollo/client/link\";\nimport type { BatchHandler } from \"@apollo/client/link/batch\";\nimport { BatchLink } from \"@apollo/client/link/batch\";\nimport { ClientAwarenessLink } from \"@apollo/client/link/client-awareness\";\nimport type { HttpLink } from \"@apollo/client/link/http\";\nimport {\n checkFetcher,\n defaultPrinter,\n fallbackHttpConfig,\n parseAndCheckHttpResponse,\n selectHttpOptionsAndBodyInternal,\n selectURI,\n serializeFetchParameter,\n} from \"@apollo/client/link/http\";\nimport { __DEV__ } from \"@apollo/client/utilities/environment\";\nimport { compact } from \"@apollo/client/utilities/internal\";\nimport { maybe } from \"@apollo/client/utilities/internal/globals\";\n\nimport { filterOperationVariables } from \"../utils/filterOperationVariables.js\";\n\nexport namespace BatchHttpLink {\n export type Options = Pick<\n BatchLink.Options,\n \"batchMax\" | \"batchDebounce\" | \"batchInterval\" | \"batchKey\"\n > &\n Omit<HttpLink.Options, \"useGETForQueries\">;\n\n export type ContextOptions = HttpLink.ContextOptions;\n}\n\nconst backupFetch = maybe(() => fetch);\n\n/**\n * Transforms Operation for into HTTP results.\n * context can include the headers property, which will be passed to the fetch function\n */\nexport class BatchHttpLink extends ApolloLink {\n constructor(\n options: BatchHttpLink.Options & ClientAwarenessLink.Options = {}\n ) {\n const { left, right, request } = ApolloLink.concat(\n new ClientAwarenessLink(options),\n new BaseBatchHttpLink(options)\n );\n super(request);\n Object.assign(this, { left, right });\n }\n}\nexport class BaseBatchHttpLink extends ApolloLink {\n private batchDebounce?: boolean;\n private batchInterval: number;\n private batchMax: number;\n private batcher: ApolloLink;\n\n constructor(fetchParams?: BatchHttpLink.Options) {\n super();\n\n let {\n uri = \"/graphql\",\n // use default global fetch if nothing is passed in\n fetch: preferredFetch,\n print = defaultPrinter,\n includeExtensions,\n preserveHeaderCase,\n batchInterval,\n batchDebounce,\n batchMax,\n batchKey,\n includeUnusedVariables = false,\n ...requestOptions\n } = fetchParams || ({} as BatchHttpLink.Options);\n\n if (__DEV__) {\n // Make sure at least one of preferredFetch, window.fetch, or backupFetch\n // is defined, so requests won't fail at runtime.\n checkFetcher(preferredFetch || backupFetch);\n }\n\n const linkConfig = {\n http: compact({ includeExtensions, preserveHeaderCase }),\n options: requestOptions.fetchOptions,\n credentials: requestOptions.credentials,\n headers: requestOptions.headers,\n };\n\n this.batchDebounce = batchDebounce;\n this.batchInterval = batchInterval || 10;\n this.batchMax = batchMax || 10;\n\n const batchHandler: BatchHandler = (operations) => {\n const chosenURI = selectURI(operations[0], uri);\n\n const context = operations[0].getContext();\n\n const contextConfig = {\n http: context.http,\n options: context.fetchOptions,\n credentials: context.credentials,\n headers: context.headers,\n };\n\n //uses fallback, link, and then context to build options\n const optsAndBody = operations.map((operation) => {\n const result = selectHttpOptionsAndBodyInternal(\n operation,\n print,\n fallbackHttpConfig,\n linkConfig,\n contextConfig\n );\n\n if (result.body.variables && !includeUnusedVariables) {\n result.body.variables = filterOperationVariables(\n result.body.variables,\n operation.query\n );\n }\n\n return result;\n });\n\n const loadedBody = optsAndBody.map(({ body }) => body);\n const options = optsAndBody[0].options;\n\n // There's no spec for using GET with batches.\n if (options.method === \"GET\") {\n return throwError(\n () =>\n new Error(\"apollo-link-batch-http does not support GET requests\")\n );\n }\n\n try {\n (options as any).body = serializeFetchParameter(loadedBody, \"Payload\");\n } catch (parseError) {\n return throwError(() => parseError);\n }\n\n let controller: AbortController | undefined;\n if (!options.signal && typeof AbortController !== \"undefined\") {\n controller = new AbortController();\n options.signal = controller.signal;\n }\n\n return new Observable((observer) => {\n // Prefer BatchHttpLink.Options.fetch (preferredFetch) if provided, and\n // otherwise fall back to the *current* global window.fetch function\n // (see issue #7832), or (if all else fails) the backupFetch function we\n // saved when this module was first evaluated. This last option protects\n // against the removal of window.fetch, which is unlikely but not\n // impossible.\n const currentFetch =\n preferredFetch || maybe(() => fetch) || backupFetch;\n\n currentFetch!(chosenURI, options)\n .then((response) => {\n // Make the raw response available in the context.\n operations.forEach((operation) =>\n operation.setContext({ response })\n );\n return response;\n })\n .then(parseAndCheckHttpResponse(operations))\n .then((result) => {\n controller = undefined;\n // we have data and can send it to back up the link chain\n observer.next(result);\n observer.complete();\n return result;\n })\n .catch((err) => {\n controller = undefined;\n observer.error(err);\n });\n\n return () => {\n // XXX support canceling this request\n // https://developers.google.com/web/updates/2017/09/abortable-fetch\n if (controller) controller.abort();\n };\n });\n };\n\n batchKey =\n batchKey ||\n ((operation: Operation) => {\n const context = operation.getContext();\n\n const contextConfig = {\n http: context.http,\n options: context.fetchOptions,\n credentials: context.credentials,\n headers: context.headers,\n };\n\n //may throw error if config not serializable\n return selectURI(operation, uri) + JSON.stringify(contextConfig);\n });\n\n this.batcher = new BatchLink({\n batchDebounce: this.batchDebounce,\n batchInterval: this.batchInterval,\n batchMax: this.batchMax,\n batchKey,\n batchHandler,\n });\n }\n\n public request(operation: Operation): Observable<FetchResult> | null {\n return this.batcher.request(operation);\n }\n}\n"]}
1
+ {"version":3,"file":"batchHttpLink.js","sourceRoot":"","sources":["../../../src/link/batch-http/batchHttpLink.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAG9C,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEjD,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AACtD,OAAO,EAAE,mBAAmB,EAAE,MAAM,sCAAsC,CAAC;AAE3E,OAAO,EACL,YAAY,EACZ,cAAc,EACd,kBAAkB,EAClB,yBAAyB,EACzB,gCAAgC,EAChC,SAAS,EACT,uBAAuB,GACxB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,wBAAwB,EAAE,MAAM,2BAA2B,CAAC;AACrE,OAAO,EAAE,OAAO,EAAE,MAAM,sCAAsC,CAAC;AAC/D,OAAO,EAAE,OAAO,EAAE,MAAM,mCAAm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throwError } from \"rxjs\";\n\nimport type { FetchResult, Operation } from \"@apollo/client/link\";\nimport { ApolloLink } from \"@apollo/client/link\";\nimport type { BatchHandler } from \"@apollo/client/link/batch\";\nimport { BatchLink } from \"@apollo/client/link/batch\";\nimport { ClientAwarenessLink } from \"@apollo/client/link/client-awareness\";\nimport type { HttpLink } from \"@apollo/client/link/http\";\nimport {\n checkFetcher,\n defaultPrinter,\n fallbackHttpConfig,\n parseAndCheckHttpResponse,\n selectHttpOptionsAndBodyInternal,\n selectURI,\n serializeFetchParameter,\n} from \"@apollo/client/link/http\";\nimport { filterOperationVariables } from \"@apollo/client/link/utils\";\nimport { __DEV__ } from \"@apollo/client/utilities/environment\";\nimport { compact } from \"@apollo/client/utilities/internal\";\nimport { maybe } from \"@apollo/client/utilities/internal/globals\";\n\nexport declare namespace BatchHttpLink {\n export type Options = Pick<\n BatchLink.Options,\n \"batchMax\" | \"batchDebounce\" | \"batchInterval\" | \"batchKey\"\n > &\n Omit<HttpLink.Options, \"useGETForQueries\">;\n\n export type ContextOptions = HttpLink.ContextOptions;\n}\n\nconst backupFetch = maybe(() => fetch);\n\n/**\n * Transforms Operation for into HTTP results.\n * context can include the headers property, which will be passed to the fetch function\n */\nexport class BatchHttpLink extends ApolloLink {\n constructor(\n options: BatchHttpLink.Options & ClientAwarenessLink.Options = {}\n ) {\n const { left, right, request } = ApolloLink.concat(\n new ClientAwarenessLink(options),\n new BaseBatchHttpLink(options)\n );\n super(request);\n Object.assign(this, { left, right });\n }\n}\nexport class BaseBatchHttpLink extends ApolloLink {\n private batchDebounce?: boolean;\n private batchInterval: number;\n private batchMax: number;\n private batcher: ApolloLink;\n\n constructor(fetchParams?: BatchHttpLink.Options) {\n super();\n\n let {\n uri = \"/graphql\",\n // use default global fetch if nothing is passed in\n fetch: preferredFetch,\n print = defaultPrinter,\n includeExtensions,\n preserveHeaderCase,\n batchInterval,\n batchDebounce,\n batchMax,\n batchKey,\n includeUnusedVariables = false,\n ...requestOptions\n } = fetchParams || ({} as BatchHttpLink.Options);\n\n if (__DEV__) {\n // Make sure at least one of preferredFetch, window.fetch, or backupFetch\n // is defined, so requests won't fail at runtime.\n checkFetcher(preferredFetch || backupFetch);\n }\n\n const linkConfig = {\n http: compact({ includeExtensions, preserveHeaderCase }),\n options: requestOptions.fetchOptions,\n credentials: requestOptions.credentials,\n headers: requestOptions.headers,\n };\n\n this.batchDebounce = batchDebounce;\n this.batchInterval = batchInterval || 10;\n this.batchMax = batchMax || 10;\n\n const batchHandler: BatchHandler = (operations) => {\n const chosenURI = selectURI(operations[0], uri);\n\n const context = operations[0].getContext();\n\n const contextConfig = {\n http: context.http,\n options: context.fetchOptions,\n credentials: context.credentials,\n headers: context.headers,\n };\n\n //uses fallback, link, and then context to build options\n const optsAndBody = operations.map((operation) => {\n const result = selectHttpOptionsAndBodyInternal(\n operation,\n print,\n fallbackHttpConfig,\n linkConfig,\n contextConfig\n );\n\n if (result.body.variables && !includeUnusedVariables) {\n result.body.variables = filterOperationVariables(\n result.body.variables,\n operation.query\n );\n }\n\n return result;\n });\n\n const loadedBody = optsAndBody.map(({ body }) => body);\n const options = optsAndBody[0].options;\n\n // There's no spec for using GET with batches.\n if (options.method === \"GET\") {\n return throwError(\n () =>\n new Error(\"apollo-link-batch-http does not support GET requests\")\n );\n }\n\n try {\n (options as any).body = serializeFetchParameter(loadedBody, \"Payload\");\n } catch (parseError) {\n return throwError(() => parseError);\n }\n\n let controller: AbortController | undefined;\n if (!options.signal && typeof AbortController !== \"undefined\") {\n controller = new AbortController();\n options.signal = controller.signal;\n }\n\n return new Observable((observer) => {\n // Prefer BatchHttpLink.Options.fetch (preferredFetch) if provided, and\n // otherwise fall back to the *current* global window.fetch function\n // (see issue #7832), or (if all else fails) the backupFetch function we\n // saved when this module was first evaluated. This last option protects\n // against the removal of window.fetch, which is unlikely but not\n // impossible.\n const currentFetch =\n preferredFetch || maybe(() => fetch) || backupFetch;\n\n currentFetch!(chosenURI, options)\n .then((response) => {\n // Make the raw response available in the context.\n operations.forEach((operation) =>\n operation.setContext({ response })\n );\n return response;\n })\n .then(parseAndCheckHttpResponse(operations))\n .then((result) => {\n controller = undefined;\n // we have data and can send it to back up the link chain\n observer.next(result);\n observer.complete();\n return result;\n })\n .catch((err) => {\n controller = undefined;\n observer.error(err);\n });\n\n return () => {\n // XXX support canceling this request\n // https://developers.google.com/web/updates/2017/09/abortable-fetch\n if (controller) controller.abort();\n };\n });\n };\n\n batchKey =\n batchKey ||\n ((operation: Operation) => {\n const context = operation.getContext();\n\n const contextConfig = {\n http: context.http,\n options: context.fetchOptions,\n credentials: context.credentials,\n headers: context.headers,\n };\n\n //may throw error if config not serializable\n return selectURI(operation, uri) + JSON.stringify(contextConfig);\n });\n\n this.batcher = new BatchLink({\n batchDebounce: this.batchDebounce,\n batchInterval: this.batchInterval,\n batchMax: this.batchMax,\n batchKey,\n batchHandler,\n });\n }\n\n public request(operation: Operation): Observable<FetchResult> | null {\n return this.batcher.request(operation);\n }\n}\n"]}
@@ -21,8 +21,8 @@ export declare namespace ClientAwarenessLink {
21
21
  * If `name` and `version` are not provided, this option will be ignored.
22
22
  * (These options can either be set as part of the Apollo Client constructor call or when manually constructing a `HttpLink`, `BatchHttpLink` or `ClientAwarenessLink`.)
23
23
  *
24
- * * If set to `"headers"`, `name` and `version` will be sent in the request headers as `apollographql-client-name` and `apollographql-client-version`, respectively.
25
- * * If set to `false`, `name` and `version` will not be included in outgoing requests.
24
+ * - If set to `"headers"`, `name` and `version` will be sent in the request headers as `apollographql-client-name` and `apollographql-client-version`, respectively.
25
+ * - If set to `false`, `name` and `version` will not be included in outgoing requests.
26
26
  *
27
27
  * @defaultValue "headers"
28
28
  */
@@ -32,8 +32,8 @@ export declare namespace ClientAwarenessLink {
32
32
  /**
33
33
  * Determines how the the version information of Apollo Client is sent in outgoing requests.
34
34
  *
35
- * * If set to `"extensions"`, library `name` and `version` will be sent in an object in the request extensions as `clientLibrary`.
36
- * * If set to `false`, library name and version will not be included in outgoing requests.
35
+ * - If set to `"extensions"`, library `name` and `version` will be sent in an object in the request extensions as `clientLibrary`.
36
+ * - If set to `false`, library name and version will not be included in outgoing requests.
37
37
  *
38
38
  * @defaultValue "extensions"
39
39
  */