@apollo/client 4.0.0-rc.2 → 4.0.0-rc.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (800) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/__cjs/cache/core/cache.cjs.map +1 -1
  3. package/__cjs/cache/index.cjs.map +1 -1
  4. package/__cjs/cache/inmemory/entityStore.cjs.map +1 -1
  5. package/__cjs/cache/inmemory/helpers.cjs.map +1 -1
  6. package/__cjs/cache/inmemory/inMemoryCache.cjs.map +1 -1
  7. package/__cjs/cache/inmemory/key-extractor.cjs.map +1 -1
  8. package/__cjs/cache/inmemory/policies.cjs.map +1 -1
  9. package/__cjs/cache/inmemory/reactiveVars.cjs.map +1 -1
  10. package/__cjs/cache/inmemory/readFromStore.cjs.map +1 -1
  11. package/__cjs/cache/inmemory/writeToStore.cjs.map +1 -1
  12. package/__cjs/core/ApolloClient.cjs +20 -4
  13. package/__cjs/core/ApolloClient.cjs.map +1 -1
  14. package/__cjs/core/ApolloClient.d.cts +17 -2
  15. package/__cjs/core/ObservableQuery.cjs.map +1 -1
  16. package/__cjs/core/QueryInfo.cjs.map +1 -1
  17. package/__cjs/core/QueryManager.cjs.map +1 -1
  18. package/__cjs/core/equalByQuery.cjs.map +1 -1
  19. package/__cjs/core/index.cjs.map +1 -1
  20. package/__cjs/core/networkStatus.cjs.map +1 -1
  21. package/__cjs/dev/index.cjs.map +1 -1
  22. package/__cjs/dev/loadDevMessages.cjs.map +1 -1
  23. package/__cjs/dev/loadErrorMessageHandler.cjs.map +1 -1
  24. package/__cjs/dev/loadErrorMessages.cjs.map +1 -1
  25. package/__cjs/dev/setErrorMessageHandler.cjs.map +1 -1
  26. package/__cjs/dev/symbol.cjs.map +1 -1
  27. package/__cjs/errors/CombinedGraphQLErrors.cjs.map +1 -1
  28. package/__cjs/errors/CombinedProtocolErrors.cjs.map +1 -1
  29. package/__cjs/errors/LinkError.cjs.map +1 -1
  30. package/__cjs/errors/LocalStateError.cjs.map +1 -1
  31. package/__cjs/errors/ServerError.cjs.map +1 -1
  32. package/__cjs/errors/ServerParseError.cjs.map +1 -1
  33. package/__cjs/errors/UnconventionalError.cjs.map +1 -1
  34. package/__cjs/errors/index.cjs.map +1 -1
  35. package/__cjs/errors/isErrorLike.cjs.map +1 -1
  36. package/__cjs/errors/utils.cjs.map +1 -1
  37. package/__cjs/incremental/handlers/defer20220824.cjs.map +1 -1
  38. package/__cjs/incremental/index.cjs.map +1 -1
  39. package/__cjs/invariantErrorCodes.cjs.map +1 -1
  40. package/__cjs/link/batch/batchLink.cjs.map +1 -1
  41. package/__cjs/link/batch/index.cjs.map +1 -1
  42. package/__cjs/link/batch-http/batchHttpLink.cjs.map +1 -1
  43. package/__cjs/link/batch-http/index.cjs.map +1 -1
  44. package/__cjs/link/client-awareness/index.cjs.map +1 -1
  45. package/__cjs/link/core/concat.cjs.map +1 -1
  46. package/__cjs/link/core/empty.cjs.map +1 -1
  47. package/__cjs/link/core/execute.cjs.map +1 -1
  48. package/__cjs/link/core/from.cjs.map +1 -1
  49. package/__cjs/link/core/split.cjs.map +1 -1
  50. package/__cjs/link/http/BaseHttpLink.cjs.map +1 -1
  51. package/__cjs/link/http/HttpLink.cjs.map +1 -1
  52. package/__cjs/link/http/index.cjs.map +1 -1
  53. package/__cjs/link/http/parseAndCheckHttpResponse.cjs.map +1 -1
  54. package/__cjs/link/http/rewriteURIForGET.cjs.map +1 -1
  55. package/__cjs/link/http/selectHttpOptionsAndBody.cjs.map +1 -1
  56. package/__cjs/link/index.cjs.map +1 -1
  57. package/__cjs/link/remove-typename/index.cjs.map +1 -1
  58. package/__cjs/link/remove-typename/removeTypenameFromVariables.cjs.map +1 -1
  59. package/__cjs/link/retry/delayFunction.cjs.map +1 -1
  60. package/__cjs/link/retry/index.cjs.map +1 -1
  61. package/__cjs/link/retry/retryFunction.cjs.map +1 -1
  62. package/__cjs/link/retry/retryLink.cjs.map +1 -1
  63. package/__cjs/link/utils/createOperation.cjs.map +1 -1
  64. package/__cjs/link/utils/filterOperationVariables.cjs.map +1 -1
  65. package/__cjs/link/utils/index.cjs.map +1 -1
  66. package/__cjs/link/utils/transformOperation.cjs.map +1 -1
  67. package/__cjs/link/utils/validateOperation.cjs.map +1 -1
  68. package/__cjs/local-state/LocalState.cjs.map +1 -1
  69. package/__cjs/local-state/index.cjs.map +1 -1
  70. package/__cjs/masking/index.cjs.map +1 -1
  71. package/__cjs/masking/maskDefinition.cjs.map +1 -1
  72. package/__cjs/masking/maskFragment.cjs.map +1 -1
  73. package/__cjs/masking/maskOperation.cjs.map +1 -1
  74. package/__cjs/masking/utils.cjs.map +1 -1
  75. package/__cjs/react/context/ApolloContext.cjs.map +1 -1
  76. package/__cjs/react/hooks/constants.cjs.map +1 -1
  77. package/__cjs/react/hooks/internal/__use.cjs.map +1 -1
  78. package/__cjs/react/hooks/internal/index.cjs.map +1 -1
  79. package/__cjs/react/hooks/internal/useDeepMemo.cjs.map +1 -1
  80. package/__cjs/react/hooks/internal/useIsomorphicLayoutEffect.cjs.map +1 -1
  81. package/__cjs/react/hooks/internal/useRenderGuard.cjs.map +1 -1
  82. package/__cjs/react/hooks/internal/validateSuspenseHookOptions.cjs.map +1 -1
  83. package/__cjs/react/hooks/internal/wrapHook.cjs.map +1 -1
  84. package/__cjs/react/hooks/useApolloClient.cjs.map +1 -1
  85. package/__cjs/react/hooks/useBackgroundQuery.cjs.map +1 -1
  86. package/__cjs/react/hooks/useFragment.cjs.map +1 -1
  87. package/__cjs/react/hooks/useLazyQuery.cjs.map +1 -1
  88. package/__cjs/react/hooks/useLoadableQuery.cjs.map +1 -1
  89. package/__cjs/react/hooks/useMutation.cjs.map +1 -1
  90. package/__cjs/react/hooks/useQuery.cjs.map +1 -1
  91. package/__cjs/react/hooks/useQueryRefHandlers.cjs.map +1 -1
  92. package/__cjs/react/hooks/useReactiveVar.cjs.map +1 -1
  93. package/__cjs/react/hooks/useReadQuery.cjs.map +1 -1
  94. package/__cjs/react/hooks/useSubscription.cjs.map +1 -1
  95. package/__cjs/react/hooks/useSuspenseFragment.cjs.map +1 -1
  96. package/__cjs/react/hooks/useSuspenseQuery.cjs.map +1 -1
  97. package/__cjs/react/hooks/useSyncExternalStore.cjs.map +1 -1
  98. package/__cjs/react/index.cjs +2 -1
  99. package/__cjs/react/index.cjs.map +1 -1
  100. package/__cjs/react/index.d.cts +1 -0
  101. package/__cjs/react/index.react-server.cjs.map +1 -1
  102. package/__cjs/react/internal/cache/SuspenseCache.cjs.map +1 -1
  103. package/__cjs/react/internal/cache/getSuspenseCache.cjs.map +1 -1
  104. package/__cjs/react/internal/compiler-runtime/index.cjs +32 -0
  105. package/__cjs/react/internal/compiler-runtime/index.cjs.map +1 -0
  106. package/__cjs/react/internal/compiler-runtime/index.d.cts +8 -0
  107. package/__cjs/react/internal/index.cjs.map +1 -1
  108. package/__cjs/react/query-preloader/createQueryPreloader.cjs.map +1 -1
  109. package/__cjs/react/ssr/getDataFromTree.cjs.map +1 -1
  110. package/__cjs/react/ssr/index.cjs.map +1 -1
  111. package/__cjs/react/ssr/renderToStringWithData.cjs.map +1 -1
  112. package/__cjs/react/ssr/useSSRQuery.cjs.map +1 -1
  113. package/__cjs/testing/core/mocking/mockLink.cjs.map +1 -1
  114. package/__cjs/testing/index.cjs.map +1 -1
  115. package/__cjs/testing/react/index.cjs.map +1 -1
  116. package/__cjs/utilities/caching/index.cjs.map +1 -1
  117. package/__cjs/utilities/caching/sizes.cjs.map +1 -1
  118. package/__cjs/utilities/common/stripTypename.cjs.map +1 -1
  119. package/__cjs/utilities/environment/index.cjs.map +1 -1
  120. package/__cjs/utilities/environment/index.development.cjs.map +1 -1
  121. package/__cjs/utilities/environment/index.production.cjs.map +1 -1
  122. package/__cjs/utilities/graphql/isFormattedExecutionResult.cjs.map +1 -1
  123. package/__cjs/utilities/graphql/operations.cjs.map +1 -1
  124. package/__cjs/utilities/graphql/print.cjs.map +1 -1
  125. package/__cjs/utilities/graphql/storeUtils.cjs.map +1 -1
  126. package/__cjs/utilities/graphql/transform.cjs.map +1 -1
  127. package/__cjs/utilities/index.cjs.map +1 -1
  128. package/__cjs/utilities/internal/argumentsObjectFromField.cjs.map +1 -1
  129. package/__cjs/utilities/internal/caches.cjs.map +1 -1
  130. package/__cjs/utilities/internal/canUseDOM.cjs.map +1 -1
  131. package/__cjs/utilities/internal/checkDocument.cjs.map +1 -1
  132. package/__cjs/utilities/internal/cloneDeep.cjs.map +1 -1
  133. package/__cjs/utilities/internal/compact.cjs.map +1 -1
  134. package/__cjs/utilities/internal/createFragmentMap.cjs.map +1 -1
  135. package/__cjs/utilities/internal/createFulfilledPromise.cjs.map +1 -1
  136. package/__cjs/utilities/internal/createRejectedPromise.cjs.map +1 -1
  137. package/__cjs/utilities/internal/dealias.cjs.map +1 -1
  138. package/__cjs/utilities/internal/decoratePromise.cjs.map +1 -1
  139. package/__cjs/utilities/internal/deepFreeze.cjs.map +1 -1
  140. package/__cjs/utilities/internal/filterMap.cjs.map +1 -1
  141. package/__cjs/utilities/internal/getDefaultValues.cjs.map +1 -1
  142. package/__cjs/utilities/internal/getFragmentDefinition.cjs.map +1 -1
  143. package/__cjs/utilities/internal/getFragmentDefinitions.cjs.map +1 -1
  144. package/__cjs/utilities/internal/getFragmentFromSelection.cjs.map +1 -1
  145. package/__cjs/utilities/internal/getFragmentQueryDocument.cjs.map +1 -1
  146. package/__cjs/utilities/internal/getGraphQLErrorsFromResult.cjs.map +1 -1
  147. package/__cjs/utilities/internal/getMainDefinition.cjs.map +1 -1
  148. package/__cjs/utilities/internal/getMemoryInternals.cjs.map +1 -1
  149. package/__cjs/utilities/internal/getOperationDefinition.cjs.map +1 -1
  150. package/__cjs/utilities/internal/getOperationName.cjs.map +1 -1
  151. package/__cjs/utilities/internal/getQueryDefinition.cjs.map +1 -1
  152. package/__cjs/utilities/internal/getStoreKeyName.cjs.map +1 -1
  153. package/__cjs/utilities/internal/globals/global.cjs.map +1 -1
  154. package/__cjs/utilities/internal/globals/index.cjs.map +1 -1
  155. package/__cjs/utilities/internal/globals/maybe.cjs.map +1 -1
  156. package/__cjs/utilities/internal/graphQLResultHasError.cjs.map +1 -1
  157. package/__cjs/utilities/internal/hasDirectives.cjs.map +1 -1
  158. package/__cjs/utilities/internal/hasForcedResolvers.cjs.map +1 -1
  159. package/__cjs/utilities/internal/index.cjs.map +1 -1
  160. package/__cjs/utilities/internal/index.production.cjs.map +1 -1
  161. package/__cjs/utilities/internal/isArray.cjs.map +1 -1
  162. package/__cjs/utilities/internal/isDocumentNode.cjs.map +1 -1
  163. package/__cjs/utilities/internal/isField.cjs.map +1 -1
  164. package/__cjs/utilities/internal/isNonEmptyArray.cjs.map +1 -1
  165. package/__cjs/utilities/internal/isNonNullObject.cjs.map +1 -1
  166. package/__cjs/utilities/internal/isPlainObject.cjs.map +1 -1
  167. package/__cjs/utilities/internal/makeReference.cjs.map +1 -1
  168. package/__cjs/utilities/internal/makeUniqueId.cjs.map +1 -1
  169. package/__cjs/utilities/internal/maybeDeepFreeze.cjs.map +1 -1
  170. package/__cjs/utilities/internal/mergeDeep.cjs.map +1 -1
  171. package/__cjs/utilities/internal/mergeDeepArray.cjs.map +1 -1
  172. package/__cjs/utilities/internal/mergeOptions.cjs.map +1 -1
  173. package/__cjs/utilities/internal/omitDeep.cjs.map +1 -1
  174. package/__cjs/utilities/internal/preventUnhandledRejection.cjs.map +1 -1
  175. package/__cjs/utilities/internal/removeDirectivesFromDocument.cjs.map +1 -1
  176. package/__cjs/utilities/internal/resultKeyNameFromField.cjs.map +1 -1
  177. package/__cjs/utilities/internal/shouldInclude.cjs.map +1 -1
  178. package/__cjs/utilities/internal/storeKeyNameFromField.cjs.map +1 -1
  179. package/__cjs/utilities/internal/stringifyForDisplay.cjs.map +1 -1
  180. package/__cjs/utilities/internal/toQueryResult.cjs.map +1 -1
  181. package/__cjs/utilities/internal/valueToObjectRepresentation.cjs.map +1 -1
  182. package/__cjs/utilities/invariant/index.cjs.map +1 -1
  183. package/__cjs/utilities/invariant/index.development.cjs.map +1 -1
  184. package/__cjs/utilities/policies/pagination.cjs.map +1 -1
  185. package/__cjs/utilities/shared/canonicalStringify.cjs.map +1 -1
  186. package/__cjs/utilities/subscriptions/relay/index.cjs.map +1 -1
  187. package/__cjs/version.cjs +1 -1
  188. package/__cjs/version.cjs.map +1 -1
  189. package/cache/core/cache.js.map +1 -1
  190. package/cache/core/types/Cache.d.ts +1 -1
  191. package/cache/core/types/Cache.js +1 -1
  192. package/cache/core/types/Cache.js.map +1 -1
  193. package/cache/core/types/DataProxy.d.ts +1 -1
  194. package/cache/core/types/DataProxy.js +1 -1
  195. package/cache/core/types/DataProxy.js.map +1 -1
  196. package/cache/core/types/common.d.ts +1 -1
  197. package/cache/core/types/common.js +1 -1
  198. package/cache/core/types/common.js.map +1 -1
  199. package/cache/index.d.ts +1 -1
  200. package/cache/index.js +1 -1
  201. package/cache/index.js.map +1 -1
  202. package/cache/inmemory/entityStore.d.ts +1 -1
  203. package/cache/inmemory/entityStore.js.map +1 -1
  204. package/cache/inmemory/fragmentRegistry.d.ts +1 -1
  205. package/cache/inmemory/fragmentRegistry.js +1 -1
  206. package/cache/inmemory/fragmentRegistry.js.map +1 -1
  207. package/cache/inmemory/helpers.d.ts +1 -1
  208. package/cache/inmemory/helpers.js +1 -1
  209. package/cache/inmemory/helpers.js.map +1 -1
  210. package/cache/inmemory/key-extractor.d.ts +1 -1
  211. package/cache/inmemory/key-extractor.js.map +1 -1
  212. package/cache/inmemory/policies.d.ts +1 -1
  213. package/cache/inmemory/policies.js.map +1 -1
  214. package/cache/inmemory/reactiveVars.d.ts +1 -1
  215. package/cache/inmemory/reactiveVars.js +1 -1
  216. package/cache/inmemory/reactiveVars.js.map +1 -1
  217. package/cache/inmemory/readFromStore.d.ts +1 -1
  218. package/cache/inmemory/readFromStore.js.map +1 -1
  219. package/cache/inmemory/types.d.ts +1 -1
  220. package/cache/inmemory/types.js +1 -1
  221. package/cache/inmemory/types.js.map +1 -1
  222. package/cache/inmemory/writeToStore.d.ts +1 -1
  223. package/cache/inmemory/writeToStore.js.map +1 -1
  224. package/core/ApolloClient.d.ts +17 -2
  225. package/core/ApolloClient.js +20 -4
  226. package/core/ApolloClient.js.map +1 -1
  227. package/core/QueryInfo.js.map +1 -1
  228. package/core/QueryManager.d.ts +1 -1
  229. package/core/QueryManager.js.map +1 -1
  230. package/core/equalByQuery.d.ts +1 -1
  231. package/core/equalByQuery.js +1 -1
  232. package/core/equalByQuery.js.map +1 -1
  233. package/core/index.d.ts +1 -1
  234. package/core/index.js +1 -1
  235. package/core/index.js.map +1 -1
  236. package/core/networkStatus.d.ts +1 -1
  237. package/core/networkStatus.js +1 -1
  238. package/core/networkStatus.js.map +1 -1
  239. package/core/types.js +1 -1
  240. package/core/types.js.map +1 -1
  241. package/core/watchQueryOptions.js +1 -1
  242. package/core/watchQueryOptions.js.map +1 -1
  243. package/dev/index.d.ts +1 -1
  244. package/dev/index.js +1 -1
  245. package/dev/index.js.map +1 -1
  246. package/dev/loadDevMessages.d.ts +1 -1
  247. package/dev/loadDevMessages.js +1 -1
  248. package/dev/loadDevMessages.js.map +1 -1
  249. package/dev/loadErrorMessageHandler.d.ts +1 -1
  250. package/dev/loadErrorMessageHandler.js +1 -1
  251. package/dev/loadErrorMessageHandler.js.map +1 -1
  252. package/dev/loadErrorMessages.d.ts +1 -1
  253. package/dev/loadErrorMessages.js +1 -1
  254. package/dev/loadErrorMessages.js.map +1 -1
  255. package/dev/setErrorMessageHandler.d.ts +1 -1
  256. package/dev/setErrorMessageHandler.js +1 -1
  257. package/dev/setErrorMessageHandler.js.map +1 -1
  258. package/dev/symbol.d.ts +1 -1
  259. package/dev/symbol.js +1 -1
  260. package/dev/symbol.js.map +1 -1
  261. package/errors/CombinedGraphQLErrors.d.ts +1 -1
  262. package/errors/CombinedGraphQLErrors.js +1 -1
  263. package/errors/CombinedGraphQLErrors.js.map +1 -1
  264. package/errors/CombinedProtocolErrors.d.ts +1 -1
  265. package/errors/CombinedProtocolErrors.js +1 -1
  266. package/errors/CombinedProtocolErrors.js.map +1 -1
  267. package/errors/LinkError.js.map +1 -1
  268. package/errors/LocalStateError.d.ts +1 -1
  269. package/errors/LocalStateError.js +1 -1
  270. package/errors/LocalStateError.js.map +1 -1
  271. package/errors/ServerError.d.ts +1 -1
  272. package/errors/ServerError.js +1 -1
  273. package/errors/ServerError.js.map +1 -1
  274. package/errors/ServerParseError.d.ts +1 -1
  275. package/errors/ServerParseError.js +1 -1
  276. package/errors/ServerParseError.js.map +1 -1
  277. package/errors/UnconventionalError.d.ts +1 -1
  278. package/errors/UnconventionalError.js +1 -1
  279. package/errors/UnconventionalError.js.map +1 -1
  280. package/errors/index.d.ts +1 -1
  281. package/errors/index.js +1 -1
  282. package/errors/index.js.map +1 -1
  283. package/errors/isErrorLike.d.ts +1 -1
  284. package/errors/isErrorLike.js +1 -1
  285. package/errors/isErrorLike.js.map +1 -1
  286. package/errors/utils.d.ts +1 -1
  287. package/errors/utils.js +1 -1
  288. package/errors/utils.js.map +1 -1
  289. package/incremental/handlers/defer20220824.d.ts +1 -1
  290. package/incremental/handlers/defer20220824.js +1 -1
  291. package/incremental/handlers/defer20220824.js.map +1 -1
  292. package/incremental/handlers/notImplemented.d.ts +1 -1
  293. package/incremental/index.d.ts +1 -1
  294. package/incremental/index.js.map +1 -1
  295. package/incremental/types.js +1 -1
  296. package/incremental/types.js.map +1 -1
  297. package/invariantErrorCodes.d.ts +1 -1
  298. package/invariantErrorCodes.js +4 -1
  299. package/invariantErrorCodes.js.map +1 -1
  300. package/legacyEntryPoints/react/internal/compiler-runtime/compiler-runtime.cjs +1 -0
  301. package/legacyEntryPoints/react/internal/compiler-runtime/compiler-runtime.d.cts +1 -0
  302. package/legacyEntryPoints/react/internal/compiler-runtime/index.d.ts +1 -0
  303. package/legacyEntryPoints/react/internal/compiler-runtime/index.js +1 -0
  304. package/link/batch/batchLink.d.ts +1 -1
  305. package/link/batch/batchLink.js +1 -1
  306. package/link/batch/batchLink.js.map +1 -1
  307. package/link/batch/batching.d.ts +1 -1
  308. package/link/batch/batching.js +1 -1
  309. package/link/batch/batching.js.map +1 -1
  310. package/link/batch/index.d.ts +1 -1
  311. package/link/batch/index.js +1 -1
  312. package/link/batch/index.js.map +1 -1
  313. package/link/batch-http/batchHttpLink.d.ts +1 -1
  314. package/link/batch-http/batchHttpLink.js +1 -1
  315. package/link/batch-http/batchHttpLink.js.map +1 -1
  316. package/link/batch-http/index.d.ts +1 -1
  317. package/link/batch-http/index.js +1 -1
  318. package/link/batch-http/index.js.map +1 -1
  319. package/link/client-awareness/ClientAwarenessLink.d.ts +1 -1
  320. package/link/client-awareness/ClientAwarenessLink.js +1 -1
  321. package/link/client-awareness/ClientAwarenessLink.js.map +1 -1
  322. package/link/client-awareness/index.d.ts +1 -1
  323. package/link/client-awareness/index.js +1 -1
  324. package/link/client-awareness/index.js.map +1 -1
  325. package/link/context/index.d.ts +1 -1
  326. package/link/context/index.js +1 -1
  327. package/link/context/index.js.map +1 -1
  328. package/link/core/concat.d.ts +1 -1
  329. package/link/core/concat.js +1 -1
  330. package/link/core/concat.js.map +1 -1
  331. package/link/core/empty.d.ts +1 -1
  332. package/link/core/empty.js +1 -1
  333. package/link/core/empty.js.map +1 -1
  334. package/link/core/execute.d.ts +1 -1
  335. package/link/core/execute.js +1 -1
  336. package/link/core/execute.js.map +1 -1
  337. package/link/core/from.d.ts +1 -1
  338. package/link/core/from.js +1 -1
  339. package/link/core/from.js.map +1 -1
  340. package/link/core/split.d.ts +1 -1
  341. package/link/core/split.js +1 -1
  342. package/link/core/split.js.map +1 -1
  343. package/link/core/types.d.ts +1 -1
  344. package/link/core/types.js +1 -1
  345. package/link/core/types.js.map +1 -1
  346. package/link/error/index.d.ts +1 -1
  347. package/link/error/index.js +1 -1
  348. package/link/error/index.js.map +1 -1
  349. package/link/http/BaseHttpLink.d.ts +1 -1
  350. package/link/http/BaseHttpLink.js +1 -1
  351. package/link/http/BaseHttpLink.js.map +1 -1
  352. package/link/http/HttpLink.d.ts +1 -1
  353. package/link/http/HttpLink.js +1 -1
  354. package/link/http/HttpLink.js.map +1 -1
  355. package/link/http/checkFetcher.d.ts +1 -1
  356. package/link/http/checkFetcher.js.map +1 -1
  357. package/link/http/createSignalIfSupported.d.ts +1 -1
  358. package/link/http/createSignalIfSupported.js +1 -1
  359. package/link/http/createSignalIfSupported.js.map +1 -1
  360. package/link/http/index.d.ts +1 -1
  361. package/link/http/index.js +1 -1
  362. package/link/http/index.js.map +1 -1
  363. package/link/http/parseAndCheckHttpResponse.d.ts +1 -1
  364. package/link/http/parseAndCheckHttpResponse.js.map +1 -1
  365. package/link/http/rewriteURIForGET.d.ts +1 -1
  366. package/link/http/rewriteURIForGET.js +1 -1
  367. package/link/http/rewriteURIForGET.js.map +1 -1
  368. package/link/http/selectHttpOptionsAndBody.d.ts +1 -1
  369. package/link/http/selectHttpOptionsAndBody.js +1 -1
  370. package/link/http/selectHttpOptionsAndBody.js.map +1 -1
  371. package/link/http/selectURI.d.ts +1 -1
  372. package/link/http/selectURI.js +1 -1
  373. package/link/http/selectURI.js.map +1 -1
  374. package/link/http/serializeFetchParameter.d.ts +1 -1
  375. package/link/http/serializeFetchParameter.js.map +1 -1
  376. package/link/index.d.ts +1 -1
  377. package/link/index.js +1 -1
  378. package/link/index.js.map +1 -1
  379. package/link/persisted-queries/index.d.ts +1 -1
  380. package/link/remove-typename/index.d.ts +1 -1
  381. package/link/remove-typename/index.js.map +1 -1
  382. package/link/remove-typename/removeTypenameFromVariables.d.ts +1 -1
  383. package/link/remove-typename/removeTypenameFromVariables.js +1 -1
  384. package/link/remove-typename/removeTypenameFromVariables.js.map +1 -1
  385. package/link/retry/delayFunction.d.ts +1 -1
  386. package/link/retry/delayFunction.js +1 -1
  387. package/link/retry/delayFunction.js.map +1 -1
  388. package/link/retry/index.d.ts +1 -1
  389. package/link/retry/index.js +1 -1
  390. package/link/retry/index.js.map +1 -1
  391. package/link/retry/retryFunction.d.ts +1 -1
  392. package/link/retry/retryFunction.js +1 -1
  393. package/link/retry/retryFunction.js.map +1 -1
  394. package/link/retry/retryLink.d.ts +1 -1
  395. package/link/retry/retryLink.js +1 -1
  396. package/link/retry/retryLink.js.map +1 -1
  397. package/link/schema/index.d.ts +1 -1
  398. package/link/schema/index.js +1 -1
  399. package/link/schema/index.js.map +1 -1
  400. package/link/subscriptions/index.d.ts +1 -1
  401. package/link/subscriptions/index.js +1 -1
  402. package/link/subscriptions/index.js.map +1 -1
  403. package/link/utils/createOperation.d.ts +1 -1
  404. package/link/utils/createOperation.js +1 -1
  405. package/link/utils/createOperation.js.map +1 -1
  406. package/link/utils/filterOperationVariables.d.ts +1 -1
  407. package/link/utils/filterOperationVariables.js +1 -1
  408. package/link/utils/filterOperationVariables.js.map +1 -1
  409. package/link/utils/index.d.ts +1 -1
  410. package/link/utils/index.js +1 -1
  411. package/link/utils/index.js.map +1 -1
  412. package/link/utils/transformOperation.d.ts +1 -1
  413. package/link/utils/transformOperation.js +1 -1
  414. package/link/utils/transformOperation.js.map +1 -1
  415. package/link/utils/validateOperation.d.ts +1 -1
  416. package/link/utils/validateOperation.js.map +1 -1
  417. package/link/ws/index.d.ts +1 -1
  418. package/link/ws/index.js +1 -1
  419. package/link/ws/index.js.map +1 -1
  420. package/local-state/LocalState.d.ts +1 -1
  421. package/local-state/LocalState.js.map +1 -1
  422. package/local-state/index.d.ts +1 -1
  423. package/local-state/index.js +1 -1
  424. package/local-state/index.js.map +1 -1
  425. package/masking/GraphQLCodegenDataMasking.d.ts +1 -1
  426. package/masking/GraphQLCodegenDataMasking.js +1 -1
  427. package/masking/GraphQLCodegenDataMasking.js.map +1 -1
  428. package/masking/index.d.ts +1 -1
  429. package/masking/index.js +1 -1
  430. package/masking/index.js.map +1 -1
  431. package/masking/internal/types.d.ts +1 -1
  432. package/masking/internal/types.js +1 -1
  433. package/masking/internal/types.js.map +1 -1
  434. package/masking/maskDefinition.d.ts +1 -1
  435. package/masking/maskDefinition.js.map +1 -1
  436. package/masking/maskFragment.js.map +1 -1
  437. package/masking/maskOperation.js.map +1 -1
  438. package/masking/types.d.ts +1 -1
  439. package/masking/types.js +1 -1
  440. package/masking/types.js.map +1 -1
  441. package/masking/utils.js.map +1 -1
  442. package/package.json +10 -4
  443. package/react/compiled/index.d.ts +2 -0
  444. package/react/compiled/index.js +2 -0
  445. package/react/compiled/index.js.map +1 -0
  446. package/react/context/ApolloConsumer.d.ts +1 -1
  447. package/react/context/ApolloConsumer.js.map +1 -1
  448. package/react/context/ApolloContext.d.ts +1 -1
  449. package/react/context/ApolloContext.js.map +1 -1
  450. package/react/context/ApolloProvider.d.ts +1 -1
  451. package/react/context/ApolloProvider.js.map +1 -1
  452. package/react/hooks/constants.d.ts +1 -1
  453. package/react/hooks/constants.js +1 -1
  454. package/react/hooks/constants.js.map +1 -1
  455. package/react/hooks/internal/__use.d.ts +1 -1
  456. package/react/hooks/internal/__use.js +1 -1
  457. package/react/hooks/internal/__use.js.map +1 -1
  458. package/react/hooks/internal/index.d.ts +1 -1
  459. package/react/hooks/internal/index.js +1 -1
  460. package/react/hooks/internal/index.js.map +1 -1
  461. package/react/hooks/internal/useDeepMemo.d.ts +1 -1
  462. package/react/hooks/internal/useDeepMemo.js +1 -1
  463. package/react/hooks/internal/useDeepMemo.js.map +1 -1
  464. package/react/hooks/internal/useIsomorphicLayoutEffect.d.ts +1 -1
  465. package/react/hooks/internal/useIsomorphicLayoutEffect.js +1 -1
  466. package/react/hooks/internal/useIsomorphicLayoutEffect.js.map +1 -1
  467. package/react/hooks/internal/useRenderGuard.d.ts +1 -1
  468. package/react/hooks/internal/useRenderGuard.js +1 -1
  469. package/react/hooks/internal/useRenderGuard.js.map +1 -1
  470. package/react/hooks/internal/validateSuspenseHookOptions.d.ts +1 -1
  471. package/react/hooks/internal/validateSuspenseHookOptions.js.map +1 -1
  472. package/react/hooks/internal/wrapHook.js.map +1 -1
  473. package/react/hooks/useApolloClient.d.ts +1 -1
  474. package/react/hooks/useApolloClient.js +1 -14
  475. package/react/hooks/useApolloClient.js.map +1 -1
  476. package/react/hooks/useBackgroundQuery.js +7 -7
  477. package/react/hooks/useBackgroundQuery.js.map +1 -1
  478. package/react/hooks/useFragment.d.ts +1 -1
  479. package/react/hooks/useFragment.js +12 -12
  480. package/react/hooks/useFragment.js.map +1 -1
  481. package/react/hooks/useLazyQuery.js +14 -14
  482. package/react/hooks/useLazyQuery.js.map +1 -1
  483. package/react/hooks/useLoadableQuery.js +69 -229
  484. package/react/hooks/useLoadableQuery.js.map +1 -1
  485. package/react/hooks/useMutation.js +82 -192
  486. package/react/hooks/useMutation.js.map +1 -1
  487. package/react/hooks/useQuery.js +54 -225
  488. package/react/hooks/useQuery.js.map +1 -1
  489. package/react/hooks/useQueryRefHandlers.js +24 -64
  490. package/react/hooks/useQueryRefHandlers.js.map +1 -1
  491. package/react/hooks/useReactiveVar.d.ts +1 -1
  492. package/react/hooks/useReactiveVar.js +1 -1
  493. package/react/hooks/useReactiveVar.js.map +1 -1
  494. package/react/hooks/useReadQuery.d.ts +1 -1
  495. package/react/hooks/useReadQuery.js +3 -3
  496. package/react/hooks/useReadQuery.js.map +1 -1
  497. package/react/hooks/useSubscription.js +4 -4
  498. package/react/hooks/useSubscription.js.map +1 -1
  499. package/react/hooks/useSuspenseFragment.d.ts +1 -1
  500. package/react/hooks/useSuspenseFragment.js +1 -1
  501. package/react/hooks/useSuspenseFragment.js.map +1 -1
  502. package/react/hooks/useSuspenseQuery.js +34 -59
  503. package/react/hooks/useSuspenseQuery.js.map +1 -1
  504. package/react/hooks/useSyncExternalStore.d.ts +1 -1
  505. package/react/hooks/useSyncExternalStore.js.map +1 -1
  506. package/react/hooks-compiled/constants.d.ts +3 -0
  507. package/react/hooks-compiled/constants.js +2 -0
  508. package/react/hooks-compiled/constants.js.map +1 -0
  509. package/react/hooks-compiled/internal/__use.d.ts +4 -0
  510. package/react/hooks-compiled/internal/__use.js +22 -0
  511. package/react/hooks-compiled/internal/__use.js.map +1 -0
  512. package/react/hooks-compiled/internal/index.d.ts +5 -0
  513. package/react/hooks-compiled/internal/index.js +6 -0
  514. package/react/hooks-compiled/internal/index.js.map +1 -0
  515. package/react/hooks-compiled/internal/useDeepMemo.d.ts +3 -0
  516. package/react/hooks-compiled/internal/useDeepMemo.js +13 -0
  517. package/react/hooks-compiled/internal/useDeepMemo.js.map +1 -0
  518. package/react/hooks-compiled/internal/useIsomorphicLayoutEffect.d.ts +3 -0
  519. package/react/hooks-compiled/internal/useIsomorphicLayoutEffect.js +9 -0
  520. package/react/hooks-compiled/internal/useIsomorphicLayoutEffect.js.map +1 -0
  521. package/react/hooks-compiled/internal/useRenderGuard.d.ts +2 -0
  522. package/react/hooks-compiled/internal/useRenderGuard.js +42 -0
  523. package/react/hooks-compiled/internal/useRenderGuard.js.map +1 -0
  524. package/react/hooks-compiled/internal/validateSuspenseHookOptions.d.ts +3 -0
  525. package/react/hooks-compiled/internal/validateSuspenseHookOptions.js +22 -0
  526. package/react/hooks-compiled/internal/validateSuspenseHookOptions.js.map +1 -0
  527. package/react/hooks-compiled/internal/wrapHook.d.ts +66 -0
  528. package/react/hooks-compiled/internal/wrapHook.js +64 -0
  529. package/react/hooks-compiled/internal/wrapHook.js.map +1 -0
  530. package/react/hooks-compiled/useApolloClient.d.ts +18 -0
  531. package/react/hooks-compiled/useApolloClient.js +36 -0
  532. package/react/hooks-compiled/useApolloClient.js.map +1 -0
  533. package/react/hooks-compiled/useBackgroundQuery.d.ts +210 -0
  534. package/react/hooks-compiled/useBackgroundQuery.js +80 -0
  535. package/react/hooks-compiled/useBackgroundQuery.js.map +1 -0
  536. package/react/hooks-compiled/useFragment.d.ts +55 -0
  537. package/react/hooks-compiled/useFragment.js +97 -0
  538. package/react/hooks-compiled/useFragment.js.map +1 -0
  539. package/react/hooks-compiled/useLazyQuery.d.ts +280 -0
  540. package/react/hooks-compiled/useLazyQuery.js +181 -0
  541. package/react/hooks-compiled/useLazyQuery.js.map +1 -0
  542. package/react/hooks-compiled/useLoadableQuery.d.ts +175 -0
  543. package/react/hooks-compiled/useLoadableQuery.js +247 -0
  544. package/react/hooks-compiled/useLoadableQuery.js.map +1 -0
  545. package/react/hooks-compiled/useMutation.d.ts +280 -0
  546. package/react/hooks-compiled/useMutation.js +263 -0
  547. package/react/hooks-compiled/useMutation.js.map +1 -0
  548. package/react/hooks-compiled/useQuery.d.ts +265 -0
  549. package/react/hooks-compiled/useQuery.js +395 -0
  550. package/react/hooks-compiled/useQuery.js.map +1 -0
  551. package/react/hooks-compiled/useQueryRefHandlers.d.ts +44 -0
  552. package/react/hooks-compiled/useQueryRefHandlers.js +109 -0
  553. package/react/hooks-compiled/useQueryRefHandlers.js.map +1 -0
  554. package/react/hooks-compiled/useReactiveVar.d.ts +20 -0
  555. package/react/hooks-compiled/useReactiveVar.js +33 -0
  556. package/react/hooks-compiled/useReactiveVar.js.map +1 -0
  557. package/react/hooks-compiled/useReadQuery.d.ts +24 -0
  558. package/react/hooks-compiled/useReadQuery.js +43 -0
  559. package/react/hooks-compiled/useReadQuery.js.map +1 -0
  560. package/react/hooks-compiled/useSubscription.d.ts +178 -0
  561. package/react/hooks-compiled/useSubscription.js +223 -0
  562. package/react/hooks-compiled/useSubscription.js.map +1 -0
  563. package/react/hooks-compiled/useSuspenseFragment.d.ts +47 -0
  564. package/react/hooks-compiled/useSuspenseFragment.js +47 -0
  565. package/react/hooks-compiled/useSuspenseFragment.js.map +1 -0
  566. package/react/hooks-compiled/useSuspenseQuery.d.ts +204 -0
  567. package/react/hooks-compiled/useSuspenseQuery.js +144 -0
  568. package/react/hooks-compiled/useSuspenseQuery.js.map +1 -0
  569. package/react/hooks-compiled/useSyncExternalStore.d.ts +4 -0
  570. package/react/hooks-compiled/useSyncExternalStore.js +126 -0
  571. package/react/hooks-compiled/useSyncExternalStore.js.map +1 -0
  572. package/react/index.compiled.d.ts +26 -0
  573. package/react/index.compiled.js +21 -0
  574. package/react/index.compiled.js.map +1 -0
  575. package/react/index.d.ts +2 -1
  576. package/react/index.js +2 -1
  577. package/react/index.js.map +1 -1
  578. package/react/index.react-server.d.ts +1 -1
  579. package/react/index.react-server.js +1 -1
  580. package/react/index.react-server.js.map +1 -1
  581. package/react/internal/cache/FragmentReference.d.ts +1 -1
  582. package/react/internal/cache/FragmentReference.js +1 -1
  583. package/react/internal/cache/FragmentReference.js.map +1 -1
  584. package/react/internal/cache/SuspenseCache.d.ts +1 -1
  585. package/react/internal/cache/SuspenseCache.js +1 -1
  586. package/react/internal/cache/SuspenseCache.js.map +1 -1
  587. package/react/internal/cache/getSuspenseCache.d.ts +1 -1
  588. package/react/internal/cache/getSuspenseCache.js +1 -1
  589. package/react/internal/cache/getSuspenseCache.js.map +1 -1
  590. package/react/internal/cache/types.d.ts +1 -1
  591. package/react/internal/cache/types.js +1 -1
  592. package/react/internal/cache/types.js.map +1 -1
  593. package/react/internal/compiler-runtime/index.d.ts +8 -0
  594. package/react/internal/compiler-runtime/index.js +28 -0
  595. package/react/internal/compiler-runtime/index.js.map +1 -0
  596. package/react/internal/index.d.ts +1 -1
  597. package/react/internal/index.js +1 -1
  598. package/react/internal/index.js.map +1 -1
  599. package/react/internal/types.d.ts +1 -1
  600. package/react/internal/types.js +1 -1
  601. package/react/internal/types.js.map +1 -1
  602. package/react/query-preloader/createQueryPreloader.js +1 -1
  603. package/react/query-preloader/createQueryPreloader.js.map +1 -1
  604. package/react/ssr/getDataFromTree.d.ts +1 -1
  605. package/react/ssr/getDataFromTree.js.map +1 -1
  606. package/react/ssr/index.d.ts +1 -1
  607. package/react/ssr/index.js +1 -1
  608. package/react/ssr/index.js.map +1 -1
  609. package/react/ssr/prerenderStatic.d.ts +1 -1
  610. package/react/ssr/renderToStringWithData.d.ts +1 -1
  611. package/react/ssr/renderToStringWithData.js +1 -1
  612. package/react/ssr/renderToStringWithData.js.map +1 -1
  613. package/react/ssr/useSSRQuery.d.ts +1 -1
  614. package/react/ssr/useSSRQuery.js +1 -1
  615. package/react/ssr/useSSRQuery.js.map +1 -1
  616. package/react/types/deprecated.d.ts +1 -1
  617. package/react/types/deprecated.js +1 -1
  618. package/react/types/deprecated.js.map +1 -1
  619. package/react/types/types.documentation.js +1 -1
  620. package/react/types/types.documentation.js.map +1 -1
  621. package/testing/core/mocking/mockLink.js.map +1 -1
  622. package/testing/core/mocking/mockSubscriptionLink.d.ts +1 -1
  623. package/testing/core/mocking/mockSubscriptionLink.js +1 -1
  624. package/testing/core/mocking/mockSubscriptionLink.js.map +1 -1
  625. package/testing/core/types/deprecated.d.ts +1 -1
  626. package/testing/core/types/deprecated.js +1 -1
  627. package/testing/core/types/deprecated.js.map +1 -1
  628. package/testing/index.d.ts +1 -1
  629. package/testing/index.js +1 -1
  630. package/testing/index.js.map +1 -1
  631. package/testing/react/MockedProvider.d.ts +1 -1
  632. package/testing/react/MockedProvider.js +1 -1
  633. package/testing/react/MockedProvider.js.map +1 -1
  634. package/testing/react/index.d.ts +1 -1
  635. package/testing/react/index.js +1 -1
  636. package/testing/react/index.js.map +1 -1
  637. package/utilities/DeepPartial.d.ts +1 -1
  638. package/utilities/DeepPartial.js +1 -1
  639. package/utilities/DeepPartial.js.map +1 -1
  640. package/utilities/HKT.d.ts +1 -1
  641. package/utilities/HKT.js +1 -1
  642. package/utilities/HKT.js.map +1 -1
  643. package/utilities/caching/index.d.ts +1 -1
  644. package/utilities/caching/index.js +1 -1
  645. package/utilities/caching/index.js.map +1 -1
  646. package/utilities/caching/sizes.d.ts +1 -1
  647. package/utilities/caching/sizes.js +1 -1
  648. package/utilities/caching/sizes.js.map +1 -1
  649. package/utilities/common/stripTypename.d.ts +1 -1
  650. package/utilities/common/stripTypename.js +1 -1
  651. package/utilities/common/stripTypename.js.map +1 -1
  652. package/utilities/environment/index.d.ts +1 -1
  653. package/utilities/environment/index.development.d.ts +1 -1
  654. package/utilities/environment/index.development.js +1 -1
  655. package/utilities/environment/index.development.js.map +1 -1
  656. package/utilities/environment/index.js +1 -1
  657. package/utilities/environment/index.js.map +1 -1
  658. package/utilities/environment/index.production.d.ts +1 -1
  659. package/utilities/environment/index.production.js +1 -1
  660. package/utilities/environment/index.production.js.map +1 -1
  661. package/utilities/graphql/isFormattedExecutionResult.d.ts +1 -1
  662. package/utilities/graphql/isFormattedExecutionResult.js +1 -1
  663. package/utilities/graphql/isFormattedExecutionResult.js.map +1 -1
  664. package/utilities/graphql/operations.d.ts +1 -1
  665. package/utilities/graphql/operations.js +1 -1
  666. package/utilities/graphql/operations.js.map +1 -1
  667. package/utilities/graphql/print.d.ts +1 -1
  668. package/utilities/graphql/print.js +1 -1
  669. package/utilities/graphql/print.js.map +1 -1
  670. package/utilities/graphql/storeUtils.d.ts +1 -1
  671. package/utilities/graphql/storeUtils.js +1 -1
  672. package/utilities/graphql/storeUtils.js.map +1 -1
  673. package/utilities/graphql/transform.d.ts +1 -1
  674. package/utilities/graphql/transform.js +1 -1
  675. package/utilities/graphql/transform.js.map +1 -1
  676. package/utilities/index.d.ts +1 -1
  677. package/utilities/index.js +1 -1
  678. package/utilities/index.js.map +1 -1
  679. package/utilities/internal/argumentsObjectFromField.js.map +1 -1
  680. package/utilities/internal/caches.js.map +1 -1
  681. package/utilities/internal/canUseDOM.js.map +1 -1
  682. package/utilities/internal/checkDocument.js.map +1 -1
  683. package/utilities/internal/cloneDeep.js.map +1 -1
  684. package/utilities/internal/compact.js.map +1 -1
  685. package/utilities/internal/createFragmentMap.js.map +1 -1
  686. package/utilities/internal/createFulfilledPromise.js.map +1 -1
  687. package/utilities/internal/createRejectedPromise.js.map +1 -1
  688. package/utilities/internal/dealias.d.ts +1 -1
  689. package/utilities/internal/dealias.js +1 -1
  690. package/utilities/internal/dealias.js.map +1 -1
  691. package/utilities/internal/decoratePromise.js.map +1 -1
  692. package/utilities/internal/deepFreeze.js.map +1 -1
  693. package/utilities/internal/filterMap.d.ts +1 -1
  694. package/utilities/internal/filterMap.js +1 -1
  695. package/utilities/internal/filterMap.js.map +1 -1
  696. package/utilities/internal/getDefaultValues.js.map +1 -1
  697. package/utilities/internal/getFragmentDefinition.js.map +1 -1
  698. package/utilities/internal/getFragmentDefinitions.js.map +1 -1
  699. package/utilities/internal/getFragmentFromSelection.js.map +1 -1
  700. package/utilities/internal/getFragmentQueryDocument.js.map +1 -1
  701. package/utilities/internal/getGraphQLErrorsFromResult.js.map +1 -1
  702. package/utilities/internal/getMainDefinition.js.map +1 -1
  703. package/utilities/internal/getMemoryInternals.js.map +1 -1
  704. package/utilities/internal/getOperationDefinition.js.map +1 -1
  705. package/utilities/internal/getOperationName.js.map +1 -1
  706. package/utilities/internal/getQueryDefinition.js.map +1 -1
  707. package/utilities/internal/getStoreKeyName.js.map +1 -1
  708. package/utilities/internal/globals/global.d.ts +1 -1
  709. package/utilities/internal/globals/index.d.ts +1 -1
  710. package/utilities/internal/globals/index.js +1 -1
  711. package/utilities/internal/globals/index.js.map +1 -1
  712. package/utilities/internal/globals/maybe.d.ts +1 -1
  713. package/utilities/internal/globals/maybe.js +1 -1
  714. package/utilities/internal/globals/maybe.js.map +1 -1
  715. package/utilities/internal/graphQLResultHasError.js.map +1 -1
  716. package/utilities/internal/hasDirectives.js.map +1 -1
  717. package/utilities/internal/hasForcedResolvers.d.ts +1 -1
  718. package/utilities/internal/hasForcedResolvers.js +1 -1
  719. package/utilities/internal/hasForcedResolvers.js.map +1 -1
  720. package/utilities/internal/index.d.ts +1 -1
  721. package/utilities/internal/index.js +1 -1
  722. package/utilities/internal/index.js.map +1 -1
  723. package/utilities/internal/index.production.d.ts +1 -1
  724. package/utilities/internal/index.production.js +1 -1
  725. package/utilities/internal/index.production.js.map +1 -1
  726. package/utilities/internal/isArray.js.map +1 -1
  727. package/utilities/internal/isDocumentNode.js.map +1 -1
  728. package/utilities/internal/isField.js.map +1 -1
  729. package/utilities/internal/isNonEmptyArray.js.map +1 -1
  730. package/utilities/internal/isNonNullObject.js.map +1 -1
  731. package/utilities/internal/isPlainObject.js.map +1 -1
  732. package/utilities/internal/makeReference.js.map +1 -1
  733. package/utilities/internal/makeUniqueId.js.map +1 -1
  734. package/utilities/internal/maybeDeepFreeze.js.map +1 -1
  735. package/utilities/internal/mergeDeep.js.map +1 -1
  736. package/utilities/internal/mergeDeepArray.js.map +1 -1
  737. package/utilities/internal/mergeOptions.js.map +1 -1
  738. package/utilities/internal/omitDeep.js.map +1 -1
  739. package/utilities/internal/preventUnhandledRejection.d.ts +1 -1
  740. package/utilities/internal/preventUnhandledRejection.js +1 -1
  741. package/utilities/internal/preventUnhandledRejection.js.map +1 -1
  742. package/utilities/internal/removeDirectivesFromDocument.js.map +1 -1
  743. package/utilities/internal/resultKeyNameFromField.js.map +1 -1
  744. package/utilities/internal/shouldInclude.js.map +1 -1
  745. package/utilities/internal/storeKeyNameFromField.js.map +1 -1
  746. package/utilities/internal/stringifyForDisplay.js.map +1 -1
  747. package/utilities/internal/toQueryResult.js.map +1 -1
  748. package/utilities/internal/types/ApplyHKT.js +1 -1
  749. package/utilities/internal/types/ApplyHKT.js.map +1 -1
  750. package/utilities/internal/types/ApplyHKTImplementationWithDefault.js +1 -1
  751. package/utilities/internal/types/ApplyHKTImplementationWithDefault.js.map +1 -1
  752. package/utilities/internal/types/DecoratedPromise.js +1 -1
  753. package/utilities/internal/types/DecoratedPromise.js.map +1 -1
  754. package/utilities/internal/types/DeepOmit.js +1 -1
  755. package/utilities/internal/types/DeepOmit.js.map +1 -1
  756. package/utilities/internal/types/FragmentMap.js +1 -1
  757. package/utilities/internal/types/FragmentMap.js.map +1 -1
  758. package/utilities/internal/types/FragmentMapFunction.js +1 -1
  759. package/utilities/internal/types/FragmentMapFunction.js.map +1 -1
  760. package/utilities/internal/types/FulfilledPromise.js +1 -1
  761. package/utilities/internal/types/FulfilledPromise.js.map +1 -1
  762. package/utilities/internal/types/IsAny.js +1 -1
  763. package/utilities/internal/types/IsAny.js.map +1 -1
  764. package/utilities/internal/types/NoInfer.d.ts +1 -1
  765. package/utilities/internal/types/NoInfer.js +1 -1
  766. package/utilities/internal/types/NoInfer.js.map +1 -1
  767. package/utilities/internal/types/PendingPromise.js +1 -1
  768. package/utilities/internal/types/PendingPromise.js.map +1 -1
  769. package/utilities/internal/types/Prettify.js +1 -1
  770. package/utilities/internal/types/Prettify.js.map +1 -1
  771. package/utilities/internal/types/Primitive.js +1 -1
  772. package/utilities/internal/types/Primitive.js.map +1 -1
  773. package/utilities/internal/types/RejectedPromise.js +1 -1
  774. package/utilities/internal/types/RejectedPromise.js.map +1 -1
  775. package/utilities/internal/types/RemoveIndexSignature.js +1 -1
  776. package/utilities/internal/types/RemoveIndexSignature.js.map +1 -1
  777. package/utilities/internal/types/TupleToIntersection.d.ts +1 -1
  778. package/utilities/internal/types/TupleToIntersection.js +1 -1
  779. package/utilities/internal/types/TupleToIntersection.js.map +1 -1
  780. package/utilities/internal/types/VariablesOption.js +1 -1
  781. package/utilities/internal/types/VariablesOption.js.map +1 -1
  782. package/utilities/internal/valueToObjectRepresentation.js.map +1 -1
  783. package/utilities/invariant/index.d.ts +1 -1
  784. package/utilities/invariant/index.development.d.ts +1 -1
  785. package/utilities/invariant/index.development.js +1 -1
  786. package/utilities/invariant/index.development.js.map +1 -1
  787. package/utilities/invariant/index.js +1 -1
  788. package/utilities/invariant/index.js.map +1 -1
  789. package/utilities/policies/pagination.d.ts +1 -1
  790. package/utilities/policies/pagination.js +1 -1
  791. package/utilities/policies/pagination.js.map +1 -1
  792. package/utilities/shared/canonicalStringify.d.ts +1 -1
  793. package/utilities/shared/canonicalStringify.js +1 -1
  794. package/utilities/shared/canonicalStringify.js.map +1 -1
  795. package/utilities/subscriptions/relay/index.d.ts +1 -1
  796. package/utilities/subscriptions/relay/index.js +1 -1
  797. package/utilities/subscriptions/relay/index.js.map +1 -1
  798. package/version.d.ts +1 -1
  799. package/version.js +1 -1
  800. package/version.js.map +1 -1
@@ -0,0 +1,247 @@
1
+ import { c as _c } from "@apollo/client/react/internal/compiler-runtime";
2
+ import * as React from "react";
3
+ import { canonicalStringify } from "@apollo/client/cache";
4
+ import { assertWrappedQueryRef, getSuspenseCache, unwrapQueryRef, updateWrappedQueryRef, wrapQueryRef, } from "@apollo/client/react/internal";
5
+ import { __DEV__ } from "@apollo/client/utilities/environment";
6
+ import { invariant } from "@apollo/client/utilities/invariant";
7
+ import { useDeepMemo, useRenderGuard } from "./internal/index.js";
8
+ import { validateSuspenseHookOptions } from "./internal/validateSuspenseHookOptions.js";
9
+ import { useApolloClient } from "./useApolloClient.js";
10
+ export function useLoadableQuery(query, t0) {
11
+ const $ = _c(34);
12
+ let t1;
13
+
14
+ if ($[0] !== t0) {
15
+ t1 = t0 === undefined ? {} : t0;
16
+ $[0] = t0;
17
+ $[1] = t1;
18
+ } else {
19
+ t1 = $[1];
20
+ }
21
+
22
+ const options = t1;
23
+ const client = useApolloClient(options.client);
24
+ let t2;
25
+
26
+ if ($[2] !== client) {
27
+ t2 = getSuspenseCache(client);
28
+ $[2] = client;
29
+ $[3] = t2;
30
+ } else {
31
+ t2 = $[3];
32
+ }
33
+
34
+ const suspenseCache = t2;
35
+ let t3;
36
+
37
+ if ($[4] !== client || $[5] !== options || $[6] !== query) {
38
+ t3 = {
39
+ client,
40
+ query,
41
+ options
42
+ };
43
+ $[4] = client;
44
+ $[5] = options;
45
+ $[6] = query;
46
+ $[7] = t3;
47
+ } else {
48
+ t3 = $[7];
49
+ }
50
+
51
+ const watchQueryOptions = useWatchQueryOptions(t3);
52
+ const {
53
+ queryKey: t4
54
+ } = options;
55
+ let t5;
56
+
57
+ if ($[8] !== t4) {
58
+ t5 = t4 === undefined ? [] : t4;
59
+ $[8] = t4;
60
+ $[9] = t5;
61
+ } else {
62
+ t5 = $[9];
63
+ }
64
+
65
+ const queryKey = t5;
66
+ const [queryRef, setQueryRef] = React.useState(null);
67
+ assertWrappedQueryRef(queryRef);
68
+ let t6;
69
+
70
+ if ($[10] !== queryRef) {
71
+ t6 = queryRef && unwrapQueryRef(queryRef);
72
+ $[10] = queryRef;
73
+ $[11] = t6;
74
+ } else {
75
+ t6 = $[11];
76
+ }
77
+
78
+ const internalQueryRef = t6;
79
+
80
+ if (queryRef && internalQueryRef?.didChangeOptions(watchQueryOptions)) {
81
+ const promise = internalQueryRef.applyOptions(watchQueryOptions);
82
+ updateWrappedQueryRef(queryRef, promise);
83
+ }
84
+
85
+ const calledDuringRender = useRenderGuard();
86
+ let t7;
87
+
88
+ if ($[12] !== internalQueryRef) {
89
+ t7 = options_0 => {
90
+ if (!internalQueryRef) {
91
+ throw new Error("The query has not been loaded. Please load the query.");
92
+ }
93
+
94
+ const promise_0 = internalQueryRef.fetchMore(options_0);
95
+ setQueryRef(wrapQueryRef(internalQueryRef));
96
+ return promise_0;
97
+ };
98
+ $[12] = internalQueryRef;
99
+ $[13] = t7;
100
+ } else {
101
+ t7 = $[13];
102
+ }
103
+
104
+ const fetchMore = t7;
105
+ let t8;
106
+
107
+ if ($[14] !== internalQueryRef) {
108
+ t8 = options_1 => {
109
+ if (!internalQueryRef) {
110
+ throw new Error("The query has not been loaded. Please load the query.");
111
+ }
112
+
113
+ const promise_1 = internalQueryRef.refetch(options_1);
114
+ setQueryRef(wrapQueryRef(internalQueryRef));
115
+ return promise_1;
116
+ };
117
+ $[14] = internalQueryRef;
118
+ $[15] = t8;
119
+ } else {
120
+ t8 = $[15];
121
+ }
122
+
123
+ const refetch = t8;
124
+ let t9;
125
+
126
+ if ($[16] !== calledDuringRender || $[17] !== client || $[18] !== query || $[19] !== queryKey || $[20] !== suspenseCache || $[21] !== watchQueryOptions) {
127
+ t9 = (...t10) => {
128
+ const args = t10;
129
+ invariant(!calledDuringRender(), 31);
130
+ const [variables] = args;
131
+ const cacheKey = [query, canonicalStringify(variables), ...[].concat(queryKey)];
132
+ const queryRef_0 = suspenseCache.getQueryRef(cacheKey, () => client.watchQuery({
133
+ ...watchQueryOptions,
134
+ variables
135
+ }));
136
+ setQueryRef(wrapQueryRef(queryRef_0));
137
+ };
138
+ $[16] = calledDuringRender;
139
+ $[17] = client;
140
+ $[18] = query;
141
+ $[19] = queryKey;
142
+ $[20] = suspenseCache;
143
+ $[21] = watchQueryOptions;
144
+ $[22] = t9;
145
+ } else {
146
+ t9 = $[22];
147
+ }
148
+
149
+ const loadQuery = t9;
150
+ let t10;
151
+
152
+ if ($[23] !== internalQueryRef) {
153
+ t10 = options_2 => {
154
+ invariant(internalQueryRef, 32);
155
+ return internalQueryRef.observable.subscribeToMore(options_2);
156
+ };
157
+ $[23] = internalQueryRef;
158
+ $[24] = t10;
159
+ } else {
160
+ t10 = $[24];
161
+ }
162
+
163
+ const subscribeToMore = t10;
164
+ let t11;
165
+
166
+ if ($[25] === Symbol.for("react.memo_cache_sentinel")) {
167
+ t11 = () => {
168
+ setQueryRef(null);
169
+ };
170
+ $[25] = t11;
171
+ } else {
172
+ t11 = $[25];
173
+ }
174
+
175
+ const reset = t11;
176
+ let t12;
177
+
178
+ if ($[26] !== fetchMore || $[27] !== refetch || $[28] !== subscribeToMore) {
179
+ t12 = {
180
+ fetchMore,
181
+ refetch,
182
+ reset,
183
+ subscribeToMore
184
+ };
185
+ $[26] = fetchMore;
186
+ $[27] = refetch;
187
+ $[28] = subscribeToMore;
188
+ $[29] = t12;
189
+ } else {
190
+ t12 = $[29];
191
+ }
192
+
193
+ let t13;
194
+
195
+ if ($[30] !== loadQuery || $[31] !== queryRef || $[32] !== t12) {
196
+ t13 = [loadQuery, queryRef, t12];
197
+ $[30] = loadQuery;
198
+ $[31] = queryRef;
199
+ $[32] = t12;
200
+ $[33] = t13;
201
+ } else {
202
+ t13 = $[33];
203
+ }
204
+
205
+ return t13;
206
+ }
207
+ function useWatchQueryOptions(t0) {
208
+ const $ = _c(5);
209
+ const {
210
+ client,
211
+ query,
212
+ options
213
+ } = t0;
214
+ let t1;
215
+ let t2;
216
+
217
+ if ($[0] !== client || $[1] !== options || $[2] !== query) {
218
+ t1 = () => {
219
+ const fetchPolicy = options.fetchPolicy || client.defaultOptions.watchQuery?.fetchPolicy || "cache-first";
220
+ const watchQueryOptions = {
221
+ ...options,
222
+ fetchPolicy,
223
+ query,
224
+ notifyOnNetworkStatusChange: false,
225
+ nextFetchPolicy: void 0
226
+ };
227
+
228
+ if (__DEV__) {
229
+ validateSuspenseHookOptions(watchQueryOptions);
230
+ }
231
+
232
+ return watchQueryOptions;
233
+ };t2 = [client, options, query];
234
+ $[0] = client;
235
+ $[1] = options;
236
+ $[2] = query;
237
+ $[3] = t1;
238
+ $[4] = t2;
239
+ } else {
240
+ t1 = $[3];
241
+ t2 = $[4];
242
+ }
243
+
244
+ return useDeepMemo(t1, t2);
245
+ }
246
+
247
+ //# sourceMappingURL=useLoadableQuery.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useLoadableQuery.js","sources":["../../../src/react/hooks/useLoadableQuery.ts"],"sourcesContent":["import * as React from \"react\";\n\nimport type {\n ApolloClient,\n DataState,\n DefaultContext,\n DocumentNode,\n ErrorPolicy,\n OperationVariables,\n RefetchWritePolicy,\n TypedDocumentNode,\n WatchQueryFetchPolicy,\n WatchQueryOptions,\n} from \"@apollo/client\";\nimport type {\n SubscribeToMoreFunction,\n SubscribeToMoreOptions,\n} from \"@apollo/client\";\nimport { canonicalStringify } from \"@apollo/client/cache\";\nimport type {\n CacheKey,\n FetchMoreFunction,\n QueryRef,\n RefetchFunction,\n} from \"@apollo/client/react/internal\";\nimport {\n assertWrappedQueryRef,\n getSuspenseCache,\n unwrapQueryRef,\n updateWrappedQueryRef,\n wrapQueryRef,\n} from \"@apollo/client/react/internal\";\nimport { __DEV__ } from \"@apollo/client/utilities/environment\";\nimport { invariant } from \"@apollo/client/utilities/invariant\";\n\nimport { __use, useDeepMemo, useRenderGuard } from \"./internal/index.js\";\nimport { validateSuspenseHookOptions } from \"./internal/validateSuspenseHookOptions.js\";\nimport { useApolloClient } from \"./useApolloClient.js\";\n\ntype ResetFunction = () => void;\n\nexport declare namespace useLoadableQuery {\n export type LoadQueryFunction<TVariables extends OperationVariables> = (\n // Use variadic args to handle cases where TVariables is type `never`, in\n // which case we don't want to allow a variables argument. In other\n // words, we don't want to allow variables to be passed as an argument to this\n // function if the query does not expect variables in the document.\n ...args: {} extends TVariables ? [variables?: TVariables]\n : [variables: TVariables]\n ) => void;\n\n export type Result<\n TData = unknown,\n TVariables extends OperationVariables = OperationVariables,\n TStates extends\n DataState<TData>[\"dataState\"] = DataState<TData>[\"dataState\"],\n > = [\n loadQuery: LoadQueryFunction<TVariables>,\n queryRef: QueryRef<TData, TVariables, TStates> | null,\n handlers: {\n /** {@inheritDoc @apollo/client!QueryResultDocumentation#fetchMore:member} */\n fetchMore: FetchMoreFunction<TData, TVariables>;\n /** {@inheritDoc @apollo/client!QueryResultDocumentation#refetch:member} */\n refetch: RefetchFunction<TData, TVariables>;\n /** {@inheritDoc @apollo/client!ObservableQuery#subscribeToMore:member(1)} */\n subscribeToMore: SubscribeToMoreFunction<TData, TVariables>;\n /**\n * A function that resets the `queryRef` back to `null`.\n */\n reset: ResetFunction;\n },\n ];\n\n export type FetchPolicy = Extract<\n WatchQueryFetchPolicy,\n \"cache-first\" | \"network-only\" | \"no-cache\" | \"cache-and-network\"\n >;\n\n export interface Options {\n /** {@inheritDoc @apollo/client!QueryOptionsDocumentation#client:member} */\n client?: ApolloClient;\n\n /** {@inheritDoc @apollo/client!QueryOptionsDocumentation#context:member} */\n context?: DefaultContext;\n\n /** {@inheritDoc @apollo/client!QueryOptionsDocumentation#errorPolicy:member} */\n errorPolicy?: ErrorPolicy;\n\n /** {@inheritDoc @apollo/client!QueryOptionsDocumentation#fetchPolicy:member} */\n fetchPolicy?: FetchPolicy;\n\n /** {@inheritDoc @apollo/client!QueryOptionsDocumentation#queryKey:member} */\n queryKey?: string | number | any[];\n\n /** {@inheritDoc @apollo/client!QueryOptionsDocumentation#refetchWritePolicy:member} */\n refetchWritePolicy?: RefetchWritePolicy;\n\n /** {@inheritDoc @apollo/client!QueryOptionsDocumentation#returnPartialData:member} */\n returnPartialData?: boolean;\n }\n}\n\nexport function useLoadableQuery<\n TData = unknown,\n TVariables extends OperationVariables = OperationVariables,\n>(\n query: DocumentNode | TypedDocumentNode<TData, TVariables>,\n options: useLoadableQuery.Options & {\n returnPartialData: true;\n errorPolicy: \"ignore\" | \"all\";\n }\n): useLoadableQuery.Result<\n TData,\n TVariables,\n \"complete\" | \"streaming\" | \"partial\" | \"empty\"\n>;\n\nexport function useLoadableQuery<\n TData = unknown,\n TVariables extends OperationVariables = OperationVariables,\n>(\n query: DocumentNode | TypedDocumentNode<TData, TVariables>,\n options: useLoadableQuery.Options & {\n errorPolicy: \"ignore\" | \"all\";\n }\n): useLoadableQuery.Result<\n TData,\n TVariables,\n \"complete\" | \"streaming\" | \"empty\"\n>;\n\nexport function useLoadableQuery<\n TData = unknown,\n TVariables extends OperationVariables = OperationVariables,\n>(\n query: DocumentNode | TypedDocumentNode<TData, TVariables>,\n options: useLoadableQuery.Options & {\n returnPartialData: true;\n }\n): useLoadableQuery.Result<\n TData,\n TVariables,\n \"complete\" | \"streaming\" | \"partial\"\n>;\n\n/**\n * A hook for imperatively loading a query, such as responding to a user\n * interaction.\n *\n * > Refer to the [Suspense - Fetching in response to user interaction](https://www.apollographql.com/docs/react/data/suspense#fetching-in-response-to-user-interaction) section for a more in-depth overview of `useLoadableQuery`.\n *\n * @example\n * ```jsx\n * import { gql, useLoadableQuery } from \"@apollo/client\";\n *\n * const GET_GREETING = gql`\n * query GetGreeting($language: String!) {\n * greeting(language: $language) {\n * message\n * }\n * }\n * `;\n *\n * function App() {\n * const [loadGreeting, queryRef] = useLoadableQuery(GET_GREETING);\n *\n * return (\n * <>\n * <button onClick={() => loadGreeting({ language: \"english\" })}>\n * Load greeting\n * </button>\n * <Suspense fallback={<div>Loading...</div>}>\n * {queryRef && <Hello queryRef={queryRef} />}\n * </Suspense>\n * </>\n * );\n * }\n *\n * function Hello({ queryRef }) {\n * const { data } = useReadQuery(queryRef);\n *\n * return <div>{data.greeting.message}</div>;\n * }\n * ```\n *\n * @since 3.9.0\n * @param query - A GraphQL query document parsed into an AST by `gql`.\n * @param options - Options to control how the query is executed.\n * @returns A tuple in the form of `[loadQuery, queryRef, handlers]`\n */\nexport function useLoadableQuery<\n TData = unknown,\n TVariables extends OperationVariables = OperationVariables,\n>(\n query: DocumentNode | TypedDocumentNode<TData, TVariables>,\n options?: useLoadableQuery.Options\n): useLoadableQuery.Result<TData, TVariables, \"complete\" | \"streaming\">;\n\nexport function useLoadableQuery<\n TData = unknown,\n TVariables extends OperationVariables = OperationVariables,\n>(\n query: DocumentNode | TypedDocumentNode<TData, TVariables>,\n options: useLoadableQuery.Options = {}\n): useLoadableQuery.Result<TData, TVariables> {\n const client = useApolloClient(options.client);\n const suspenseCache = getSuspenseCache(client);\n const watchQueryOptions = useWatchQueryOptions({ client, query, options });\n const { queryKey = [] } = options;\n\n const [queryRef, setQueryRef] = React.useState<QueryRef<\n TData,\n TVariables,\n DataState<TData>[\"dataState\"]\n > | null>(null);\n\n assertWrappedQueryRef(queryRef);\n\n const internalQueryRef = queryRef && unwrapQueryRef(queryRef);\n\n if (queryRef && internalQueryRef?.didChangeOptions(watchQueryOptions)) {\n const promise = internalQueryRef.applyOptions(watchQueryOptions);\n updateWrappedQueryRef(queryRef, promise);\n }\n\n const calledDuringRender = useRenderGuard();\n\n const fetchMore: FetchMoreFunction<TData, TVariables> = React.useCallback(\n (options) => {\n if (!internalQueryRef) {\n throw new Error(\n \"The query has not been loaded. Please load the query.\"\n );\n }\n\n const promise = internalQueryRef.fetchMore(options);\n\n setQueryRef(wrapQueryRef(internalQueryRef));\n\n return promise;\n },\n [internalQueryRef]\n );\n\n const refetch: RefetchFunction<TData, TVariables> = React.useCallback(\n (options) => {\n if (!internalQueryRef) {\n throw new Error(\n \"The query has not been loaded. Please load the query.\"\n );\n }\n\n const promise = internalQueryRef.refetch(options);\n\n setQueryRef(wrapQueryRef(internalQueryRef));\n\n return promise;\n },\n [internalQueryRef]\n );\n\n const loadQuery: useLoadableQuery.LoadQueryFunction<TVariables> =\n React.useCallback(\n (...args) => {\n invariant(\n !calledDuringRender(),\n \"useLoadableQuery: 'loadQuery' should not be called during render. To start a query during render, use the 'useBackgroundQuery' hook.\"\n );\n\n const [variables] = args;\n\n const cacheKey: CacheKey = [\n query,\n canonicalStringify(variables),\n ...([] as any[]).concat(queryKey),\n ];\n\n const queryRef = suspenseCache.getQueryRef(cacheKey, () =>\n client.watchQuery({\n ...watchQueryOptions,\n variables,\n } as WatchQueryOptions<any, any>)\n );\n\n setQueryRef(wrapQueryRef(queryRef));\n },\n [\n query,\n queryKey,\n suspenseCache,\n watchQueryOptions,\n calledDuringRender,\n client,\n ]\n );\n\n const subscribeToMore: SubscribeToMoreFunction<TData, TVariables> =\n React.useCallback(\n (options) => {\n invariant(\n internalQueryRef,\n \"The query has not been loaded. Please load the query.\"\n );\n\n return internalQueryRef.observable.subscribeToMore(\n // TODO: The internalQueryRef doesn't have TVariables' type information so we have to cast it here\n options as any as SubscribeToMoreOptions<TData, OperationVariables>\n );\n },\n [internalQueryRef]\n );\n\n const reset: ResetFunction = React.useCallback(() => {\n setQueryRef(null);\n }, []);\n\n return [loadQuery, queryRef, { fetchMore, refetch, reset, subscribeToMore }];\n}\n\nfunction useWatchQueryOptions<TData, TVariables extends OperationVariables>({\n client,\n query,\n options,\n}: {\n client: ApolloClient;\n query: DocumentNode | TypedDocumentNode<TData, TVariables>;\n options: useLoadableQuery.Options;\n}): WatchQueryOptions<TVariables, TData> {\n return useDeepMemo<WatchQueryOptions<TVariables, TData>>(() => {\n const fetchPolicy =\n options.fetchPolicy ||\n client.defaultOptions.watchQuery?.fetchPolicy ||\n \"cache-first\";\n\n const watchQueryOptions = {\n ...options,\n fetchPolicy,\n query,\n notifyOnNetworkStatusChange: false,\n nextFetchPolicy: void 0,\n };\n\n if (__DEV__) {\n validateSuspenseHookOptions(watchQueryOptions as any);\n }\n\n return watchQueryOptions as WatchQueryOptions<TVariables, TData>;\n }, [client, options, query]);\n}\n"],"names":[],"mappings":";AAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAO,EAAP,CAAA,EAAY,CAAZ,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,EAAuB,CAAvB,CAAA,CAAA,CAAA,CAAA,CAAA,CAA8B;AAkB9B,CAAA,CAAA,CAAA,CAAA,CAAA,EAAO,EAAE,CAAT,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,EAAA,CAAA,CAAA,CAAA,EAAmC,CAAnC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAyD;AAOzD,CAAA,CAAA,CAAA,CAAA,CAAA,EAAO,EACL,CADF,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CACuB,EACrB,CAFF,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAEkB,EAChB,CAHF,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAGgB,EACd,CAJF,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAIuB,EACrB,CALF,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAKc,EALd,EAAA,CAAA,CAAA,CAAA,EAMO,CANP,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAMsC;AACtC,CAAA,CAAA,CAAA,CAAA,CAAA,EAAO,EAAE,CAAT,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,EAAA,CAAA,CAAA,CAAA,EAAwB,CAAxB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAA8D;AAC9D,CAAA,CAAA,CAAA,CAAA,CAAA,EAAO,EAAE,CAAT,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,EAAA,CAAA,CAAA,CAAA,EAA0B,CAA1B,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAA8D;AAE9D,CAAA,CAAA,CAAA,CAAA,CAAA,EAAO,EAAS,CAAhB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAA2B,EAAE,CAA7B,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,EAAA,CAAA,CAAA,CAAA,EAAmD,CAAnD,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAwE;AACxE,CAAA,CAAA,CAAA,CAAA,CAAA,EAAO,EAAE,CAAT,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,EAAA,CAAA,CAAA,CAAA,EAA4C,CAA5C,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAuF;AACvF,CAAA,CAAA,CAAA,CAAA,CAAA,EAAO,EAAE,CAAT,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,EAAA,CAAA,CAAA,CAAA,EAAgC,CAAhC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAsD"}
@@ -0,0 +1,280 @@
1
+ import type { TypedDocumentNode } from "@graphql-typed-document-node/core";
2
+ import type { ApolloCache, ApolloClient, DefaultContext, DocumentNode, ErrorLike, ErrorPolicy, InternalRefetchQueriesInclude, MaybeMasked, MutateResult, MutationFetchPolicy, MutationQueryReducersMap, MutationUpdaterFunction, NormalizedExecutionResult, OnQueryUpdated, OperationVariables, Unmasked } from "@apollo/client";
3
+ import type { IgnoreModifier } from "@apollo/client/cache";
4
+ import type { NoInfer, Prettify } from "@apollo/client/utilities/internal";
5
+ type MakeRequiredVariablesOptional<TVariables extends OperationVariables, TConfiguredVariables extends Partial<TVariables>> = Prettify<{
6
+ [K in keyof TVariables as K extends keyof TConfiguredVariables ? K : never]?: TVariables[K];
7
+ } & Omit<TVariables, keyof TConfiguredVariables>>;
8
+ export declare namespace useMutation {
9
+ interface Options<TData = unknown, TVariables extends OperationVariables = OperationVariables, TCache extends ApolloCache = ApolloCache, TConfiguredVariables extends Partial<TVariables> = Partial<TVariables>> {
10
+ /**
11
+ * By providing either an object or a callback function that, when invoked after a mutation, allows you to return optimistic data and optionally skip updates via the `IGNORE` sentinel object, Apollo Client caches this temporary (and potentially incorrect) response until the mutation completes, enabling more responsive UI updates.
12
+ *
13
+ * For more information, see [Optimistic mutation results](https://www.apollographql.com/docs/react/performance/optimistic-ui/).
14
+ *
15
+ * @docGroup
16
+ *
17
+ * 3. Caching options
18
+ */
19
+ optimisticResponse?: Unmasked<NoInfer<TData>> | ((vars: TVariables, { IGNORE }: {
20
+ IGNORE: IgnoreModifier;
21
+ }) => Unmasked<NoInfer<TData>> | IgnoreModifier);
22
+ /**
23
+ * A `MutationQueryReducersMap`, which is map from query names to mutation query reducers. Briefly, this map defines how to incorporate the results of the mutation into the results of queries that are currently being watched by your application.
24
+ */
25
+ updateQueries?: MutationQueryReducersMap<TData>;
26
+ /**
27
+ * An array (or a function that _returns_ an array) that specifies which queries you want to refetch after the mutation occurs.
28
+ *
29
+ * Each array value can be either:
30
+ *
31
+ * - An object containing the `query` to execute, along with any `variables`
32
+ *
33
+ * - A string indicating the operation name of the query to refetch
34
+ *
35
+ * @docGroup
36
+ *
37
+ * 1. Operation options
38
+ */
39
+ refetchQueries?: ((result: NormalizedExecutionResult<Unmasked<TData>>) => InternalRefetchQueriesInclude) | InternalRefetchQueriesInclude;
40
+ /**
41
+ * If `true`, makes sure all queries included in `refetchQueries` are completed before the mutation is considered complete.
42
+ *
43
+ * The default value is `false` (queries are refetched asynchronously).
44
+ *
45
+ * @docGroup
46
+ *
47
+ * 1. Operation options
48
+ */
49
+ awaitRefetchQueries?: boolean;
50
+ /**
51
+ * A function used to update the Apollo Client cache after the mutation completes.
52
+ *
53
+ * For more information, see [Updating the cache after a mutation](https://www.apollographql.com/docs/react/data/mutations#updating-the-cache-after-a-mutation).
54
+ *
55
+ * @docGroup
56
+ *
57
+ * 3. Caching options
58
+ */
59
+ update?: MutationUpdaterFunction<TData, TVariables, TCache>;
60
+ /**
61
+ * Optional callback for intercepting queries whose cache data has been updated by the mutation, as well as any queries specified in the `refetchQueries: [...]` list passed to `client.mutate`.
62
+ *
63
+ * Returning a `Promise` from `onQueryUpdated` will cause the final mutation `Promise` to await the returned `Promise`. Returning `false` causes the query to be ignored.
64
+ *
65
+ * @docGroup
66
+ *
67
+ * 1. Operation options
68
+ */
69
+ onQueryUpdated?: OnQueryUpdated<any>;
70
+ /**
71
+ * Specifies how the mutation handles a response that returns both GraphQL errors and partial results.
72
+ *
73
+ * For details, see [GraphQL error policies](https://www.apollographql.com/docs/react/data/error-handling/#graphql-error-policies).
74
+ *
75
+ * The default value is `none`, meaning that the mutation result includes error details but _not_ partial results.
76
+ *
77
+ * @docGroup
78
+ *
79
+ * 1. Operation options
80
+ */
81
+ errorPolicy?: ErrorPolicy;
82
+ /**
83
+ * An object containing all of the GraphQL variables your mutation requires to execute.
84
+ *
85
+ * Each key in the object corresponds to a variable name, and that key's value corresponds to the variable value.
86
+ *
87
+ * @docGroup
88
+ *
89
+ * 1. Operation options
90
+ */
91
+ variables?: TConfiguredVariables;
92
+ /**
93
+ * If you're using [Apollo Link](https://www.apollographql.com/docs/react/api/link/introduction/), this object is the initial value of the `context` object that's passed along your link chain.
94
+ *
95
+ * @docGroup
96
+ *
97
+ * 2. Networking options
98
+ */
99
+ context?: DefaultContext;
100
+ /**
101
+ * Provide `no-cache` if the mutation's result should _not_ be written to the Apollo Client cache.
102
+ *
103
+ * The default value is `network-only` (which means the result _is_ written to the cache).
104
+ *
105
+ * Unlike queries, mutations _do not_ support [fetch policies](https://www.apollographql.com/docs/react/data/queries/#setting-a-fetch-policy) besides `network-only` and `no-cache`.
106
+ *
107
+ * @docGroup
108
+ *
109
+ * 3. Caching options
110
+ */
111
+ fetchPolicy?: MutationFetchPolicy;
112
+ /**
113
+ * To avoid retaining sensitive information from mutation root field arguments, Apollo Client v3.4+ automatically clears any `ROOT_MUTATION` fields from the cache after each mutation finishes. If you need this information to remain in the cache, you can prevent the removal by passing `keepRootFields: true` to the mutation. `ROOT_MUTATION` result data are also passed to the mutation `update` function, so we recommend obtaining the results that way, rather than using this option, if possible.
114
+ */
115
+ keepRootFields?: boolean;
116
+ /**
117
+ * The instance of `ApolloClient` to use to execute the mutation.
118
+ *
119
+ * By default, the instance that's passed down via context is used, but you can provide a different instance here.
120
+ *
121
+ * @docGroup
122
+ *
123
+ * 2. Networking options
124
+ */
125
+ client?: ApolloClient;
126
+ /**
127
+ * If `true`, the in-progress mutation's associated component re-renders whenever the network status changes or a network error occurs.
128
+ *
129
+ * The default value is `true`.
130
+ *
131
+ * @docGroup
132
+ *
133
+ * 2. Networking options
134
+ */
135
+ notifyOnNetworkStatusChange?: boolean;
136
+ /**
137
+ * A callback function that's called when your mutation successfully completes with zero errors (or if `errorPolicy` is `ignore` and partial data is returned).
138
+ *
139
+ * This function is passed the mutation's result `data` and any options passed to the mutation.
140
+ *
141
+ * @docGroup
142
+ *
143
+ * 1. Operation options
144
+ */
145
+ onCompleted?: (data: MaybeMasked<TData>, clientOptions?: Options<TData, TVariables, TCache>) => void;
146
+ /**
147
+ * A callback function that's called when the mutation encounters one or more errors (unless `errorPolicy` is `ignore`).
148
+ *
149
+ * This function is passed an [`ApolloError`](https://github.com/apollographql/apollo-client/blob/d96f4578f89b933c281bb775a39503f6cdb59ee8/src/errors/index.ts#L36-L39) object that contains either a `networkError` object or a `graphQLErrors` array, depending on the error(s) that occurred, as well as any options passed the mutation.
150
+ *
151
+ * @docGroup
152
+ *
153
+ * 1. Operation options
154
+ */
155
+ onError?: (error: ErrorLike, clientOptions?: Options<TData, TVariables, TCache>) => void;
156
+ }
157
+ interface Result<TData = unknown> {
158
+ /**
159
+ * The data returned from your mutation. Can be `undefined` if `ignoreResults` is `true`.
160
+ */
161
+ data: MaybeMasked<TData> | null | undefined;
162
+ /**
163
+ * If the mutation produces one or more errors, this object contains either an array of `graphQLErrors` or a single `networkError`. Otherwise, this value is `undefined`.
164
+ *
165
+ * For more information, see [Handling operation errors](https://www.apollographql.com/docs/react/data/error-handling/).
166
+ */
167
+ error: ErrorLike | undefined;
168
+ /**
169
+ * If `true`, the mutation is currently in flight.
170
+ */
171
+ loading: boolean;
172
+ /**
173
+ * If `true`, the mutation's mutate function has been called.
174
+ */
175
+ called: boolean;
176
+ /**
177
+ * The instance of Apollo Client that executed the mutation.
178
+ *
179
+ * Can be useful for manually executing followup operations or writing data to the cache.
180
+ */
181
+ client: ApolloClient;
182
+ /**
183
+ * A function that you can call to reset the mutation's result to its initial, uncalled state.
184
+ */
185
+ reset: () => void;
186
+ }
187
+ type ResultTuple<TData, TVariables extends OperationVariables, TCache extends ApolloCache = ApolloCache> = [
188
+ mutate: MutationFunction<TData, TVariables, TCache>,
189
+ result: Result<TData>
190
+ ];
191
+ type MutationFunction<TData, TVariables extends OperationVariables, TCache extends ApolloCache = ApolloCache> = (...[options]: {} extends TVariables ? [
192
+ options?: MutationFunctionOptions<TData, TVariables, TCache> & {
193
+ /**
194
+ * An object containing all of the GraphQL variables your mutation requires to execute.
195
+ *
196
+ * Each key in the object corresponds to a variable name, and that key's value corresponds to the variable value.
197
+ *
198
+ * @docGroup
199
+ *
200
+ * 1. Operation options
201
+ */
202
+ variables?: TVariables;
203
+ }
204
+ ] : [
205
+ options: MutationFunctionOptions<TData, TVariables, TCache> & {
206
+ /**
207
+ * An object containing all of the GraphQL variables your mutation requires to execute.
208
+ *
209
+ * Each key in the object corresponds to a variable name, and that key's value corresponds to the variable value.
210
+ *
211
+ * @docGroup
212
+ *
213
+ * 1. Operation options
214
+ */
215
+ variables: TVariables;
216
+ }
217
+ ]) => Promise<MutateResult<MaybeMasked<TData>>>;
218
+ type MutationFunctionOptions<TData = unknown, TVariables extends OperationVariables = OperationVariables, TCache extends ApolloCache = ApolloCache> = Options<TData, TVariables, TCache> & {
219
+ /**
220
+ * A GraphQL document, often created with `gql` from the `graphql-tag` package, that contains a single mutation inside of it.
221
+ *
222
+ * @docGroup
223
+ *
224
+ * 1. Operation options
225
+ */
226
+ mutation?: DocumentNode | TypedDocumentNode<TData, TVariables>;
227
+ };
228
+ }
229
+ /**
230
+ *
231
+ *
232
+ * > Refer to the [Mutations](https://www.apollographql.com/docs/react/data/mutations/) section for a more in-depth overview of `useMutation`.
233
+ *
234
+ * @example
235
+ * ```jsx
236
+ * import { gql, useMutation } from '@apollo/client';
237
+ *
238
+ * const ADD_TODO = gql`
239
+ * mutation AddTodo($type: String!) {
240
+ * addTodo(type: $type) {
241
+ * id
242
+ * type
243
+ * }
244
+ * }
245
+ * `;
246
+ *
247
+ * function AddTodo() {
248
+ * let input;
249
+ * const [addTodo, { data }] = useMutation(ADD_TODO);
250
+ *
251
+ * return (
252
+ * <div>
253
+ * <form
254
+ * onSubmit={e => {
255
+ * e.preventDefault();
256
+ * addTodo({ variables: { type: input.value } });
257
+ * input.value = '';
258
+ * }}
259
+ * >
260
+ * <input
261
+ * ref={node => {
262
+ * input = node;
263
+ * }}
264
+ * />
265
+ * <button type="submit">Add Todo</button>
266
+ * </form>
267
+ * </div>
268
+ * );
269
+ * }
270
+ * ```
271
+ * @since 3.0.0
272
+ * @param mutation - A GraphQL mutation document parsed into an AST by `gql`.
273
+ * @param options - Options to control how the mutation is executed.
274
+ * @returns A tuple in the form of `[mutate, result]`
275
+ */
276
+ export declare function useMutation<TData = unknown, TVariables extends OperationVariables = OperationVariables, TCache extends ApolloCache = ApolloCache, TConfiguredVariables extends Partial<TVariables> = {}>(mutation: DocumentNode | TypedDocumentNode<TData, TVariables>, options?: useMutation.Options<NoInfer<TData>, NoInfer<TVariables>, TCache, {
277
+ [K in keyof TConfiguredVariables]: K extends keyof TVariables ? TConfiguredVariables[K] : never;
278
+ }>): useMutation.ResultTuple<TData, MakeRequiredVariablesOptional<TVariables, TConfiguredVariables>, TCache>;
279
+ export {};
280
+ //# sourceMappingURL=useMutation.d.ts.map