@apollo/client 3.8.7 → 3.8.9

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 (614) hide show
  1. package/.changeset/README.md +8 -0
  2. package/.changeset/config.json +14 -0
  3. package/CHANGELOG.md +3369 -0
  4. package/apollo-client.cjs +356 -354
  5. package/apollo-client.cjs.map +1 -1
  6. package/apollo-client.min.cjs +1 -1
  7. package/cache/cache.cjs +133 -152
  8. package/cache/cache.cjs.map +1 -1
  9. package/cache/cache.cjs.native.js +133 -152
  10. package/cache/core/cache.d.ts +10 -0
  11. package/cache/core/cache.js +17 -5
  12. package/cache/core/cache.js.map +1 -1
  13. package/cache/core/types/Cache.d.ts +1 -1
  14. package/cache/core/types/Cache.js.map +1 -1
  15. package/cache/core/types/DataProxy.d.ts +92 -0
  16. package/cache/core/types/common.js +4 -1
  17. package/cache/core/types/common.js.map +1 -1
  18. package/cache/inmemory/entityStore.d.ts +1 -1
  19. package/cache/inmemory/entityStore.js +190 -29
  20. package/cache/inmemory/entityStore.js.map +1 -1
  21. package/cache/inmemory/fixPolyfills.js +9 -0
  22. package/cache/inmemory/fixPolyfills.js.map +1 -1
  23. package/cache/inmemory/fixPolyfills.native.js +12 -0
  24. package/cache/inmemory/fixPolyfills.native.js.map +1 -1
  25. package/cache/inmemory/fragmentRegistry.js +23 -12
  26. package/cache/inmemory/fragmentRegistry.js.map +1 -1
  27. package/cache/inmemory/helpers.js +20 -11
  28. package/cache/inmemory/helpers.js.map +1 -1
  29. package/cache/inmemory/inMemoryCache.js +161 -8
  30. package/cache/inmemory/inMemoryCache.js.map +1 -1
  31. package/cache/inmemory/key-extractor.js +72 -4
  32. package/cache/inmemory/key-extractor.js.map +1 -1
  33. package/cache/inmemory/object-canon.js +91 -3
  34. package/cache/inmemory/object-canon.js.map +1 -1
  35. package/cache/inmemory/policies.js +193 -43
  36. package/cache/inmemory/policies.js.map +1 -1
  37. package/cache/inmemory/reactiveVars.js +20 -2
  38. package/cache/inmemory/reactiveVars.js.map +1 -1
  39. package/cache/inmemory/readFromStore.d.ts +4 -0
  40. package/cache/inmemory/readFromStore.js +54 -9
  41. package/cache/inmemory/readFromStore.js.map +1 -1
  42. package/cache/inmemory/types.d.ts +28 -0
  43. package/cache/inmemory/types.js.map +1 -1
  44. package/cache/inmemory/writeToStore.js +152 -25
  45. package/cache/inmemory/writeToStore.js.map +1 -1
  46. package/config/jest/setup.js +2 -0
  47. package/config/jest/setup.js.map +1 -1
  48. package/core/ApolloClient.d.ts +264 -3
  49. package/core/ApolloClient.js +235 -7
  50. package/core/ApolloClient.js.map +1 -1
  51. package/core/LocalState.d.ts +4 -6
  52. package/core/LocalState.js +56 -18
  53. package/core/LocalState.js.map +1 -1
  54. package/core/ObservableQuery.d.ts +25 -0
  55. package/core/ObservableQuery.js +239 -30
  56. package/core/ObservableQuery.js.map +1 -1
  57. package/core/QueryInfo.d.ts +3 -3
  58. package/core/QueryInfo.js +116 -13
  59. package/core/QueryInfo.js.map +1 -1
  60. package/core/QueryManager.d.ts +4 -0
  61. package/core/QueryManager.js +229 -33
  62. package/core/QueryManager.js.map +1 -1
  63. package/core/core.cjs +112 -103
  64. package/core/core.cjs.map +1 -1
  65. package/core/core.cjs.native.js +112 -103
  66. package/core/equalByQuery.js +20 -1
  67. package/core/equalByQuery.js.map +1 -1
  68. package/core/index.d.ts +1 -1
  69. package/core/index.js +19 -0
  70. package/core/index.js.map +1 -1
  71. package/core/networkStatus.d.ts +39 -0
  72. package/core/networkStatus.js +39 -0
  73. package/core/networkStatus.js.map +1 -1
  74. package/core/types.d.ts +9 -0
  75. package/core/types.js.map +1 -1
  76. package/core/watchQueryOptions.d.ts +225 -1
  77. package/core/watchQueryOptions.js.map +1 -1
  78. package/dev/dev.cjs +5 -111
  79. package/dev/dev.cjs.map +1 -1
  80. package/dev/dev.cjs.native.js +5 -111
  81. package/dev/loadErrorMessageHandler.js.map +1 -1
  82. package/errors/errors.cjs +1 -1
  83. package/errors/errors.cjs.map +1 -1
  84. package/errors/errors.cjs.native.js +1 -1
  85. package/errors/index.js +14 -1
  86. package/errors/index.js.map +1 -1
  87. package/invariantErrorCodes.js +1 -0
  88. package/link/batch/batch.cjs +2 -2
  89. package/link/batch/batch.cjs.map +1 -1
  90. package/link/batch/batch.cjs.native.js +2 -2
  91. package/link/batch/batchLink.d.ts +21 -0
  92. package/link/batch/batchLink.js +2 -1
  93. package/link/batch/batchLink.js.map +1 -1
  94. package/link/batch/batching.js +24 -1
  95. package/link/batch/batching.js.map +1 -1
  96. package/link/batch-http/batch-http.cjs +3 -2
  97. package/link/batch-http/batch-http.cjs.map +1 -1
  98. package/link/batch-http/batch-http.cjs.native.js +3 -2
  99. package/link/batch-http/batchHttpLink.d.ts +4 -0
  100. package/link/batch-http/batchHttpLink.js +53 -2
  101. package/link/batch-http/batchHttpLink.js.map +1 -1
  102. package/link/context/context.cjs.map +1 -1
  103. package/link/context/index.js +1 -0
  104. package/link/context/index.js.map +1 -1
  105. package/link/core/ApolloLink.js +12 -5
  106. package/link/core/ApolloLink.js.map +1 -1
  107. package/link/core/core.cjs +5 -5
  108. package/link/core/core.cjs.map +1 -1
  109. package/link/core/core.cjs.native.js +5 -5
  110. package/link/error/error.cjs +1 -1
  111. package/link/error/error.cjs.map +1 -1
  112. package/link/error/error.cjs.native.js +1 -1
  113. package/link/error/index.d.ts +3 -0
  114. package/link/error/index.js +4 -1
  115. package/link/error/index.js.map +1 -1
  116. package/link/http/HttpLink.d.ts +0 -2
  117. package/link/http/HttpLink.js +1 -1
  118. package/link/http/HttpLink.js.map +1 -1
  119. package/link/http/checkFetcher.d.ts +1 -1
  120. package/link/http/checkFetcher.js.map +1 -1
  121. package/link/http/createHttpLink.js +23 -1
  122. package/link/http/createHttpLink.js.map +1 -1
  123. package/link/http/createSignalIfSupported.d.ts +5 -0
  124. package/link/http/createSignalIfSupported.js +5 -0
  125. package/link/http/createSignalIfSupported.js.map +1 -1
  126. package/link/http/http.cjs +14 -15
  127. package/link/http/http.cjs.map +1 -1
  128. package/link/http/http.cjs.native.js +14 -15
  129. package/link/http/index.js +2 -1
  130. package/link/http/index.js.map +1 -1
  131. package/link/http/iterators/async.d.ts +4 -0
  132. package/link/http/iterators/async.js +4 -0
  133. package/link/http/iterators/async.js.map +1 -1
  134. package/link/http/iterators/nodeStream.d.ts +4 -0
  135. package/link/http/iterators/nodeStream.js +4 -0
  136. package/link/http/iterators/nodeStream.js.map +1 -1
  137. package/link/http/iterators/promise.d.ts +4 -0
  138. package/link/http/iterators/promise.js +4 -0
  139. package/link/http/iterators/promise.js.map +1 -1
  140. package/link/http/iterators/reader.d.ts +4 -0
  141. package/link/http/iterators/reader.js +4 -0
  142. package/link/http/iterators/reader.js.map +1 -1
  143. package/link/http/parseAndCheckHttpResponse.js +50 -13
  144. package/link/http/parseAndCheckHttpResponse.js.map +1 -1
  145. package/link/http/responseIterator.d.ts +4 -0
  146. package/link/http/responseIterator.js +6 -0
  147. package/link/http/responseIterator.js.map +1 -1
  148. package/link/http/rewriteURIForGET.d.ts +1 -1
  149. package/link/http/rewriteURIForGET.js +10 -0
  150. package/link/http/rewriteURIForGET.js.map +1 -1
  151. package/link/http/selectHttpOptionsAndBody.d.ts +46 -1
  152. package/link/http/selectHttpOptionsAndBody.js +23 -0
  153. package/link/http/selectHttpOptionsAndBody.js.map +1 -1
  154. package/link/http/selectURI.js.map +1 -1
  155. package/link/http/serializeFetchParameter.js.map +1 -1
  156. package/link/persisted-queries/index.js +34 -4
  157. package/link/persisted-queries/index.js.map +1 -1
  158. package/link/persisted-queries/persisted-queries.cjs +4 -4
  159. package/link/persisted-queries/persisted-queries.cjs.map +1 -1
  160. package/link/persisted-queries/persisted-queries.cjs.native.js +4 -4
  161. package/link/remove-typename/remove-typename.cjs +12 -9
  162. package/link/remove-typename/remove-typename.cjs.map +1 -1
  163. package/link/remove-typename/remove-typename.cjs.native.js +12 -9
  164. package/link/remove-typename/removeTypenameFromVariables.js +12 -9
  165. package/link/remove-typename/removeTypenameFromVariables.js.map +1 -1
  166. package/link/retry/delayFunction.d.ts +29 -0
  167. package/link/retry/delayFunction.js +6 -0
  168. package/link/retry/delayFunction.js.map +1 -1
  169. package/link/retry/retry.cjs +5 -5
  170. package/link/retry/retry.cjs.map +1 -1
  171. package/link/retry/retry.cjs.native.js +5 -5
  172. package/link/retry/retryFunction.d.ts +20 -0
  173. package/link/retry/retryLink.d.ts +6 -0
  174. package/link/retry/retryLink.js +31 -6
  175. package/link/retry/retryLink.js.map +1 -1
  176. package/link/schema/index.d.ts +13 -0
  177. package/link/schema/index.js +3 -3
  178. package/link/schema/index.js.map +1 -1
  179. package/link/schema/schema.cjs +3 -3
  180. package/link/schema/schema.cjs.map +1 -1
  181. package/link/schema/schema.cjs.native.js +3 -3
  182. package/link/subscriptions/index.js +35 -2
  183. package/link/subscriptions/index.js.map +1 -1
  184. package/link/subscriptions/subscriptions.cjs +3 -2
  185. package/link/subscriptions/subscriptions.cjs.map +1 -1
  186. package/link/subscriptions/subscriptions.cjs.native.js +3 -2
  187. package/link/utils/createOperation.js.map +1 -1
  188. package/link/utils/filterOperationVariables.js +4 -0
  189. package/link/utils/filterOperationVariables.js.map +1 -1
  190. package/link/utils/toPromise.js.map +1 -1
  191. package/link/utils/transformOperation.js +3 -2
  192. package/link/utils/transformOperation.js.map +1 -1
  193. package/link/utils/utils.cjs +2 -2
  194. package/link/utils/utils.cjs.map +1 -1
  195. package/link/utils/utils.cjs.native.js +2 -2
  196. package/link/utils/validateOperation.js.map +1 -1
  197. package/link/ws/index.d.ts +12 -0
  198. package/link/ws/index.js +1 -1
  199. package/link/ws/index.js.map +1 -1
  200. package/link/ws/ws.cjs +1 -1
  201. package/link/ws/ws.cjs.map +1 -1
  202. package/link/ws/ws.cjs.native.js +1 -1
  203. package/package.json +56 -45
  204. package/react/cache/QueryReference.d.ts +6 -1
  205. package/react/cache/QueryReference.js +26 -1
  206. package/react/cache/QueryReference.js.map +1 -1
  207. package/react/cache/SuspenseCache.d.ts +10 -0
  208. package/react/cache/SuspenseCache.js +1 -1
  209. package/react/cache/SuspenseCache.js.map +1 -1
  210. package/react/cache/getSuspenseCache.js.map +1 -1
  211. package/react/context/ApolloContext.d.ts +5 -0
  212. package/react/context/ApolloContext.js +10 -3
  213. package/react/context/ApolloContext.js.map +1 -1
  214. package/react/context/context.cjs +1 -3
  215. package/react/context/context.cjs.map +1 -1
  216. package/react/context/context.cjs.native.js +1 -3
  217. package/react/hoc/graphql.js.map +1 -1
  218. package/react/hoc/hoc-utils.js +3 -1
  219. package/react/hoc/hoc-utils.js.map +1 -1
  220. package/react/hoc/hoc.cjs +9 -17
  221. package/react/hoc/hoc.cjs.map +1 -1
  222. package/react/hoc/hoc.cjs.native.js +9 -17
  223. package/react/hoc/mutation-hoc.js +9 -4
  224. package/react/hoc/mutation-hoc.js.map +1 -1
  225. package/react/hoc/query-hoc.js +10 -4
  226. package/react/hoc/query-hoc.js.map +1 -1
  227. package/react/hoc/subscription-hoc.js +10 -4
  228. package/react/hoc/subscription-hoc.js.map +1 -1
  229. package/react/hoc/withApollo.js +3 -4
  230. package/react/hoc/withApollo.js.map +1 -1
  231. package/react/hooks/hooks.cjs +72 -57
  232. package/react/hooks/hooks.cjs.map +1 -1
  233. package/react/hooks/hooks.cjs.native.js +72 -57
  234. package/react/hooks/internal/__use.js +5 -0
  235. package/react/hooks/internal/__use.js.map +1 -1
  236. package/react/hooks/internal/index.d.ts +1 -0
  237. package/react/hooks/internal/index.js +2 -0
  238. package/react/hooks/internal/index.js.map +1 -1
  239. package/react/hooks/internal/useDeepMemo.js.map +1 -1
  240. package/react/hooks/internal/useIsomorphicLayoutEffect.js +6 -3
  241. package/react/hooks/internal/useIsomorphicLayoutEffect.js.map +1 -1
  242. package/react/hooks/internal/useLazyRef.d.ts +3 -0
  243. package/react/hooks/internal/useLazyRef.js +10 -0
  244. package/react/hooks/internal/useLazyRef.js.map +1 -0
  245. package/react/hooks/useBackgroundQuery.js +6 -0
  246. package/react/hooks/useBackgroundQuery.js.map +1 -1
  247. package/react/hooks/useFragment.js +21 -17
  248. package/react/hooks/useFragment.js.map +1 -1
  249. package/react/hooks/useLazyQuery.js +13 -4
  250. package/react/hooks/useLazyQuery.js.map +1 -1
  251. package/react/hooks/useMutation.js +8 -3
  252. package/react/hooks/useMutation.js.map +1 -1
  253. package/react/hooks/useQuery.d.ts +11 -0
  254. package/react/hooks/useQuery.js +137 -5
  255. package/react/hooks/useQuery.js.map +1 -1
  256. package/react/hooks/useReactiveVar.js +5 -0
  257. package/react/hooks/useReactiveVar.js.map +1 -1
  258. package/react/hooks/useReadQuery.d.ts +19 -0
  259. package/react/hooks/useReadQuery.js.map +1 -1
  260. package/react/hooks/useSubscription.js +5 -0
  261. package/react/hooks/useSubscription.js.map +1 -1
  262. package/react/hooks/useSuspenseQuery.js +11 -5
  263. package/react/hooks/useSuspenseQuery.js.map +1 -1
  264. package/react/hooks/useSyncExternalStore.js +53 -1
  265. package/react/hooks/useSyncExternalStore.js.map +1 -1
  266. package/react/parser/index.js +4 -5
  267. package/react/parser/index.js.map +1 -1
  268. package/react/parser/parser.cjs +2 -4
  269. package/react/parser/parser.cjs.map +1 -1
  270. package/react/parser/parser.cjs.native.js +2 -4
  271. package/react/ssr/RenderPromises.js +21 -1
  272. package/react/ssr/RenderPromises.js.map +1 -1
  273. package/react/ssr/getDataFromTree.js +18 -3
  274. package/react/ssr/getDataFromTree.js.map +1 -1
  275. package/react/ssr/ssr.cjs +6 -4
  276. package/react/ssr/ssr.cjs.map +1 -1
  277. package/react/ssr/ssr.cjs.native.js +6 -4
  278. package/react/types/types.d.ts +66 -0
  279. package/testing/core/core.cjs +18 -13
  280. package/testing/core/core.cjs.map +1 -1
  281. package/testing/core/core.cjs.native.js +18 -13
  282. package/testing/core/itAsync.d.ts +1 -1
  283. package/testing/core/itAsync.js.map +1 -1
  284. package/testing/core/mocking/mockFetch.d.ts +2 -2
  285. package/testing/core/mocking/mockFetch.js +8 -4
  286. package/testing/core/mocking/mockFetch.js.map +1 -1
  287. package/testing/core/mocking/mockLink.js +25 -9
  288. package/testing/core/mocking/mockLink.js.map +1 -1
  289. package/testing/core/mocking/mockQueryManager.js +2 -0
  290. package/testing/core/mocking/mockQueryManager.js.map +1 -1
  291. package/testing/core/mocking/mockSubscriptionLink.d.ts +1 -1
  292. package/testing/core/mocking/mockSubscriptionLink.js +1 -1
  293. package/testing/core/mocking/mockSubscriptionLink.js.map +1 -1
  294. package/testing/core/mocking/mockWatchQuery.js +1 -1
  295. package/testing/core/mocking/mockWatchQuery.js.map +1 -1
  296. package/testing/core/observableToPromise.d.ts +17 -3
  297. package/testing/core/observableToPromise.js +5 -0
  298. package/testing/core/observableToPromise.js.map +1 -1
  299. package/testing/core/subscribeAndCount.js +3 -0
  300. package/testing/core/subscribeAndCount.js.map +1 -1
  301. package/testing/core/wait.js +2 -2
  302. package/testing/core/wait.js.map +1 -1
  303. package/testing/core/withConsoleSpy.d.ts +3 -0
  304. package/testing/core/withConsoleSpy.js +7 -1
  305. package/testing/core/withConsoleSpy.js.map +1 -1
  306. package/testing/core/wrap.js +2 -0
  307. package/testing/core/wrap.js.map +1 -1
  308. package/testing/internal/ObservableStream.js +14 -14
  309. package/testing/internal/ObservableStream.js.map +1 -1
  310. package/testing/internal/disposables/spyOnConsole.d.ts +1 -0
  311. package/testing/internal/disposables/spyOnConsole.js +2 -0
  312. package/testing/internal/disposables/spyOnConsole.js.map +1 -1
  313. package/testing/internal/disposables/withCleanup.d.ts +1 -0
  314. package/testing/internal/disposables/withCleanup.js +3 -0
  315. package/testing/internal/disposables/withCleanup.js.map +1 -1
  316. package/testing/internal/profile/Render.d.ts +28 -0
  317. package/testing/internal/profile/Render.js +12 -1
  318. package/testing/internal/profile/Render.js.map +1 -1
  319. package/testing/internal/profile/profile.d.ts +44 -7
  320. package/testing/internal/profile/profile.js +63 -51
  321. package/testing/internal/profile/profile.js.map +1 -1
  322. package/testing/internal/profile/traces.d.ts +4 -0
  323. package/testing/internal/profile/traces.js +9 -5
  324. package/testing/internal/profile/traces.js.map +1 -1
  325. package/testing/matchers/ProfiledComponent.js +27 -22
  326. package/testing/matchers/ProfiledComponent.js.map +1 -1
  327. package/testing/matchers/toHaveSuspenseCacheEntryUsing.js.map +1 -1
  328. package/testing/matchers/toMatchDocument.js.map +1 -1
  329. package/testing/react/MockedProvider.d.ts +4 -0
  330. package/testing/react/MockedProvider.js +6 -2
  331. package/testing/react/MockedProvider.js.map +1 -1
  332. package/testing/testing.cjs +4 -2
  333. package/testing/testing.cjs.map +1 -1
  334. package/testing/testing.cjs.native.js +4 -2
  335. package/utilities/common/arrays.js +1 -0
  336. package/utilities/common/arrays.js.map +1 -1
  337. package/utilities/common/canUse.js +16 -1
  338. package/utilities/common/canUse.js.map +1 -1
  339. package/utilities/common/cloneDeep.d.ts +3 -0
  340. package/utilities/common/cloneDeep.js +5 -0
  341. package/utilities/common/cloneDeep.js.map +1 -1
  342. package/utilities/common/compact.d.ts +4 -0
  343. package/utilities/common/compact.js +4 -0
  344. package/utilities/common/compact.js.map +1 -1
  345. package/utilities/common/errorHandling.js +1 -3
  346. package/utilities/common/errorHandling.js.map +1 -1
  347. package/utilities/common/incrementalResult.js +3 -0
  348. package/utilities/common/incrementalResult.js.map +1 -1
  349. package/utilities/common/makeUniqueId.js +2 -0
  350. package/utilities/common/makeUniqueId.js.map +1 -1
  351. package/utilities/common/maybeDeepFreeze.js +3 -0
  352. package/utilities/common/maybeDeepFreeze.js.map +1 -1
  353. package/utilities/common/mergeDeep.js +12 -1
  354. package/utilities/common/mergeDeep.js.map +1 -1
  355. package/utilities/common/mergeOptions.d.ts +1 -1
  356. package/utilities/common/mergeOptions.js.map +1 -1
  357. package/utilities/common/omitDeep.js.map +1 -1
  358. package/utilities/globals/global.js +7 -1
  359. package/utilities/globals/global.js.map +1 -1
  360. package/utilities/globals/globals.cjs +4 -5
  361. package/utilities/globals/globals.cjs.map +1 -1
  362. package/utilities/globals/globals.cjs.native.js +4 -5
  363. package/utilities/globals/index.d.ts +4 -0
  364. package/utilities/globals/index.js +7 -0
  365. package/utilities/globals/index.js.map +1 -1
  366. package/utilities/globals/invariantWrappers.d.ts +40 -0
  367. package/utilities/globals/invariantWrappers.js +11 -3
  368. package/utilities/globals/invariantWrappers.js.map +1 -1
  369. package/utilities/globals/maybe.js.map +1 -1
  370. package/utilities/graphql/DocumentTransform.js +19 -6
  371. package/utilities/graphql/DocumentTransform.js.map +1 -1
  372. package/utilities/graphql/directives.js +3 -0
  373. package/utilities/graphql/directives.js.map +1 -1
  374. package/utilities/graphql/fragments.d.ts +25 -0
  375. package/utilities/graphql/fragments.js +36 -0
  376. package/utilities/graphql/fragments.js.map +1 -1
  377. package/utilities/graphql/getFromAST.d.ts +5 -0
  378. package/utilities/graphql/getFromAST.js +9 -0
  379. package/utilities/graphql/getFromAST.js.map +1 -1
  380. package/utilities/graphql/print.js.map +1 -1
  381. package/utilities/graphql/storeUtils.d.ts +14 -0
  382. package/utilities/graphql/storeUtils.js +7 -2
  383. package/utilities/graphql/storeUtils.js.map +1 -1
  384. package/utilities/graphql/transform.js +106 -7
  385. package/utilities/graphql/transform.js.map +1 -1
  386. package/utilities/observables/Concast.d.ts +1 -1
  387. package/utilities/observables/Concast.js +84 -1
  388. package/utilities/observables/Concast.js.map +1 -1
  389. package/utilities/observables/Observable.js +6 -0
  390. package/utilities/observables/Observable.js.map +1 -1
  391. package/utilities/observables/asyncMap.js +12 -3
  392. package/utilities/observables/asyncMap.js.map +1 -1
  393. package/utilities/observables/iteration.js +3 -0
  394. package/utilities/observables/iteration.js.map +1 -1
  395. package/utilities/observables/subclassing.js +14 -0
  396. package/utilities/observables/subclassing.js.map +1 -1
  397. package/utilities/policies/pagination.js +47 -3
  398. package/utilities/policies/pagination.js.map +1 -1
  399. package/utilities/promises/decoration.js +1 -0
  400. package/utilities/promises/decoration.js.map +1 -1
  401. package/utilities/types/DeepOmit.js.map +1 -1
  402. package/utilities/types/DeepPartial.d.ts +1 -1
  403. package/utilities/types/DeepPartial.js +4 -0
  404. package/utilities/types/DeepPartial.js.map +1 -1
  405. package/utilities/types/IsStrictlyAny.js.map +1 -1
  406. package/utilities/types/TODO.d.ts +3 -0
  407. package/utilities/types/TODO.js +2 -0
  408. package/utilities/types/TODO.js.map +1 -0
  409. package/utilities/utilities.cjs +31 -27
  410. package/utilities/utilities.cjs.map +1 -1
  411. package/utilities/utilities.cjs.native.js +31 -27
  412. package/version.js +1 -1
  413. package/cache/core/cache.d.ts.map +0 -1
  414. package/cache/core/types/Cache.d.ts.map +0 -1
  415. package/cache/core/types/DataProxy.d.ts.map +0 -1
  416. package/cache/core/types/common.d.ts.map +0 -1
  417. package/cache/index.d.ts.map +0 -1
  418. package/cache/inmemory/entityStore.d.ts.map +0 -1
  419. package/cache/inmemory/fixPolyfills.d.ts.map +0 -1
  420. package/cache/inmemory/fixPolyfills.native.d.ts.map +0 -1
  421. package/cache/inmemory/fragmentRegistry.d.ts.map +0 -1
  422. package/cache/inmemory/helpers.d.ts.map +0 -1
  423. package/cache/inmemory/inMemoryCache.d.ts.map +0 -1
  424. package/cache/inmemory/key-extractor.d.ts.map +0 -1
  425. package/cache/inmemory/object-canon.d.ts.map +0 -1
  426. package/cache/inmemory/policies.d.ts.map +0 -1
  427. package/cache/inmemory/reactiveVars.d.ts.map +0 -1
  428. package/cache/inmemory/readFromStore.d.ts.map +0 -1
  429. package/cache/inmemory/types.d.ts.map +0 -1
  430. package/cache/inmemory/writeToStore.d.ts.map +0 -1
  431. package/config/jest/setup.d.ts.map +0 -1
  432. package/core/ApolloClient.d.ts.map +0 -1
  433. package/core/LocalState.d.ts.map +0 -1
  434. package/core/ObservableQuery.d.ts.map +0 -1
  435. package/core/QueryInfo.d.ts.map +0 -1
  436. package/core/QueryManager.d.ts.map +0 -1
  437. package/core/equalByQuery.d.ts.map +0 -1
  438. package/core/index.d.ts.map +0 -1
  439. package/core/networkStatus.d.ts.map +0 -1
  440. package/core/types.d.ts.map +0 -1
  441. package/core/watchQueryOptions.d.ts.map +0 -1
  442. package/dev/index.d.ts.map +0 -1
  443. package/dev/loadDevMessages.d.ts.map +0 -1
  444. package/dev/loadErrorMessageHandler.d.ts.map +0 -1
  445. package/dev/loadErrorMessages.d.ts.map +0 -1
  446. package/errors/index.d.ts.map +0 -1
  447. package/index.d.ts.map +0 -1
  448. package/invariantErrorCodes.d.ts.map +0 -1
  449. package/link/batch/batchLink.d.ts.map +0 -1
  450. package/link/batch/batching.d.ts.map +0 -1
  451. package/link/batch/index.d.ts.map +0 -1
  452. package/link/batch-http/batchHttpLink.d.ts.map +0 -1
  453. package/link/batch-http/index.d.ts.map +0 -1
  454. package/link/context/index.d.ts.map +0 -1
  455. package/link/core/ApolloLink.d.ts.map +0 -1
  456. package/link/core/concat.d.ts.map +0 -1
  457. package/link/core/empty.d.ts.map +0 -1
  458. package/link/core/execute.d.ts.map +0 -1
  459. package/link/core/from.d.ts.map +0 -1
  460. package/link/core/index.d.ts.map +0 -1
  461. package/link/core/split.d.ts.map +0 -1
  462. package/link/core/types.d.ts.map +0 -1
  463. package/link/error/index.d.ts.map +0 -1
  464. package/link/http/HttpLink.d.ts.map +0 -1
  465. package/link/http/checkFetcher.d.ts.map +0 -1
  466. package/link/http/createHttpLink.d.ts.map +0 -1
  467. package/link/http/createSignalIfSupported.d.ts.map +0 -1
  468. package/link/http/index.d.ts.map +0 -1
  469. package/link/http/iterators/async.d.ts.map +0 -1
  470. package/link/http/iterators/nodeStream.d.ts.map +0 -1
  471. package/link/http/iterators/promise.d.ts.map +0 -1
  472. package/link/http/iterators/reader.d.ts.map +0 -1
  473. package/link/http/parseAndCheckHttpResponse.d.ts.map +0 -1
  474. package/link/http/responseIterator.d.ts.map +0 -1
  475. package/link/http/rewriteURIForGET.d.ts.map +0 -1
  476. package/link/http/selectHttpOptionsAndBody.d.ts.map +0 -1
  477. package/link/http/selectURI.d.ts.map +0 -1
  478. package/link/http/serializeFetchParameter.d.ts.map +0 -1
  479. package/link/persisted-queries/index.d.ts.map +0 -1
  480. package/link/remove-typename/index.d.ts.map +0 -1
  481. package/link/remove-typename/removeTypenameFromVariables.d.ts.map +0 -1
  482. package/link/retry/delayFunction.d.ts.map +0 -1
  483. package/link/retry/index.d.ts.map +0 -1
  484. package/link/retry/retryFunction.d.ts.map +0 -1
  485. package/link/retry/retryLink.d.ts.map +0 -1
  486. package/link/schema/index.d.ts.map +0 -1
  487. package/link/subscriptions/index.d.ts.map +0 -1
  488. package/link/utils/createOperation.d.ts.map +0 -1
  489. package/link/utils/filterOperationVariables.d.ts.map +0 -1
  490. package/link/utils/fromError.d.ts.map +0 -1
  491. package/link/utils/fromPromise.d.ts.map +0 -1
  492. package/link/utils/index.d.ts.map +0 -1
  493. package/link/utils/throwServerError.d.ts.map +0 -1
  494. package/link/utils/toPromise.d.ts.map +0 -1
  495. package/link/utils/transformOperation.d.ts.map +0 -1
  496. package/link/utils/validateOperation.d.ts.map +0 -1
  497. package/link/ws/index.d.ts.map +0 -1
  498. package/react/cache/QueryReference.d.ts.map +0 -1
  499. package/react/cache/SuspenseCache.d.ts.map +0 -1
  500. package/react/cache/getSuspenseCache.d.ts.map +0 -1
  501. package/react/cache/index.d.ts.map +0 -1
  502. package/react/cache/types.d.ts.map +0 -1
  503. package/react/components/Mutation.d.ts.map +0 -1
  504. package/react/components/Query.d.ts.map +0 -1
  505. package/react/components/Subscription.d.ts.map +0 -1
  506. package/react/components/index.d.ts.map +0 -1
  507. package/react/components/types.d.ts.map +0 -1
  508. package/react/context/ApolloConsumer.d.ts.map +0 -1
  509. package/react/context/ApolloContext.d.ts.map +0 -1
  510. package/react/context/ApolloProvider.d.ts.map +0 -1
  511. package/react/context/index.d.ts.map +0 -1
  512. package/react/hoc/graphql.d.ts.map +0 -1
  513. package/react/hoc/hoc-utils.d.ts.map +0 -1
  514. package/react/hoc/index.d.ts.map +0 -1
  515. package/react/hoc/mutation-hoc.d.ts.map +0 -1
  516. package/react/hoc/query-hoc.d.ts.map +0 -1
  517. package/react/hoc/subscription-hoc.d.ts.map +0 -1
  518. package/react/hoc/types.d.ts.map +0 -1
  519. package/react/hoc/withApollo.d.ts.map +0 -1
  520. package/react/hooks/constants.d.ts.map +0 -1
  521. package/react/hooks/index.d.ts.map +0 -1
  522. package/react/hooks/internal/__use.d.ts.map +0 -1
  523. package/react/hooks/internal/index.d.ts.map +0 -1
  524. package/react/hooks/internal/useDeepMemo.d.ts.map +0 -1
  525. package/react/hooks/internal/useIsomorphicLayoutEffect.d.ts.map +0 -1
  526. package/react/hooks/useApolloClient.d.ts.map +0 -1
  527. package/react/hooks/useBackgroundQuery.d.ts.map +0 -1
  528. package/react/hooks/useFragment.d.ts.map +0 -1
  529. package/react/hooks/useLazyQuery.d.ts.map +0 -1
  530. package/react/hooks/useMutation.d.ts.map +0 -1
  531. package/react/hooks/useQuery.d.ts.map +0 -1
  532. package/react/hooks/useReactiveVar.d.ts.map +0 -1
  533. package/react/hooks/useReadQuery.d.ts.map +0 -1
  534. package/react/hooks/useSubscription.d.ts.map +0 -1
  535. package/react/hooks/useSuspenseQuery.d.ts.map +0 -1
  536. package/react/hooks/useSyncExternalStore.d.ts.map +0 -1
  537. package/react/index.d.ts.map +0 -1
  538. package/react/parser/index.d.ts.map +0 -1
  539. package/react/ssr/RenderPromises.d.ts.map +0 -1
  540. package/react/ssr/getDataFromTree.d.ts.map +0 -1
  541. package/react/ssr/index.d.ts.map +0 -1
  542. package/react/ssr/renderToStringWithData.d.ts.map +0 -1
  543. package/react/types/types.d.ts.map +0 -1
  544. package/testing/core/index.d.ts.map +0 -1
  545. package/testing/core/itAsync.d.ts.map +0 -1
  546. package/testing/core/mocking/mockClient.d.ts.map +0 -1
  547. package/testing/core/mocking/mockFetch.d.ts.map +0 -1
  548. package/testing/core/mocking/mockLink.d.ts.map +0 -1
  549. package/testing/core/mocking/mockQueryManager.d.ts.map +0 -1
  550. package/testing/core/mocking/mockSubscriptionLink.d.ts.map +0 -1
  551. package/testing/core/mocking/mockWatchQuery.d.ts.map +0 -1
  552. package/testing/core/observableToPromise.d.ts.map +0 -1
  553. package/testing/core/subscribeAndCount.d.ts.map +0 -1
  554. package/testing/core/wait.d.ts.map +0 -1
  555. package/testing/core/withConsoleSpy.d.ts.map +0 -1
  556. package/testing/core/wrap.d.ts.map +0 -1
  557. package/testing/index.d.ts.map +0 -1
  558. package/testing/internal/ObservableStream.d.ts.map +0 -1
  559. package/testing/internal/disposables/index.d.ts.map +0 -1
  560. package/testing/internal/disposables/spyOnConsole.d.ts.map +0 -1
  561. package/testing/internal/disposables/withCleanup.d.ts.map +0 -1
  562. package/testing/internal/index.d.ts.map +0 -1
  563. package/testing/internal/profile/Render.d.ts.map +0 -1
  564. package/testing/internal/profile/index.d.ts.map +0 -1
  565. package/testing/internal/profile/profile.d.ts.map +0 -1
  566. package/testing/internal/profile/traces.d.ts.map +0 -1
  567. package/testing/matchers/ProfiledComponent.d.ts.map +0 -1
  568. package/testing/matchers/index.d.ts.map +0 -1
  569. package/testing/matchers/toHaveSuspenseCacheEntryUsing.d.ts.map +0 -1
  570. package/testing/matchers/toMatchDocument.d.ts.map +0 -1
  571. package/testing/react/MockedProvider.d.ts.map +0 -1
  572. package/utilities/common/arrays.d.ts.map +0 -1
  573. package/utilities/common/canUse.d.ts.map +0 -1
  574. package/utilities/common/cloneDeep.d.ts.map +0 -1
  575. package/utilities/common/compact.d.ts.map +0 -1
  576. package/utilities/common/errorHandling.d.ts.map +0 -1
  577. package/utilities/common/filterInPlace.d.ts +0 -2
  578. package/utilities/common/filterInPlace.d.ts.map +0 -1
  579. package/utilities/common/filterInPlace.js +0 -11
  580. package/utilities/common/filterInPlace.js.map +0 -1
  581. package/utilities/common/incrementalResult.d.ts.map +0 -1
  582. package/utilities/common/makeUniqueId.d.ts.map +0 -1
  583. package/utilities/common/maybeDeepFreeze.d.ts.map +0 -1
  584. package/utilities/common/mergeDeep.d.ts.map +0 -1
  585. package/utilities/common/mergeOptions.d.ts.map +0 -1
  586. package/utilities/common/objects.d.ts.map +0 -1
  587. package/utilities/common/omitDeep.d.ts.map +0 -1
  588. package/utilities/common/stringifyForDisplay.d.ts.map +0 -1
  589. package/utilities/common/stripTypename.d.ts.map +0 -1
  590. package/utilities/globals/global.d.ts.map +0 -1
  591. package/utilities/globals/index.d.ts.map +0 -1
  592. package/utilities/globals/invariantWrappers.d.ts.map +0 -1
  593. package/utilities/globals/maybe.d.ts.map +0 -1
  594. package/utilities/graphql/DocumentTransform.d.ts.map +0 -1
  595. package/utilities/graphql/directives.d.ts.map +0 -1
  596. package/utilities/graphql/fragments.d.ts.map +0 -1
  597. package/utilities/graphql/getFromAST.d.ts.map +0 -1
  598. package/utilities/graphql/operations.d.ts.map +0 -1
  599. package/utilities/graphql/print.d.ts.map +0 -1
  600. package/utilities/graphql/storeUtils.d.ts.map +0 -1
  601. package/utilities/graphql/transform.d.ts.map +0 -1
  602. package/utilities/index.d.ts.map +0 -1
  603. package/utilities/observables/Concast.d.ts.map +0 -1
  604. package/utilities/observables/Observable.d.ts.map +0 -1
  605. package/utilities/observables/asyncMap.d.ts.map +0 -1
  606. package/utilities/observables/iteration.d.ts.map +0 -1
  607. package/utilities/observables/subclassing.d.ts.map +0 -1
  608. package/utilities/policies/pagination.d.ts.map +0 -1
  609. package/utilities/promises/decoration.d.ts.map +0 -1
  610. package/utilities/types/DeepOmit.d.ts.map +0 -1
  611. package/utilities/types/DeepPartial.d.ts.map +0 -1
  612. package/utilities/types/IsStrictlyAny.d.ts.map +0 -1
  613. package/utilities/types/Primitive.d.ts.map +0 -1
  614. package/version.d.ts.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"watchQueryOptions.js","sourceRoot":"","sources":["../../src/core/watchQueryOptions.ts"],"names":[],"mappings":"","sourcesContent":["import type { DocumentNode } from \"graphql\";\nimport type { TypedDocumentNode } from \"@graphql-typed-document-node/core\";\n\nimport type { FetchResult } from \"../link/core/index.js\";\nimport type {\n DefaultContext,\n MutationQueryReducersMap,\n OperationVariables,\n MutationUpdaterFunction,\n OnQueryUpdated,\n InternalRefetchQueriesInclude,\n} from \"./types.js\";\nimport type { ApolloCache } from \"../cache/index.js\";\nimport type { ObservableQuery } from \"./ObservableQuery.js\";\n\n/**\n * fetchPolicy determines where the client may return a result from. The options are:\n * - cache-first (default): return result from cache. Only fetch from network if cached result is not available.\n * - cache-and-network: return result from cache first (if it exists), then return network result once it's available.\n * - cache-only: return result from cache if available, fail otherwise.\n * - no-cache: return result from network, fail if network call doesn't succeed, don't save to cache\n * - network-only: return result from network, fail if network call doesn't succeed, save to cache\n * - standby: only for queries that aren't actively watched, but should be available for refetch and updateQueries.\n */\nexport type FetchPolicy =\n | \"cache-first\"\n | \"network-only\"\n | \"cache-only\"\n | \"no-cache\"\n | \"standby\";\n\nexport type WatchQueryFetchPolicy = FetchPolicy | \"cache-and-network\";\n\nexport type MutationFetchPolicy = Extract<\n FetchPolicy,\n | \"network-only\" // default behavior (mutation results written to cache)\n | \"no-cache\" // alternate behavior (results not written to cache)\n>;\n\nexport type RefetchWritePolicy = \"merge\" | \"overwrite\";\n\n/**\n * errorPolicy determines the level of events for errors in the execution result. The options are:\n * - none (default): any errors from the request are treated like runtime errors and the observable is stopped (XXX this is default to lower breaking changes going from AC 1.0 => 2.0)\n * - ignore: errors from the request do not stop the observable, but also don't call `next`\n * - all: errors are treated like data and will notify observables\n */\nexport type ErrorPolicy = \"none\" | \"ignore\" | \"all\";\n\n/**\n * Query options.\n */\nexport interface QueryOptions<TVariables = OperationVariables, TData = any> {\n /**\n * A GraphQL document that consists of a single query to be sent down to the\n * server.\n */\n // TODO REFACTOR: rename this to document. Didn't do it yet because it's in a\n // lot of tests.\n query: DocumentNode | TypedDocumentNode<TData, TVariables>;\n\n /**\n * A map going from variable name to variable value, where the variables are used\n * within the GraphQL query.\n */\n variables?: TVariables;\n\n /**\n * Specifies the {@link ErrorPolicy} to be used for this query\n */\n errorPolicy?: ErrorPolicy;\n\n /**\n * Context to be passed to link execution chain\n */\n context?: DefaultContext;\n\n /**\n * Specifies the {@link FetchPolicy} to be used for this query\n */\n fetchPolicy?: FetchPolicy;\n\n /**\n * The time interval (in milliseconds) on which this query should be\n * refetched from the server.\n */\n pollInterval?: number;\n\n /**\n * Whether or not updates to the network status should trigger next on the observer of this query\n */\n notifyOnNetworkStatusChange?: boolean;\n\n /**\n * Allow returning incomplete data from the cache when a larger query cannot\n * be fully satisfied by the cache, instead of returning nothing.\n */\n returnPartialData?: boolean;\n\n /**\n * If `true`, perform a query `refetch` if the query result is marked as\n * being partial, and the returned data is reset to an empty Object by the\n * Apollo Client `QueryManager` (due to a cache miss).\n */\n partialRefetch?: boolean;\n\n /**\n * Whether to canonize cache results before returning them. Canonization\n * takes some extra time, but it speeds up future deep equality comparisons.\n * Defaults to false.\n */\n canonizeResults?: boolean;\n}\n\n/**\n * Watched query options.\n */\nexport interface WatchQueryOptions<\n TVariables extends OperationVariables = OperationVariables,\n TData = any,\n> extends Omit<QueryOptions<TVariables, TData>, \"fetchPolicy\"> {\n /**\n * Specifies the {@link FetchPolicy} to be used for this query.\n */\n fetchPolicy?: WatchQueryFetchPolicy;\n\n /**\n * Specifies the {@link FetchPolicy} to be used after this query has completed.\n */\n nextFetchPolicy?:\n | WatchQueryFetchPolicy\n | ((\n this: WatchQueryOptions<TVariables, TData>,\n currentFetchPolicy: WatchQueryFetchPolicy,\n context: NextFetchPolicyContext<TData, TVariables>\n ) => WatchQueryFetchPolicy);\n\n /**\n * Defaults to the initial value of options.fetchPolicy, but can be explicitly\n * configured to specify the WatchQueryFetchPolicy to revert back to whenever\n * variables change (unless nextFetchPolicy intervenes).\n */\n initialFetchPolicy?: WatchQueryFetchPolicy;\n\n /**\n * Specifies whether a {@link NetworkStatus.refetch} operation should merge\n * incoming field data with existing data, or overwrite the existing data.\n * Overwriting is probably preferable, but merging is currently the default\n * behavior, for backwards compatibility with Apollo Client 3.x.\n */\n refetchWritePolicy?: RefetchWritePolicy;\n}\n\nexport interface NextFetchPolicyContext<\n TData,\n TVariables extends OperationVariables,\n> {\n reason: \"after-fetch\" | \"variables-changed\";\n observable: ObservableQuery<TData, TVariables>;\n options: WatchQueryOptions<TVariables, TData>;\n initialFetchPolicy: WatchQueryFetchPolicy;\n}\n\nexport interface FetchMoreQueryOptions<TVariables, TData = any> {\n query?: DocumentNode | TypedDocumentNode<TData, TVariables>;\n variables?: Partial<TVariables>;\n context?: DefaultContext;\n}\n\nexport type UpdateQueryFn<\n TData = any,\n TSubscriptionVariables = OperationVariables,\n TSubscriptionData = TData,\n> = (\n previousQueryResult: TData,\n options: {\n subscriptionData: { data: TSubscriptionData };\n variables?: TSubscriptionVariables;\n }\n) => TData;\n\nexport type SubscribeToMoreOptions<\n TData = any,\n TSubscriptionVariables = OperationVariables,\n TSubscriptionData = TData,\n> = {\n document:\n | DocumentNode\n | TypedDocumentNode<TSubscriptionData, TSubscriptionVariables>;\n variables?: TSubscriptionVariables;\n updateQuery?: UpdateQueryFn<TData, TSubscriptionVariables, TSubscriptionData>;\n onError?: (error: Error) => void;\n context?: DefaultContext;\n};\n\nexport interface SubscriptionOptions<\n TVariables = OperationVariables,\n TData = any,\n> {\n /**\n * A GraphQL document, often created with `gql` from the `graphql-tag`\n * package, that contains a single subscription inside of it.\n */\n query: DocumentNode | TypedDocumentNode<TData, TVariables>;\n\n /**\n * An object that maps from the name of a variable as used in the subscription\n * GraphQL document to that variable's value.\n */\n variables?: TVariables;\n\n /**\n * Specifies the {@link FetchPolicy} to be used for this subscription.\n */\n fetchPolicy?: FetchPolicy;\n\n /**\n * Specifies the {@link ErrorPolicy} to be used for this operation\n */\n errorPolicy?: ErrorPolicy;\n\n /**\n * Context object to be passed through the link execution chain.\n */\n context?: DefaultContext;\n}\n\nexport interface MutationBaseOptions<\n TData = any,\n TVariables = OperationVariables,\n TContext = DefaultContext,\n TCache extends ApolloCache<any> = ApolloCache<any>,\n> {\n /**\n * An object that represents the result of this mutation that will be\n * optimistically stored before the server has actually returned a result.\n * This is most often used for optimistic UI, where we want to be able to see\n * the result of a mutation immediately, and update the UI later if any errors\n * appear.\n */\n optimisticResponse?: TData | ((vars: TVariables) => TData);\n\n /**\n * A {@link MutationQueryReducersMap}, which is map from query names to\n * mutation query reducers. Briefly, this map defines how to incorporate the\n * results of the mutation into the results of queries that are currently\n * being watched by your application.\n */\n updateQueries?: MutationQueryReducersMap<TData>;\n\n /**\n * A list of query names which will be refetched once this mutation has\n * returned. This is often used if you have a set of queries which may be\n * affected by a mutation and will have to update. Rather than writing a\n * mutation query reducer (i.e. `updateQueries`) for this, you can simply\n * refetch the queries that will be affected and achieve a consistent store\n * once these queries return.\n */\n refetchQueries?:\n | ((result: FetchResult<TData>) => InternalRefetchQueriesInclude)\n | InternalRefetchQueriesInclude;\n\n /**\n * By default, `refetchQueries` does not wait for the refetched queries to\n * be completed, before resolving the mutation `Promise`. This ensures that\n * query refetching does not hold up mutation response handling (query\n * refetching is handled asynchronously). Set `awaitRefetchQueries` to\n * `true` if you would like to wait for the refetched queries to complete,\n * before the mutation can be marked as resolved.\n */\n awaitRefetchQueries?: boolean;\n\n /**\n * A function which provides an {@link ApolloCache} instance, and the result\n * of the mutation, to allow the user to update the store based on the\n * results of the mutation.\n *\n * This function will be called twice over the lifecycle of a mutation. Once\n * at the very beginning if an `optimisticResponse` was provided. The writes\n * created from the optimistic data will be rolled back before the second time\n * this function is called which is when the mutation has successfully\n * resolved. At that point `update` will be called with the *actual* mutation\n * result and those writes will not be rolled back.\n *\n * Note that since this function is intended to be used to update the\n * store, it cannot be used with a `no-cache` fetch policy. If you're\n * interested in performing some action after a mutation has completed,\n * and you don't need to update the store, use the Promise returned from\n * `client.mutate` instead.\n */\n update?: MutationUpdaterFunction<TData, TVariables, TContext, TCache>;\n\n /**\n * A function that will be called for each ObservableQuery affected by\n * this mutation, after the mutation has completed.\n */\n onQueryUpdated?: OnQueryUpdated<any>;\n\n /**\n * Specifies the {@link ErrorPolicy} to be used for this operation\n */\n errorPolicy?: ErrorPolicy;\n\n /**\n * An object that maps from the name of a variable as used in the mutation\n * GraphQL document to that variable's value.\n */\n variables?: TVariables;\n\n /**\n * The context to be passed to the link execution chain. This context will\n * only be used with this mutation. It will not be used with\n * `refetchQueries`. Refetched queries use the context they were\n * initialized with (since the initial context is stored as part of the\n * `ObservableQuery` instance). If a specific context is needed when\n * refetching queries, make sure it is configured (via the\n * [query `context` option](https://www.apollographql.com/docs/react/api/apollo-client#ApolloClient.query))\n * when the query is first initialized/run.\n */\n context?: TContext;\n}\n\nexport interface MutationOptions<\n TData = any,\n TVariables = OperationVariables,\n TContext = DefaultContext,\n TCache extends ApolloCache<any> = ApolloCache<any>,\n> extends MutationBaseOptions<TData, TVariables, TContext, TCache> {\n /**\n * A GraphQL document, often created with `gql` from the `graphql-tag`\n * package, that contains a single mutation inside of it.\n */\n mutation: DocumentNode | TypedDocumentNode<TData, TVariables>;\n\n /**\n * Specifies the {@link MutationFetchPolicy} to be used for this query.\n * Mutations support only 'network-only' and 'no-cache' fetchPolicy strings.\n * If fetchPolicy is not provided, it defaults to 'network-only'.\n */\n fetchPolicy?: MutationFetchPolicy;\n\n /**\n * To avoid retaining sensitive information from mutation root field\n * arguments, Apollo Client v3.4+ automatically clears any `ROOT_MUTATION`\n * fields from the cache after each mutation finishes. If you need this\n * information to remain in the cache, you can prevent the removal by passing\n * `keepRootFields: true` to the mutation. `ROOT_MUTATION` result data are\n * also passed to the mutation `update` function, so we recommend obtaining\n * the results that way, rather than using this option, if possible.\n */\n keepRootFields?: boolean;\n}\n"]}
1
+ {"version":3,"file":"watchQueryOptions.js","sourceRoot":"","sources":["../../src/core/watchQueryOptions.ts"],"names":[],"mappings":"","sourcesContent":["import type { DocumentNode } from \"graphql\";\nimport type { TypedDocumentNode } from \"@graphql-typed-document-node/core\";\n\nimport type { FetchResult } from \"../link/core/index.js\";\nimport type {\n DefaultContext,\n MutationQueryReducersMap,\n OperationVariables,\n MutationUpdaterFunction,\n OnQueryUpdated,\n InternalRefetchQueriesInclude,\n} from \"./types.js\";\nimport type { ApolloCache } from \"../cache/index.js\";\nimport type { ObservableQuery } from \"./ObservableQuery.js\";\n\n/**\n * fetchPolicy determines where the client may return a result from. The options are:\n * - cache-first (default): return result from cache. Only fetch from network if cached result is not available.\n * - cache-and-network: return result from cache first (if it exists), then return network result once it's available.\n * - cache-only: return result from cache if available, fail otherwise.\n * - no-cache: return result from network, fail if network call doesn't succeed, don't save to cache\n * - network-only: return result from network, fail if network call doesn't succeed, save to cache\n * - standby: only for queries that aren't actively watched, but should be available for refetch and updateQueries.\n */\nexport type FetchPolicy =\n | \"cache-first\"\n | \"network-only\"\n | \"cache-only\"\n | \"no-cache\"\n | \"standby\";\n\nexport type WatchQueryFetchPolicy = FetchPolicy | \"cache-and-network\";\n\nexport type MutationFetchPolicy = Extract<\n FetchPolicy,\n | \"network-only\" // default behavior (mutation results written to cache)\n | \"no-cache\" // alternate behavior (results not written to cache)\n>;\n\nexport type RefetchWritePolicy = \"merge\" | \"overwrite\";\n\n/**\n * errorPolicy determines the level of events for errors in the execution result. The options are:\n * - none (default): any errors from the request are treated like runtime errors and the observable is stopped\n * - ignore: errors from the request do not stop the observable, but also don't call `next`\n * - all: errors are treated like data and will notify observables\n */\nexport type ErrorPolicy = \"none\" | \"ignore\" | \"all\";\n\n/**\n * Query options.\n */\nexport interface QueryOptions<TVariables = OperationVariables, TData = any> {\n /**\n * A GraphQL document that consists of a single query to be sent down to the\n * server.\n */\n // TODO REFACTOR: rename this to document. Didn't do it yet because it's in a\n // lot of tests.\n query: DocumentNode | TypedDocumentNode<TData, TVariables>;\n\n /**\n * A map going from variable name to variable value, where the variables are used\n * within the GraphQL query.\n */\n variables?: TVariables;\n\n /**\n * Specifies the {@link ErrorPolicy} to be used for this query\n */\n errorPolicy?: ErrorPolicy;\n\n /**\n * Context to be passed to link execution chain\n */\n context?: DefaultContext;\n\n /**\n * Specifies the {@link FetchPolicy} to be used for this query\n */\n fetchPolicy?: FetchPolicy;\n\n /**\n * The time interval (in milliseconds) on which this query should be\n * refetched from the server.\n */\n pollInterval?: number;\n\n /**\n * Whether or not updates to the network status should trigger next on the observer of this query\n */\n notifyOnNetworkStatusChange?: boolean;\n\n /**\n * Allow returning incomplete data from the cache when a larger query cannot\n * be fully satisfied by the cache, instead of returning nothing.\n */\n returnPartialData?: boolean;\n\n /**\n * If `true`, perform a query `refetch` if the query result is marked as\n * being partial, and the returned data is reset to an empty Object by the\n * Apollo Client `QueryManager` (due to a cache miss).\n */\n partialRefetch?: boolean;\n\n /**\n * Whether to canonize cache results before returning them. Canonization\n * takes some extra time, but it speeds up future deep equality comparisons.\n * Defaults to false.\n */\n canonizeResults?: boolean;\n}\n\n/**\n * Watched query options.\n */\nexport interface WatchQueryOptions<\n TVariables extends OperationVariables = OperationVariables,\n TData = any,\n> {\n /**\n * Specifies the {@link FetchPolicy} to be used for this query.\n */\n fetchPolicy?: WatchQueryFetchPolicy;\n\n /**\n * Specifies the {@link FetchPolicy} to be used after this query has completed.\n */\n nextFetchPolicy?:\n | WatchQueryFetchPolicy\n | ((\n this: WatchQueryOptions<TVariables, TData>,\n currentFetchPolicy: WatchQueryFetchPolicy,\n context: NextFetchPolicyContext<TData, TVariables>\n ) => WatchQueryFetchPolicy);\n\n /**\n * Defaults to the initial value of options.fetchPolicy, but can be explicitly\n * configured to specify the WatchQueryFetchPolicy to revert back to whenever\n * variables change (unless nextFetchPolicy intervenes).\n */\n initialFetchPolicy?: WatchQueryFetchPolicy;\n\n /**\n * Specifies whether a {@link NetworkStatus.refetch} operation should merge\n * incoming field data with existing data, or overwrite the existing data.\n * Overwriting is probably preferable, but merging is currently the default\n * behavior, for backwards compatibility with Apollo Client 3.x.\n */\n refetchWritePolicy?: RefetchWritePolicy;\n\n /** {@inheritDoc @apollo/client!QueryOptions#query:member} */\n query: DocumentNode | TypedDocumentNode<TData, TVariables>;\n\n /** {@inheritDoc @apollo/client!QueryOptions#variables:member} */\n variables?: TVariables;\n\n /** {@inheritDoc @apollo/client!QueryOptions#errorPolicy:member} */\n errorPolicy?: ErrorPolicy;\n\n /** {@inheritDoc @apollo/client!QueryOptions#context:member} */\n context?: DefaultContext;\n\n /** {@inheritDoc @apollo/client!QueryOptions#pollInterval:member} */\n pollInterval?: number;\n\n /** {@inheritDoc @apollo/client!QueryOptions#notifyOnNetworkStatusChange:member} */\n notifyOnNetworkStatusChange?: boolean;\n\n /** {@inheritDoc @apollo/client!QueryOptions#returnPartialData:member} */\n returnPartialData?: boolean;\n\n /** {@inheritDoc @apollo/client!QueryOptions#partialRefetch:member} */\n partialRefetch?: boolean;\n\n /** {@inheritDoc @apollo/client!QueryOptions#canonizeResults:member} */\n canonizeResults?: boolean;\n}\n\nexport interface NextFetchPolicyContext<\n TData,\n TVariables extends OperationVariables,\n> {\n reason: \"after-fetch\" | \"variables-changed\";\n observable: ObservableQuery<TData, TVariables>;\n options: WatchQueryOptions<TVariables, TData>;\n initialFetchPolicy: WatchQueryFetchPolicy;\n}\n\nexport interface FetchMoreQueryOptions<TVariables, TData = any> {\n query?: DocumentNode | TypedDocumentNode<TData, TVariables>;\n variables?: Partial<TVariables>;\n context?: DefaultContext;\n}\n\nexport type UpdateQueryFn<\n TData = any,\n TSubscriptionVariables = OperationVariables,\n TSubscriptionData = TData,\n> = (\n previousQueryResult: TData,\n options: {\n subscriptionData: { data: TSubscriptionData };\n variables?: TSubscriptionVariables;\n }\n) => TData;\n\nexport type SubscribeToMoreOptions<\n TData = any,\n TSubscriptionVariables = OperationVariables,\n TSubscriptionData = TData,\n> = {\n document:\n | DocumentNode\n | TypedDocumentNode<TSubscriptionData, TSubscriptionVariables>;\n variables?: TSubscriptionVariables;\n updateQuery?: UpdateQueryFn<TData, TSubscriptionVariables, TSubscriptionData>;\n onError?: (error: Error) => void;\n context?: DefaultContext;\n};\n\nexport interface SubscriptionOptions<\n TVariables = OperationVariables,\n TData = any,\n> {\n /**\n * A GraphQL document, often created with `gql` from the `graphql-tag`\n * package, that contains a single subscription inside of it.\n */\n query: DocumentNode | TypedDocumentNode<TData, TVariables>;\n\n /**\n * An object that maps from the name of a variable as used in the subscription\n * GraphQL document to that variable's value.\n */\n variables?: TVariables;\n\n /**\n * Specifies the {@link FetchPolicy} to be used for this subscription.\n */\n fetchPolicy?: FetchPolicy;\n\n /**\n * Specifies the {@link ErrorPolicy} to be used for this operation\n */\n errorPolicy?: ErrorPolicy;\n\n /**\n * Context object to be passed through the link execution chain.\n */\n context?: DefaultContext;\n}\n\nexport interface MutationBaseOptions<\n TData = any,\n TVariables = OperationVariables,\n TContext = DefaultContext,\n TCache extends ApolloCache<any> = ApolloCache<any>,\n> {\n /**\n * An object that represents the result of this mutation that will be\n * optimistically stored before the server has actually returned a result.\n * This is most often used for optimistic UI, where we want to be able to see\n * the result of a mutation immediately, and update the UI later if any errors\n * appear.\n */\n optimisticResponse?: TData | ((vars: TVariables) => TData);\n\n /**\n * A {@link MutationQueryReducersMap}, which is map from query names to\n * mutation query reducers. Briefly, this map defines how to incorporate the\n * results of the mutation into the results of queries that are currently\n * being watched by your application.\n */\n updateQueries?: MutationQueryReducersMap<TData>;\n\n /**\n * A list of query names which will be refetched once this mutation has\n * returned. This is often used if you have a set of queries which may be\n * affected by a mutation and will have to update. Rather than writing a\n * mutation query reducer (i.e. `updateQueries`) for this, you can simply\n * refetch the queries that will be affected and achieve a consistent store\n * once these queries return.\n */\n refetchQueries?:\n | ((result: FetchResult<TData>) => InternalRefetchQueriesInclude)\n | InternalRefetchQueriesInclude;\n\n /**\n * By default, `refetchQueries` does not wait for the refetched queries to\n * be completed, before resolving the mutation `Promise`. This ensures that\n * query refetching does not hold up mutation response handling (query\n * refetching is handled asynchronously). Set `awaitRefetchQueries` to\n * `true` if you would like to wait for the refetched queries to complete,\n * before the mutation can be marked as resolved.\n */\n awaitRefetchQueries?: boolean;\n\n /**\n * A function which provides an {@link ApolloCache} instance, and the result\n * of the mutation, to allow the user to update the store based on the\n * results of the mutation.\n *\n * This function will be called twice over the lifecycle of a mutation. Once\n * at the very beginning if an `optimisticResponse` was provided. The writes\n * created from the optimistic data will be rolled back before the second time\n * this function is called which is when the mutation has successfully\n * resolved. At that point `update` will be called with the *actual* mutation\n * result and those writes will not be rolled back.\n *\n * Note that since this function is intended to be used to update the\n * store, it cannot be used with a `no-cache` fetch policy. If you're\n * interested in performing some action after a mutation has completed,\n * and you don't need to update the store, use the Promise returned from\n * `client.mutate` instead.\n */\n update?: MutationUpdaterFunction<TData, TVariables, TContext, TCache>;\n\n /**\n * A function that will be called for each ObservableQuery affected by\n * this mutation, after the mutation has completed.\n */\n onQueryUpdated?: OnQueryUpdated<any>;\n\n /**\n * Specifies the {@link ErrorPolicy} to be used for this operation\n */\n errorPolicy?: ErrorPolicy;\n\n /**\n * An object that maps from the name of a variable as used in the mutation\n * GraphQL document to that variable's value.\n */\n variables?: TVariables;\n\n /**\n * The context to be passed to the link execution chain. This context will\n * only be used with this mutation. It will not be used with\n * `refetchQueries`. Refetched queries use the context they were\n * initialized with (since the initial context is stored as part of the\n * `ObservableQuery` instance). If a specific context is needed when\n * refetching queries, make sure it is configured (via the\n * [query `context` option](https://www.apollographql.com/docs/react/api/apollo-client#ApolloClient.query))\n * when the query is first initialized/run.\n */\n context?: TContext;\n}\n\nexport interface MutationOptions<\n TData = any,\n TVariables = OperationVariables,\n TContext = DefaultContext,\n TCache extends ApolloCache<any> = ApolloCache<any>,\n> extends MutationBaseOptions<TData, TVariables, TContext, TCache> {\n /**\n * A GraphQL document, often created with `gql` from the `graphql-tag`\n * package, that contains a single mutation inside of it.\n */\n mutation: DocumentNode | TypedDocumentNode<TData, TVariables>;\n\n /**\n * Specifies the {@link MutationFetchPolicy} to be used for this query.\n * Mutations support only 'network-only' and 'no-cache' fetchPolicy strings.\n * If fetchPolicy is not provided, it defaults to 'network-only'.\n */\n fetchPolicy?: MutationFetchPolicy;\n\n /**\n * To avoid retaining sensitive information from mutation root field\n * arguments, Apollo Client v3.4+ automatically clears any `ROOT_MUTATION`\n * fields from the cache after each mutation finishes. If you need this\n * information to remain in the cache, you can prevent the removal by passing\n * `keepRootFields: true` to the mutation. `ROOT_MUTATION` result data are\n * also passed to the mutation `update` function, so we recommend obtaining\n * the results that way, rather than using this option, if possible.\n */\n keepRootFields?: boolean;\n}\n"]}
package/dev/dev.cjs CHANGED
@@ -5,532 +5,427 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
  var globals = require('../utilities/globals');
6
6
  var tsInvariant = require('ts-invariant');
7
7
 
8
- const errorCodes = // This file is used by the error message display website and the
9
- // @apollo/client/includeErrors entry point.
10
- // This file is not meant to be imported manually.
8
+ const errorCodes =
11
9
  {
12
10
  1: {
13
11
  file: "@apollo/client/cache/inmemory/entityStore.js",
14
12
  condition: "typeof dataId === \"string\"",
15
13
  message: "store.merge expects a string ID"
16
14
  },
17
-
18
15
  4: {
19
16
  file: "@apollo/client/cache/inmemory/key-extractor.js",
20
17
  condition: "extracted !== void 0",
21
18
  message: "Missing field '%s' while extracting keyFields from %s"
22
19
  },
23
-
24
20
  5: {
25
21
  file: "@apollo/client/cache/inmemory/policies.js",
26
22
  condition: "!old || old === which",
27
23
  message: "Cannot change root %s __typename more than once"
28
24
  },
29
-
30
25
  8: {
31
26
  file: "@apollo/client/cache/inmemory/policies.js",
32
27
  message: "Cannot automatically merge arrays"
33
28
  },
34
-
35
29
  9: {
36
30
  file: "@apollo/client/cache/inmemory/readFromStore.js",
37
31
  message: "No fragment named %s"
38
32
  },
39
-
40
33
  10: {
41
34
  file: "@apollo/client/cache/inmemory/readFromStore.js",
42
35
  condition: "!isReference(value)",
43
36
  message: "Missing selection set for object of type %s returned for query field %s"
44
37
  },
45
-
46
38
  11: {
47
39
  file: "@apollo/client/cache/inmemory/writeToStore.js",
48
40
  message: "Could not identify object %s"
49
41
  },
50
-
51
42
  13: {
52
43
  file: "@apollo/client/cache/inmemory/writeToStore.js",
53
44
  message: "No fragment named %s"
54
45
  },
55
-
56
46
  15: {
57
47
  file: "@apollo/client/core/ApolloClient.js",
58
-
59
48
  message: "To initialize Apollo Client, you must specify a 'cache' property " +
60
49
  "in the options object. \n" +
61
50
  "For more information, please visit: https://go.apollo.dev/c/docs"
62
51
  },
63
-
64
52
  16: {
65
53
  file: "@apollo/client/core/ApolloClient.js",
66
54
  condition: "options.fetchPolicy !== \"cache-and-network\"",
67
-
68
55
  message: "The cache-and-network fetchPolicy does not work with client.query, because " +
69
56
  "client.query can only return a single result. Please use client.watchQuery " +
70
57
  "to receive multiple results from the cache and the network, or consider " +
71
58
  "using a different fetchPolicy, such as cache-first or network-only."
72
59
  },
73
-
74
60
  18: {
75
61
  file: "@apollo/client/core/LocalState.js",
76
62
  condition: "fragment",
77
63
  message: "No fragment named %s"
78
64
  },
79
-
80
65
  19: {
81
66
  file: "@apollo/client/core/LocalState.js",
82
67
  condition: "fragment",
83
68
  message: "No fragment named %s"
84
69
  },
85
-
86
70
  22: {
87
71
  file: "@apollo/client/core/ObservableQuery.js",
88
72
  condition: "pollInterval",
89
73
  message: "Attempted to start a polling query without a polling interval."
90
74
  },
91
-
92
75
  25: {
93
76
  file: "@apollo/client/core/QueryManager.js",
94
77
  message: "QueryManager stopped while query was in flight"
95
78
  },
96
-
97
79
  26: {
98
80
  file: "@apollo/client/core/QueryManager.js",
99
81
  condition: "mutation",
100
82
  message: "mutation option is required. You must specify your GraphQL document in the mutation option."
101
83
  },
102
-
103
84
  27: {
104
85
  file: "@apollo/client/core/QueryManager.js",
105
86
  condition: "fetchPolicy === \"network-only\" || fetchPolicy === \"no-cache\"",
106
87
  message: "Mutations support only 'network-only' or 'no-cache' fetchPolicy strings. The default `network-only` behavior automatically writes mutation results to the cache. Passing `no-cache` skips the cache write."
107
88
  },
108
-
109
89
  28: {
110
90
  file: "@apollo/client/core/QueryManager.js",
111
91
  condition: "options.query",
112
-
113
92
  message: "query option is required. You must specify your GraphQL document " +
114
93
  "in the query option."
115
94
  },
116
-
117
95
  29: {
118
96
  file: "@apollo/client/core/QueryManager.js",
119
97
  condition: "options.query.kind === \"Document\"",
120
98
  message: 'You must wrap the query string in a "gql" tag.'
121
99
  },
122
-
123
100
  30: {
124
101
  file: "@apollo/client/core/QueryManager.js",
125
102
  condition: "!options.returnPartialData",
126
103
  message: "returnPartialData option only supported on watchQuery."
127
104
  },
128
-
129
105
  31: {
130
106
  file: "@apollo/client/core/QueryManager.js",
131
107
  condition: "!options.pollInterval",
132
108
  message: "pollInterval option only supported on watchQuery."
133
109
  },
134
-
135
110
  32: {
136
111
  file: "@apollo/client/core/QueryManager.js",
137
112
  message: "Store reset while query was in flight (not completed in link chain)"
138
113
  },
139
-
140
114
  36: {
141
115
  file: "@apollo/client/link/core/ApolloLink.js",
142
116
  message: "request is not implemented"
143
117
  },
144
-
145
118
  37: {
146
119
  file: "@apollo/client/link/http/checkFetcher.js",
147
120
  message: "\n\"fetch\" has not been found globally and no fetcher has been configured. To fix this, install a fetch package (like https://www.npmjs.com/package/cross-fetch), instantiate the fetcher, and pass it into your HttpLink constructor. For example:\n\nimport fetch from 'cross-fetch';\nimport { ApolloClient, HttpLink } from '@apollo/client';\nconst client = new ApolloClient({\n link: new HttpLink({ uri: '/graphql', fetch })\n});\n "
148
121
  },
149
-
150
122
  39: {
151
123
  file: "@apollo/client/link/http/serializeFetchParameter.js",
152
124
  message: "Network request failed. %s is not serializable: %s"
153
125
  },
154
-
155
126
  40: {
156
127
  file: "@apollo/client/link/persisted-queries/index.js",
157
128
  condition: "options &&\n (typeof options.sha256 === \"function\" ||\n typeof options.generateHash === \"function\")",
158
-
159
129
  message: 'Missing/invalid "sha256" or "generateHash" function. Please ' +
160
130
  'configure one using the "createPersistedQueryLink(options)" options ' +
161
131
  "parameter."
162
132
  },
163
-
164
133
  41: {
165
134
  file: "@apollo/client/link/persisted-queries/index.js",
166
135
  condition: "forward",
167
136
  message: "PersistedQueryLink cannot be the last link in the chain."
168
137
  },
169
-
170
138
  43: {
171
139
  file: "@apollo/client/link/utils/validateOperation.js",
172
140
  message: "illegal argument: %s"
173
141
  },
174
-
175
142
  44: {
176
143
  file: "@apollo/client/react/context/ApolloConsumer.js",
177
144
  condition: "context && context.client",
178
-
179
145
  message: 'Could not find "client" in the context of ApolloConsumer. ' +
180
146
  "Wrap the root component in an <ApolloProvider>."
181
147
  },
182
-
183
148
  45: {
184
149
  file: "@apollo/client/react/context/ApolloContext.js",
185
150
  condition: "\"createContext\" in React",
186
-
187
151
  message: "Invoking `getApolloContext` in an environment where `React.createContext` is not available.\n" +
188
152
  "The Apollo Client functionality you are trying to use is only available in React Client Components.\n" +
189
153
  'Please make sure to add "use client" at the top of your file.\n' +
190
154
  "For more information, see https://nextjs.org/docs/getting-started/react-essentials#client-components"
191
155
  },
192
-
193
156
  46: {
194
157
  file: "@apollo/client/react/context/ApolloProvider.js",
195
158
  condition: "context.client",
196
-
197
159
  message: "ApolloProvider was not passed a client instance. Make " +
198
160
  'sure you pass in your client via the "client" prop.'
199
161
  },
200
-
201
162
  47: {
202
163
  file: "@apollo/client/react/hoc/hoc-utils.js",
203
164
  condition: "this.withRef",
204
-
205
165
  message: "To access the wrapped instance, you need to specify " +
206
166
  "{ withRef: true } in the options"
207
167
  },
208
-
209
168
  48: {
210
169
  file: "@apollo/client/react/hoc/withApollo.js",
211
170
  condition: "operationOptions.withRef",
212
-
213
171
  message: "To access the wrapped instance, you need to specify " +
214
172
  "{ withRef: true } in the options"
215
173
  },
216
-
217
174
  49: {
218
175
  file: "@apollo/client/react/hooks/useApolloClient.js",
219
176
  condition: "!!client",
220
-
221
177
  message: 'Could not find "client" in the context or passed in as an option. ' +
222
178
  "Wrap the root component in an <ApolloProvider>, or pass an ApolloClient " +
223
179
  "instance in via options."
224
180
  },
225
-
226
181
  51: {
227
182
  file: "@apollo/client/react/hooks/useReadQuery.js",
228
183
  condition: "internalQueryRef.promiseCache",
229
-
230
184
  message: "It appears that `useReadQuery` was used outside of `useBackgroundQuery`. " +
231
185
  "`useReadQuery` is only supported for use with `useBackgroundQuery`. " +
232
186
  "Please ensure you are passing the `queryRef` returned from `useBackgroundQuery`."
233
187
  },
234
-
235
188
  56: {
236
189
  file: "@apollo/client/react/hooks/useSuspenseQuery.js",
237
190
  condition: "supportedFetchPolicies.includes(fetchPolicy)",
238
191
  message: "The fetch policy `%s` is not supported with suspense."
239
192
  },
240
-
241
193
  59: {
242
194
  file: "@apollo/client/react/parser/index.js",
243
195
  condition: "!!document && !!document.kind",
244
-
245
196
  message: "Argument of %s passed to parser was not a valid GraphQL " +
246
197
  "DocumentNode. You may need to use 'graphql-tag' or another method " +
247
198
  "to convert your operation into a document"
248
199
  },
249
-
250
200
  60: {
251
201
  file: "@apollo/client/react/parser/index.js",
252
202
  condition: "!fragments.length ||\n queries.length ||\n mutations.length ||\n subscriptions.length",
253
-
254
203
  message: "Passing only a fragment to 'graphql' is not yet supported. " +
255
204
  "You must include a query, subscription or mutation as well"
256
205
  },
257
-
258
206
  61: {
259
207
  file: "@apollo/client/react/parser/index.js",
260
208
  condition: "queries.length + mutations.length + subscriptions.length <= 1",
261
-
262
209
  message: "react-apollo only supports a query, subscription, or a mutation per HOC. " +
263
210
  "%s had %s queries, %s " +
264
211
  "subscriptions and %s mutations. " +
265
212
  "You can use 'compose' to join multiple operation types to a component"
266
213
  },
267
-
268
214
  62: {
269
215
  file: "@apollo/client/react/parser/index.js",
270
216
  condition: "definitions.length === 1",
271
-
272
217
  message: "react-apollo only supports one definition per HOC. %s had " +
273
218
  "%s definitions. " +
274
219
  "You can use 'compose' to join multiple operation types to a component"
275
220
  },
276
-
277
221
  63: {
278
222
  file: "@apollo/client/react/parser/index.js",
279
223
  condition: "operation.type === type",
280
224
  message: "Running a %s requires a graphql " + "%s, but a %s was used instead."
281
225
  },
282
-
283
226
  64: {
284
227
  file: "@apollo/client/testing/core/mocking/mockLink.js",
285
228
  condition: "queryWithoutConnection",
286
229
  message: "query is required"
287
230
  },
288
-
289
231
  65: {
290
232
  file: "@apollo/client/utilities/graphql/DocumentTransform.js",
291
233
  condition: "Array.isArray(cacheKeys)",
292
234
  message: "`getCacheKey` must return an array or undefined"
293
235
  },
294
-
295
236
  66: {
296
237
  file: "@apollo/client/utilities/graphql/directives.js",
297
238
  condition: "evaledValue !== void 0",
298
239
  message: "Invalid variable referenced in @%s directive."
299
240
  },
300
-
301
241
  67: {
302
242
  file: "@apollo/client/utilities/graphql/directives.js",
303
243
  condition: "directiveArguments && directiveArguments.length === 1",
304
244
  message: "Incorrect number of arguments for the @%s directive."
305
245
  },
306
-
307
246
  68: {
308
247
  file: "@apollo/client/utilities/graphql/directives.js",
309
248
  condition: "ifArgument.name && ifArgument.name.value === \"if\"",
310
249
  message: "Invalid argument for the @%s directive."
311
250
  },
312
-
313
251
  69: {
314
252
  file: "@apollo/client/utilities/graphql/directives.js",
315
253
  condition: "ifValue &&\n (ifValue.kind === \"Variable\" || ifValue.kind === \"BooleanValue\")",
316
254
  message: "Argument for the @%s directive must be a variable or a boolean value."
317
255
  },
318
-
319
256
  70: {
320
257
  file: "@apollo/client/utilities/graphql/fragments.js",
321
-
322
258
  message: "Found a %s operation%s. " +
323
259
  "No operations are allowed when using a fragment as a query. Only fragments are allowed."
324
260
  },
325
-
326
261
  71: {
327
262
  file: "@apollo/client/utilities/graphql/fragments.js",
328
263
  condition: "fragments.length === 1",
329
264
  message: "Found %s fragments. `fragmentName` must be provided when there is not exactly 1 fragment."
330
265
  },
331
-
332
266
  72: {
333
267
  file: "@apollo/client/utilities/graphql/fragments.js",
334
268
  condition: "fragment",
335
269
  message: "No fragment named %s"
336
270
  },
337
-
338
271
  73: {
339
272
  file: "@apollo/client/utilities/graphql/getFromAST.js",
340
273
  condition: "doc && doc.kind === \"Document\"",
341
274
  message: "Expecting a parsed GraphQL document. Perhaps you need to wrap the query string in a \"gql\" tag? http://docs.apollostack.com/apollo-client/core.html#gql"
342
275
  },
343
-
344
276
  74: {
345
277
  file: "@apollo/client/utilities/graphql/getFromAST.js",
346
278
  message: "Schema type definitions not allowed in queries. Found: \"%s\""
347
279
  },
348
-
349
280
  75: {
350
281
  file: "@apollo/client/utilities/graphql/getFromAST.js",
351
282
  condition: "operations.length <= 1",
352
283
  message: "Ambiguous GraphQL document: contains %s operations"
353
284
  },
354
-
355
285
  76: {
356
286
  file: "@apollo/client/utilities/graphql/getFromAST.js",
357
287
  condition: "queryDef && queryDef.operation === \"query\"",
358
288
  message: "Must contain a query definition."
359
289
  },
360
-
361
290
  77: {
362
291
  file: "@apollo/client/utilities/graphql/getFromAST.js",
363
292
  condition: "doc.kind === \"Document\"",
364
293
  message: "Expecting a parsed GraphQL document. Perhaps you need to wrap the query string in a \"gql\" tag? http://docs.apollostack.com/apollo-client/core.html#gql"
365
294
  },
366
-
367
295
  78: {
368
296
  file: "@apollo/client/utilities/graphql/getFromAST.js",
369
297
  condition: "doc.definitions.length <= 1",
370
298
  message: "Fragment must have exactly one definition."
371
299
  },
372
-
373
300
  79: {
374
301
  file: "@apollo/client/utilities/graphql/getFromAST.js",
375
302
  condition: "fragmentDef.kind === \"FragmentDefinition\"",
376
303
  message: "Must be a fragment definition."
377
304
  },
378
-
379
305
  80: {
380
306
  file: "@apollo/client/utilities/graphql/getFromAST.js",
381
307
  message: "Expected a parsed GraphQL query with a query, mutation, subscription, or a fragment."
382
308
  },
383
-
384
309
  81: {
385
310
  file: "@apollo/client/utilities/graphql/storeUtils.js",
386
-
387
311
  message: "The inline argument \"%s\" of kind \"%s\"" +
388
312
  "is not supported. Use variables instead of inline arguments to " +
389
313
  "overcome this limitation."
390
314
  }
391
315
  };
392
-
393
316
  const devDebug = {
394
317
  17: {
395
318
  file: "@apollo/client/core/ApolloClient.js",
396
319
  message: "In client.refetchQueries, Promise.all promise rejected with error %o"
397
320
  },
398
-
399
321
  24: {
400
322
  file: "@apollo/client/core/ObservableQuery.js",
401
323
  message: "Missing cache result fields: %o"
402
324
  }
403
325
  };
404
-
405
326
  const devLog = {};
406
-
407
327
  const devWarn = {
408
328
  2: {
409
329
  file: "@apollo/client/cache/inmemory/entityStore.js",
410
-
411
330
  message: "cache.modify: You are trying to write a Reference that is not part of the store: %o\n" +
412
331
  "Please make sure to set the `mergeIntoStore` parameter to `true` when creating a Reference that is not part of the store yet:\n" +
413
332
  "`toReference(object, true)`"
414
333
  },
415
-
416
334
  3: {
417
335
  file: "@apollo/client/cache/inmemory/entityStore.js",
418
-
419
336
  message: "cache.modify: Writing an array with a mix of both References and Objects will not result in the Objects being normalized correctly.\n" +
420
337
  "Please convert the object instance %o to a Reference before writing it to the cache by calling `toReference(object, true)`."
421
338
  },
422
-
423
339
  6: {
424
340
  file: "@apollo/client/cache/inmemory/policies.js",
425
341
  message: "Inferring subtype %s of supertype %s"
426
342
  },
427
-
428
343
  7: {
429
344
  file: "@apollo/client/cache/inmemory/policies.js",
430
345
  message: "Undefined 'from' passed to readField with arguments %s"
431
346
  },
432
-
433
347
  14: {
434
348
  file: "@apollo/client/cache/inmemory/writeToStore.js",
435
349
  message: "Cache data may be lost when replacing the %s field of a %s object.\n\nThis could cause additional (usually avoidable) network requests to fetch data that were otherwise cached.\n\nTo address this problem (which is not a bug in Apollo Client), %sdefine a custom merge function for the %s field, so InMemoryCache can safely merge these objects:\n\n existing: %s\n incoming: %s\n\nFor more information about these options, please refer to the documentation:\n\n * Ensuring entity objects have IDs: https://go.apollo.dev/c/generating-unique-identifiers\n * Defining custom merge functions: https://go.apollo.dev/c/merging-non-normalized-objects\n"
436
350
  },
437
-
438
351
  20: {
439
352
  file: "@apollo/client/core/ObservableQuery.js",
440
353
  message: "Called refetch(%o) for query %o, which does not declare a $variables variable.\nDid you mean to call refetch(variables) instead of refetch({ variables })?"
441
354
  },
442
-
443
355
  33: {
444
356
  file: "@apollo/client/core/QueryManager.js",
445
357
  message: "Unknown query named \"%s\" requested in refetchQueries options.include array"
446
358
  },
447
-
448
359
  34: {
449
360
  file: "@apollo/client/core/QueryManager.js",
450
361
  message: "Unknown query %s requested in refetchQueries options.include array"
451
362
  },
452
-
453
363
  35: {
454
364
  file: "@apollo/client/link/core/ApolloLink.js",
455
365
  message: "You are calling concat on a terminating link, which will have no effect %o"
456
366
  },
457
-
458
367
  38: {
459
368
  file: "@apollo/client/link/http/createHttpLink.js",
460
369
  message: "Multipart-subscriptions do not support @defer"
461
370
  },
462
-
463
371
  42: {
464
372
  file: "@apollo/client/link/utils/toPromise.js",
465
373
  message: "Promise Wrapper does not support multiple results from Observable"
466
374
  },
467
-
468
375
  50: {
469
376
  file: "@apollo/client/react/hooks/useQuery.js",
470
377
  message: "Calling default no-op implementation of InternalState#forceUpdate"
471
378
  },
472
-
473
379
  52: {
474
380
  file: "@apollo/client/react/hooks/useSubscription.js",
475
381
  message: "'useSubscription' supports only the 'onSubscriptionData' or 'onData' option, but not both. Only the 'onData' option will be used."
476
382
  },
477
-
478
383
  53: {
479
384
  file: "@apollo/client/react/hooks/useSubscription.js",
480
385
  message: "'onSubscriptionData' is deprecated and will be removed in a future major version. Please use the 'onData' option instead."
481
386
  },
482
-
483
387
  54: {
484
388
  file: "@apollo/client/react/hooks/useSubscription.js",
485
389
  message: "'useSubscription' supports only the 'onSubscriptionComplete' or 'onComplete' option, but not both. Only the 'onComplete' option will be used."
486
390
  },
487
-
488
391
  55: {
489
392
  file: "@apollo/client/react/hooks/useSubscription.js",
490
393
  message: "'onSubscriptionComplete' is deprecated and will be removed in a future major version. Please use the 'onComplete' option instead."
491
394
  },
492
-
493
395
  57: {
494
396
  file: "@apollo/client/react/hooks/useSuspenseQuery.js",
495
397
  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."
496
398
  },
497
-
498
399
  83: {
499
400
  file: "@apollo/client/utilities/graphql/transform.js",
500
-
501
401
  message: "Removing an @connection directive even though it does not have a key. " +
502
402
  "You may want to use the key parameter to specify a store key."
503
403
  }
504
404
  };
505
-
506
405
  const devError = {
507
406
  12: {
508
407
  file: "@apollo/client/cache/inmemory/writeToStore.js",
509
408
  message: "Missing field '%s' while writing result %o"
510
409
  },
511
-
512
410
  21: {
513
411
  file: "@apollo/client/core/ObservableQuery.js",
514
412
  message: "Unhandled GraphQL subscription error"
515
413
  },
516
-
517
414
  23: {
518
415
  file: "@apollo/client/core/ObservableQuery.js",
519
416
  message: "Unhandled error"
520
417
  },
521
-
522
418
  58: {
523
419
  file: "@apollo/client/react/hooks/useSyncExternalStore.js",
524
420
  message: "The result of getSnapshot should be cached to avoid an infinite loop"
525
421
  },
526
-
527
422
  82: {
528
423
  file: "@apollo/client/utilities/graphql/transform.js",
529
424
  message: "Could not find operation or fragment"
530
425
  }
531
426
  };
532
427
 
533
- var version = "3.8.7";
428
+ var version = "3.8.9";
534
429
 
535
430
  function maybe(thunk) {
536
431
  try {
@@ -542,7 +437,8 @@ function maybe(thunk) {
542
437
  var global$1 = (maybe(function () { return globalThis; }) ||
543
438
  maybe(function () { return window; }) ||
544
439
  maybe(function () { return self; }) ||
545
- maybe(function () { return global; }) || maybe(function () {
440
+ maybe(function () { return global; }) ||
441
+ maybe(function () {
546
442
  return maybe.constructor("return this")();
547
443
  }));
548
444
 
@@ -596,9 +492,7 @@ Object.assign(function invariant(condition, message) {
596
492
  });
597
493
  var ApolloErrorMessageHandler = Symbol.for("ApolloErrorMessageHandler_" + version);
598
494
  function stringify(arg) {
599
- return typeof arg == "string"
600
- ? arg
601
- : stringifyForDisplay(arg, 2).slice(0, 1000);
495
+ return typeof arg == "string" ? arg : (stringifyForDisplay(arg, 2).slice(0, 1000));
602
496
  }
603
497
  function getHandledErrorMsg(message, messageArgs) {
604
498
  if (messageArgs === void 0) { messageArgs = []; }