@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,263 @@
1
+ import { c as _c } from "@apollo/client/react/internal/compiler-runtime";
2
+ import { equal } from "@wry/equality";
3
+ import * as React from "react";
4
+ import { mergeOptions } from "@apollo/client/utilities/internal";
5
+ import { useIsomorphicLayoutEffect } from "./internal/useIsomorphicLayoutEffect.js";
6
+ import { useApolloClient } from "./useApolloClient.js";
7
+ /**
8
+ *
9
+ *
10
+ * > Refer to the [Mutations](https://www.apollographql.com/docs/react/data/mutations/) section for a more in-depth overview of `useMutation`.
11
+ *
12
+ * @example
13
+ * ```jsx
14
+ * import { gql, useMutation } from '@apollo/client';
15
+ *
16
+ * const ADD_TODO = gql`
17
+ * mutation AddTodo($type: String!) {
18
+ * addTodo(type: $type) {
19
+ * id
20
+ * type
21
+ * }
22
+ * }
23
+ * `;
24
+ *
25
+ * function AddTodo() {
26
+ * let input;
27
+ * const [addTodo, { data }] = useMutation(ADD_TODO);
28
+ *
29
+ * return (
30
+ * <div>
31
+ * <form
32
+ * onSubmit={e => {
33
+ * e.preventDefault();
34
+ * addTodo({ variables: { type: input.value } });
35
+ * input.value = '';
36
+ * }}
37
+ * >
38
+ * <input
39
+ * ref={node => {
40
+ * input = node;
41
+ * }}
42
+ * />
43
+ * <button type="submit">Add Todo</button>
44
+ * </form>
45
+ * </div>
46
+ * );
47
+ * }
48
+ * ```
49
+ * @since 3.0.0
50
+ * @param mutation - A GraphQL mutation document parsed into an AST by `gql`.
51
+ * @param options - Options to control how the mutation is executed.
52
+ * @returns A tuple in the form of `[mutate, result]`
53
+ */
54
+ export function useMutation(mutation, options) {
55
+ const $ = _c(17);
56
+ const client = useApolloClient(options?.client);
57
+ let t0;
58
+
59
+ if ($[0] !== client) {
60
+ t0 = () => createInitialResult(client);
61
+ $[0] = client;
62
+ $[1] = t0;
63
+ } else {
64
+ t0 = $[1];
65
+ }
66
+
67
+ const [result, setResult] = React.useState(t0);
68
+ let t1;
69
+
70
+ if ($[2] !== client || $[3] !== mutation || $[4] !== options || $[5] !== result) {
71
+ t1 = {
72
+ result,
73
+ mutationId: 0,
74
+ isMounted: true,
75
+ client,
76
+ mutation,
77
+ options
78
+ };
79
+ $[2] = client;
80
+ $[3] = mutation;
81
+ $[4] = options;
82
+ $[5] = result;
83
+ $[6] = t1;
84
+ } else {
85
+ t1 = $[6];
86
+ }
87
+
88
+ const ref = React.useRef(t1);
89
+ let t2;
90
+
91
+ if ($[7] !== client || $[8] !== mutation || $[9] !== options) {
92
+ t2 = () => {
93
+ Object.assign(ref.current, {
94
+ client,
95
+ options,
96
+ mutation
97
+ });
98
+ };
99
+ $[7] = client;
100
+ $[8] = mutation;
101
+ $[9] = options;
102
+ $[10] = t2;
103
+ } else {
104
+ t2 = $[10];
105
+ }
106
+
107
+ useIsomorphicLayoutEffect(t2);
108
+ let t3;
109
+
110
+ if ($[11] === Symbol.for("react.memo_cache_sentinel")) {
111
+ t3 = t4 => {
112
+ const executeOptions = t4 === undefined ? {} : t4;
113
+ const {
114
+ options: options_0,
115
+ mutation: mutation_0
116
+ } = ref.current;
117
+ const baseOptions = {
118
+ ...options_0,
119
+ mutation: mutation_0
120
+ };
121
+ const client_0 = executeOptions.client || ref.current.client;
122
+
123
+ if (!ref.current.result.loading && ref.current.isMounted) {
124
+ setResult(ref.current.result = {
125
+ loading: true,
126
+ error: undefined,
127
+ data: undefined,
128
+ called: true,
129
+ client: client_0
130
+ });
131
+ }
132
+
133
+ const mutationId = ref.current.mutationId = ref.current.mutationId + 1;
134
+ const clientOptions = mergeOptions(baseOptions, executeOptions);
135
+
136
+ return client_0.mutate(clientOptions).then(response => {
137
+ const {
138
+ data,
139
+ error
140
+ } = response;
141
+ const onError = executeOptions.onError || ref.current.options?.onError;
142
+
143
+ if (error && onError) {
144
+ onError(error, clientOptions);
145
+ }
146
+
147
+ if (mutationId === ref.current.mutationId) {
148
+ const result_0 = {
149
+ called: true,
150
+ loading: false,
151
+ data,
152
+ error,
153
+ client: client_0
154
+ };
155
+
156
+ if (ref.current.isMounted && !equal(ref.current.result, result_0)) {
157
+ setResult(ref.current.result = result_0);
158
+ }
159
+ }
160
+
161
+ const onCompleted = executeOptions.onCompleted || ref.current.options?.onCompleted;
162
+
163
+ if (!error) {
164
+ onCompleted?.(response.data, clientOptions);
165
+ }
166
+
167
+ return response;
168
+ }, error_0 => {
169
+ if (mutationId === ref.current.mutationId && ref.current.isMounted) {
170
+ const result_1 = {
171
+ loading: false,
172
+ error: error_0,
173
+ data: void 0,
174
+ called: true,
175
+ client: client_0
176
+ };
177
+
178
+ if (!equal(ref.current.result, result_1)) {
179
+ setResult(ref.current.result = result_1);
180
+ }
181
+ }
182
+
183
+ const onError_0 = executeOptions.onError || ref.current.options?.onError;
184
+
185
+ if (onError_0) {
186
+ onError_0(error_0, clientOptions);
187
+ }
188
+
189
+ throw error_0;
190
+ });
191
+ };
192
+ $[11] = t3;
193
+ } else {
194
+ t3 = $[11];
195
+ }
196
+
197
+ const execute = t3;
198
+ let t4;
199
+
200
+ if ($[12] === Symbol.for("react.memo_cache_sentinel")) {
201
+ t4 = () => {
202
+ if (ref.current.isMounted) {
203
+ const result_2 = createInitialResult(ref.current.client);
204
+
205
+ Object.assign(ref.current, {
206
+ mutationId: 0,
207
+ result: result_2
208
+ });
209
+
210
+ setResult(result_2);
211
+ }
212
+ };
213
+ $[12] = t4;
214
+ } else {
215
+ t4 = $[12];
216
+ }
217
+
218
+ const reset = t4;
219
+ let t5;
220
+ let t6;
221
+
222
+ if ($[13] === Symbol.for("react.memo_cache_sentinel")) {
223
+ t5 = () => {
224
+ const current = ref.current;
225
+ current.isMounted = true;
226
+
227
+ return () => {
228
+ current.isMounted = false;
229
+ };
230
+ };t6 = [];
231
+ $[13] = t5;
232
+ $[14] = t6;
233
+ } else {
234
+ t5 = $[13];
235
+ t6 = $[14];
236
+ }
237
+
238
+ React.useEffect(t5, t6);
239
+ let t7;
240
+
241
+ if ($[15] !== result) {
242
+ t7 = [execute, {
243
+ reset,
244
+ ...result
245
+ }];
246
+ $[15] = result;
247
+ $[16] = t7;
248
+ } else {
249
+ t7 = $[16];
250
+ }
251
+
252
+ return t7;
253
+ }
254
+ function createInitialResult(client) {
255
+ return {
256
+ data: undefined,
257
+ error: undefined,
258
+ called: false,
259
+ loading: false,
260
+ client,
261
+ };
262
+ }
263
+ //# sourceMappingURL=useMutation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useMutation.js","sources":["../../../src/react/hooks/useMutation.ts"],"sourcesContent":["import type { TypedDocumentNode } from \"@graphql-typed-document-node/core\";\nimport { equal } from \"@wry/equality\";\nimport * as React from \"react\";\n\nimport type {\n ApolloCache,\n ApolloClient,\n DefaultContext,\n DocumentNode,\n ErrorLike,\n ErrorPolicy,\n InternalRefetchQueriesInclude,\n MaybeMasked,\n MutateResult,\n MutationFetchPolicy,\n MutationOptions,\n MutationQueryReducersMap,\n MutationUpdaterFunction,\n NormalizedExecutionResult,\n OnQueryUpdated,\n OperationVariables,\n Unmasked,\n} from \"@apollo/client\";\nimport type { IgnoreModifier } from \"@apollo/client/cache\";\nimport type { NoInfer, Prettify } from \"@apollo/client/utilities/internal\";\nimport { mergeOptions } from \"@apollo/client/utilities/internal\";\n\nimport { useIsomorphicLayoutEffect } from \"./internal/useIsomorphicLayoutEffect.js\";\nimport { useApolloClient } from \"./useApolloClient.js\";\n\ntype MakeRequiredVariablesOptional<\n TVariables extends OperationVariables,\n TConfiguredVariables extends Partial<TVariables>,\n> = Prettify<\n {\n [K in keyof TVariables as K extends keyof TConfiguredVariables ? K\n : never]?: TVariables[K];\n } & Omit<TVariables, keyof TConfiguredVariables>\n>;\n\nexport declare namespace useMutation {\n export interface Options<\n TData = unknown,\n TVariables extends OperationVariables = OperationVariables,\n TCache extends ApolloCache = ApolloCache,\n TConfiguredVariables extends Partial<TVariables> = Partial<TVariables>,\n > {\n /** {@inheritDoc @apollo/client!MutationOptionsDocumentation#optimisticResponse:member} */\n optimisticResponse?:\n | Unmasked<NoInfer<TData>>\n | ((\n vars: TVariables,\n { IGNORE }: { IGNORE: IgnoreModifier }\n ) => Unmasked<NoInfer<TData>> | IgnoreModifier);\n\n /** {@inheritDoc @apollo/client!MutationOptionsDocumentation#updateQueries:member} */\n updateQueries?: MutationQueryReducersMap<TData>;\n\n /** {@inheritDoc @apollo/client!MutationOptionsDocumentation#refetchQueries:member} */\n refetchQueries?:\n | ((\n result: NormalizedExecutionResult<Unmasked<TData>>\n ) => InternalRefetchQueriesInclude)\n | InternalRefetchQueriesInclude;\n\n /** {@inheritDoc @apollo/client!MutationOptionsDocumentation#awaitRefetchQueries:member} */\n awaitRefetchQueries?: boolean;\n\n /** {@inheritDoc @apollo/client!MutationOptionsDocumentation#update:member} */\n update?: MutationUpdaterFunction<TData, TVariables, TCache>;\n\n /** {@inheritDoc @apollo/client!MutationOptionsDocumentation#onQueryUpdated:member} */\n onQueryUpdated?: OnQueryUpdated<any>;\n\n /** {@inheritDoc @apollo/client!MutationOptionsDocumentation#errorPolicy:member} */\n errorPolicy?: ErrorPolicy;\n\n /** {@inheritDoc @apollo/client!MutationOptionsDocumentation#variables:member} */\n variables?: TConfiguredVariables;\n\n /** {@inheritDoc @apollo/client!MutationOptionsDocumentation#context:member} */\n context?: DefaultContext;\n\n /** {@inheritDoc @apollo/client!MutationOptionsDocumentation#fetchPolicy:member} */\n fetchPolicy?: MutationFetchPolicy;\n\n /** {@inheritDoc @apollo/client!MutationOptionsDocumentation#keepRootFields:member} */\n keepRootFields?: boolean;\n\n /** {@inheritDoc @apollo/client!MutationOptionsDocumentation#client:member} */\n client?: ApolloClient;\n\n /** {@inheritDoc @apollo/client!MutationOptionsDocumentation#notifyOnNetworkStatusChange:member} */\n notifyOnNetworkStatusChange?: boolean;\n\n /** {@inheritDoc @apollo/client!MutationOptionsDocumentation#onCompleted:member} */\n onCompleted?: (\n data: MaybeMasked<TData>,\n clientOptions?: Options<TData, TVariables, TCache>\n ) => void;\n\n /** {@inheritDoc @apollo/client!MutationOptionsDocumentation#onError:member} */\n onError?: (\n error: ErrorLike,\n clientOptions?: Options<TData, TVariables, TCache>\n ) => void;\n }\n\n export interface Result<TData = unknown> {\n /** {@inheritDoc @apollo/client!MutationResultDocumentation#data:member} */\n data: MaybeMasked<TData> | null | undefined;\n\n /** {@inheritDoc @apollo/client!MutationResultDocumentation#error:member} */\n error: ErrorLike | undefined;\n\n /** {@inheritDoc @apollo/client!MutationResultDocumentation#loading:member} */\n loading: boolean;\n\n /** {@inheritDoc @apollo/client!MutationResultDocumentation#called:member} */\n called: boolean;\n\n /** {@inheritDoc @apollo/client!MutationResultDocumentation#client:member} */\n client: ApolloClient;\n\n /** {@inheritDoc @apollo/client!MutationResultDocumentation#reset:member} */\n reset: () => void;\n }\n\n export type ResultTuple<\n TData,\n TVariables extends OperationVariables,\n TCache extends ApolloCache = ApolloCache,\n > = [\n mutate: MutationFunction<TData, TVariables, TCache>,\n result: Result<TData>,\n ];\n\n export type MutationFunction<\n TData,\n TVariables extends OperationVariables,\n TCache extends ApolloCache = ApolloCache,\n > = (\n ...[options]: {} extends TVariables ?\n [\n options?: MutationFunctionOptions<TData, TVariables, TCache> & {\n /** {@inheritDoc @apollo/client!MutationOptionsDocumentation#variables:member} */\n variables?: TVariables;\n },\n ]\n : [\n options: MutationFunctionOptions<TData, TVariables, TCache> & {\n /** {@inheritDoc @apollo/client!MutationOptionsDocumentation#variables:member} */\n variables: TVariables;\n },\n ]\n ) => Promise<MutateResult<MaybeMasked<TData>>>;\n\n export type MutationFunctionOptions<\n TData = unknown,\n TVariables extends OperationVariables = OperationVariables,\n TCache extends ApolloCache = ApolloCache,\n > = Options<TData, TVariables, TCache> & {\n /** {@inheritDoc @apollo/client!MutationOptionsDocumentation#mutation:member} */\n // TODO: Remove this option. We shouldn't allow the mutation to be overridden\n // in the mutation function\n mutation?: DocumentNode | TypedDocumentNode<TData, TVariables>;\n };\n}\n\n/**\n *\n *\n * > Refer to the [Mutations](https://www.apollographql.com/docs/react/data/mutations/) section for a more in-depth overview of `useMutation`.\n *\n * @example\n * ```jsx\n * import { gql, useMutation } from '@apollo/client';\n *\n * const ADD_TODO = gql`\n * mutation AddTodo($type: String!) {\n * addTodo(type: $type) {\n * id\n * type\n * }\n * }\n * `;\n *\n * function AddTodo() {\n * let input;\n * const [addTodo, { data }] = useMutation(ADD_TODO);\n *\n * return (\n * <div>\n * <form\n * onSubmit={e => {\n * e.preventDefault();\n * addTodo({ variables: { type: input.value } });\n * input.value = '';\n * }}\n * >\n * <input\n * ref={node => {\n * input = node;\n * }}\n * />\n * <button type=\"submit\">Add Todo</button>\n * </form>\n * </div>\n * );\n * }\n * ```\n * @since 3.0.0\n * @param mutation - A GraphQL mutation document parsed into an AST by `gql`.\n * @param options - Options to control how the mutation is executed.\n * @returns A tuple in the form of `[mutate, result]`\n */\nexport function useMutation<\n TData = unknown,\n TVariables extends OperationVariables = OperationVariables,\n TCache extends ApolloCache = ApolloCache,\n TConfiguredVariables extends Partial<TVariables> = {},\n>(\n mutation: DocumentNode | TypedDocumentNode<TData, TVariables>,\n options?: useMutation.Options<\n NoInfer<TData>,\n NoInfer<TVariables>,\n TCache,\n {\n [K in keyof TConfiguredVariables]: K extends keyof TVariables ?\n TConfiguredVariables[K]\n : never;\n }\n >\n): useMutation.ResultTuple<\n TData,\n MakeRequiredVariablesOptional<TVariables, TConfiguredVariables>,\n TCache\n> {\n const client = useApolloClient(options?.client);\n const [result, setResult] = React.useState<\n Omit<useMutation.Result<TData>, \"reset\">\n >(() => createInitialResult(client));\n\n const ref = React.useRef({\n result,\n mutationId: 0,\n isMounted: true,\n client,\n mutation,\n options,\n });\n\n useIsomorphicLayoutEffect(() => {\n Object.assign(ref.current, { client, options, mutation });\n });\n\n const execute = React.useCallback(\n (\n executeOptions: useMutation.MutationFunctionOptions<\n TData,\n TVariables,\n TCache\n > = {} as useMutation.MutationFunctionOptions<TData, TVariables, TCache>\n ) => {\n const { options, mutation } = ref.current;\n const baseOptions = { ...options, mutation };\n const client = executeOptions.client || ref.current.client;\n\n if (!ref.current.result.loading && ref.current.isMounted) {\n setResult(\n (ref.current.result = {\n loading: true,\n error: undefined,\n data: undefined,\n called: true,\n client,\n })\n );\n }\n\n const mutationId = ++ref.current.mutationId;\n const clientOptions = mergeOptions(baseOptions, executeOptions as any);\n\n return client\n .mutate(clientOptions as MutationOptions<TData, OperationVariables>)\n .then(\n (response) => {\n const { data, error } = response;\n\n const onError =\n executeOptions.onError || ref.current.options?.onError;\n\n if (error && onError) {\n onError(error, clientOptions);\n }\n\n if (mutationId === ref.current.mutationId) {\n const result = {\n called: true,\n loading: false,\n data,\n error,\n client,\n };\n\n if (ref.current.isMounted && !equal(ref.current.result, result)) {\n setResult((ref.current.result = result));\n }\n }\n\n const onCompleted =\n executeOptions.onCompleted || ref.current.options?.onCompleted;\n\n if (!error) {\n onCompleted?.(response.data!, clientOptions);\n }\n\n return response;\n },\n (error) => {\n if (\n mutationId === ref.current.mutationId &&\n ref.current.isMounted\n ) {\n const result = {\n loading: false,\n error,\n data: void 0,\n called: true,\n client,\n };\n\n if (!equal(ref.current.result, result)) {\n setResult((ref.current.result = result));\n }\n }\n\n const onError =\n executeOptions.onError || ref.current.options?.onError;\n\n if (onError) {\n onError(error, clientOptions);\n }\n\n throw error;\n }\n );\n },\n []\n );\n\n const reset = React.useCallback(() => {\n if (ref.current.isMounted) {\n const result = createInitialResult(ref.current.client);\n Object.assign(ref.current, { mutationId: 0, result });\n setResult(result);\n }\n }, []);\n\n React.useEffect(() => {\n const current = ref.current;\n current.isMounted = true;\n\n return () => {\n current.isMounted = false;\n };\n }, []);\n\n return [execute as any, { reset, ...result }];\n}\n\nfunction createInitialResult(client: ApolloClient) {\n return {\n data: undefined,\n error: undefined,\n called: false,\n loading: false,\n client,\n };\n}\n"],"names":[],"mappings":";AACA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAO,EAAE,CAAT,CAAA,CAAA,CAAA,EAAA,EAAA,CAAA,CAAA,CAAA,EAAsB,CAAtB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAqC;AACrC,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;AAuB9B,CAAA,CAAA,CAAA,CAAA,CAAA,EAAO,EAAE,CAAT,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,EAAA,CAAA,CAAA,CAAA,EAA6B,CAA7B,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,CAAgE;AAEhE,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,EAAA,EAAA,CAAA,CAAA,CAAA,EAA0C,CAA1C,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,CAAmF;AACnF,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;AA6ItD,CAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8CA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;SA4JS,CAAT,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAA6B,CAA7B,CAAA,CAAA,CAAA,CAAA,GAAA;IACE,CAAF,CAAA,CAAA,CAAA,CAAA,EAAS;QACL,CAAJ,CAAA,CAAA,CAAQ,EAAE,CAAV,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAmB;QACf,CAAJ,CAAA,CAAA,CAAA,CAAS,EAAE,CAAX,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAoB;QAChB,CAAJ,CAAA,CAAA,CAAA,CAAA,CAAU,EAAE,CAAZ,CAAA,CAAA,CAAA,CAAiB;QACb,CAAJ,CAAA,CAAA,CAAA,CAAA,CAAA,CAAW,EAAE,CAAb,CAAA,CAAA,CAAA,CAAkB;QACd,CAAJ,CAAA,CAAA,CAAA,CAAA,CAAU;IACV,CAAG;AACH;"}
@@ -0,0 +1,265 @@
1
+ import type { ApolloClient, ApolloQueryResult, DataState, DefaultContext, DocumentNode, ErrorLike, ErrorPolicy, FetchMoreOptions, GetDataState, ObservableQuery, OperationVariables, QueryResult, RefetchWritePolicy, SubscribeToMoreFunction, TypedDocumentNode, UpdateQueryMapFn, WatchQueryFetchPolicy, WatchQueryOptions } from "@apollo/client";
2
+ import { NetworkStatus } from "@apollo/client";
3
+ import type { MaybeMasked } from "@apollo/client/masking";
4
+ import type { NoInfer, VariablesOption } from "@apollo/client/utilities/internal";
5
+ import type { NextFetchPolicyContext } from "../../core/watchQueryOptions.js";
6
+ export declare namespace useQuery {
7
+ type Options<TData = unknown, TVariables extends OperationVariables = OperationVariables> = {
8
+ /**
9
+ * Specifies how the query interacts with the Apollo Client cache during execution (for example, whether it checks the cache for results before sending a request to the server).
10
+ *
11
+ * For details, see [Setting a fetch policy](https://www.apollographql.com/docs/react/data/queries/#setting-a-fetch-policy).
12
+ *
13
+ * The default value is `cache-first`.
14
+ *
15
+ * @docGroup
16
+ *
17
+ * 3. Caching options
18
+ */
19
+ fetchPolicy?: WatchQueryFetchPolicy;
20
+ /**
21
+ * Specifies the `FetchPolicy` to be used after this query has completed.
22
+ *
23
+ * @docGroup
24
+ *
25
+ * 3. Caching options
26
+ */
27
+ nextFetchPolicy?: WatchQueryFetchPolicy | ((this: WatchQueryOptions<TVariables, TData>, currentFetchPolicy: WatchQueryFetchPolicy, context: NextFetchPolicyContext<TData, TVariables>) => WatchQueryFetchPolicy);
28
+ /**
29
+ * Defaults to the initial value of options.fetchPolicy, but can be explicitly configured to specify the WatchQueryFetchPolicy to revert back to whenever variables change (unless nextFetchPolicy intervenes).
30
+ *
31
+ * @docGroup
32
+ *
33
+ * 3. Caching options
34
+ */
35
+ initialFetchPolicy?: WatchQueryFetchPolicy;
36
+ /**
37
+ * Specifies whether a `NetworkStatus.refetch` operation should merge incoming field data with existing data, or overwrite the existing data. Overwriting is probably preferable, but merging is currently the default behavior, for backwards compatibility with Apollo Client 3.x.
38
+ *
39
+ * @docGroup
40
+ *
41
+ * 3. Caching options
42
+ */
43
+ refetchWritePolicy?: RefetchWritePolicy;
44
+ /**
45
+ * Specifies how the query handles a response that returns both GraphQL errors and partial results.
46
+ *
47
+ * For details, see [GraphQL error policies](https://www.apollographql.com/docs/react/data/error-handling/#graphql-error-policies).
48
+ *
49
+ * The default value is `none`, meaning that the query result includes error details but not partial results.
50
+ *
51
+ * @docGroup
52
+ *
53
+ * 1. Operation options
54
+ */
55
+ errorPolicy?: ErrorPolicy;
56
+ /**
57
+ * Specifies the interval (in milliseconds) at which the query polls for updated results.
58
+ *
59
+ * The default value is `0` (no polling).
60
+ *
61
+ * @docGroup
62
+ *
63
+ * 2. Networking options
64
+ */
65
+ pollInterval?: number;
66
+ /**
67
+ * If `true`, the in-progress query's associated component re-renders whenever the network status changes or a network error occurs.
68
+ *
69
+ * The default value is `true`.
70
+ *
71
+ * @docGroup
72
+ *
73
+ * 2. Networking options
74
+ */
75
+ notifyOnNetworkStatusChange?: boolean;
76
+ /**
77
+ * If `true`, the query can return partial results from the cache if the cache doesn't contain results for all queried fields.
78
+ *
79
+ * The default value is `false`.
80
+ *
81
+ * @docGroup
82
+ *
83
+ * 3. Caching options
84
+ */
85
+ returnPartialData?: boolean;
86
+ /**
87
+ * A callback function that's called whenever a refetch attempt occurs while polling. If the function returns `true`, the refetch is skipped and not reattempted until the next poll interval.
88
+ *
89
+ * @docGroup
90
+ *
91
+ * 2. Networking options
92
+ */
93
+ skipPollAttempt?: () => boolean;
94
+ /**
95
+ * Pass `false` to skip executing the query during [server-side rendering](https://www.apollographql.com/docs/react/performance/server-side-rendering/).
96
+ *
97
+ * @docGroup
98
+ *
99
+ * 2. Networking options
100
+ */
101
+ ssr?: boolean;
102
+ /**
103
+ * The instance of `ApolloClient` to use to execute the query.
104
+ *
105
+ * By default, the instance that's passed down via context is used, but you can provide a different instance here.
106
+ *
107
+ * @docGroup
108
+ *
109
+ * 1. Operation options
110
+ */
111
+ client?: ApolloClient;
112
+ /**
113
+ * 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.
114
+ *
115
+ * @docGroup
116
+ *
117
+ * 2. Networking options
118
+ */
119
+ context?: DefaultContext;
120
+ /**
121
+ * If true, the query is not executed.
122
+ *
123
+ * The default value is `false`.
124
+ *
125
+ * @docGroup
126
+ *
127
+ * 1. Operation options
128
+ */
129
+ skip?: boolean;
130
+ } & VariablesOption<TVariables>;
131
+ type Result<TData = unknown, TVariables extends OperationVariables = OperationVariables, TStates extends DataState<TData>["dataState"] = DataState<TData>["dataState"]> = {
132
+ /**
133
+ * The instance of Apollo Client that executed the query. Can be useful for manually executing followup queries or writing data to the cache.
134
+ *
135
+ * @docGroup
136
+ *
137
+ * 2. Network info
138
+ */
139
+ client: ApolloClient;
140
+ /**
141
+ * A reference to the internal `ObservableQuery` used by the hook.
142
+ */
143
+ observable: ObservableQuery<TData, TVariables>;
144
+ /**
145
+ * An object containing the result from the most recent _previous_ execution of this query.
146
+ *
147
+ * This value is `undefined` if this is the query's first execution.
148
+ *
149
+ * @docGroup
150
+ *
151
+ * 1. Operation data
152
+ */
153
+ previousData?: MaybeMasked<TData>;
154
+ /**
155
+ * If the query produces one or more errors, this object contains either an array of `graphQLErrors` or a single `networkError`. Otherwise, this value is `undefined`.
156
+ *
157
+ * For more information, see [Handling operation errors](https://www.apollographql.com/docs/react/data/error-handling/).
158
+ *
159
+ * @docGroup
160
+ *
161
+ * 1. Operation data
162
+ */
163
+ error?: ErrorLike;
164
+ /**
165
+ * If `true`, the query is still in flight and results have not yet been returned.
166
+ *
167
+ * @docGroup
168
+ *
169
+ * 2. Network info
170
+ */
171
+ loading: boolean;
172
+ /**
173
+ * A number indicating the current network state of the query's associated request. [See possible values.](https://github.com/apollographql/apollo-client/blob/d96f4578f89b933c281bb775a39503f6cdb59ee8/src/core/networkStatus.ts#L4)
174
+ *
175
+ * Used in conjunction with the [`notifyOnNetworkStatusChange`](#notifyonnetworkstatuschange) option.
176
+ *
177
+ * @docGroup
178
+ *
179
+ * 2. Network info
180
+ */
181
+ networkStatus: NetworkStatus;
182
+ /**
183
+ * A function that instructs the query to begin re-executing at a specified interval (in milliseconds).
184
+ *
185
+ *
186
+ * @docGroup
187
+ *
188
+ * 3. Helper functions
189
+ */
190
+ startPolling: (pollInterval: number) => void;
191
+ /**
192
+ * A function that instructs the query to stop polling after a previous call to `startPolling`.
193
+ *
194
+ *
195
+ * @docGroup
196
+ *
197
+ * 3. Helper functions
198
+ */
199
+ stopPolling: () => void;
200
+ /**
201
+ * A function that enables you to execute a [subscription](https://www.apollographql.com/docs/react/data/subscriptions/), usually to subscribe to specific fields that were included in the query.
202
+ *
203
+ * This function returns _another_ function that you can call to terminate the subscription.
204
+ *
205
+ *
206
+ * @docGroup
207
+ *
208
+ * 3. Helper functions
209
+ */
210
+ subscribeToMore: SubscribeToMoreFunction<TData, TVariables>;
211
+ /**
212
+ * A function that enables you to update the query's cached result without executing a followup GraphQL operation.
213
+ *
214
+ * See [using updateQuery and updateFragment](https://www.apollographql.com/docs/react/caching/cache-interaction/#using-updatequery-and-updatefragment) for additional information.
215
+ *
216
+ *
217
+ * @docGroup
218
+ *
219
+ * 3. Helper functions
220
+ */
221
+ updateQuery: (mapFn: UpdateQueryMapFn<TData, TVariables>) => void;
222
+ /**
223
+ * A function that enables you to re-execute the query, optionally passing in new `variables`.
224
+ *
225
+ * To guarantee that the refetch performs a network request, its `fetchPolicy` is set to `network-only` (unless the original query's `fetchPolicy` is `no-cache` or `cache-and-network`, which also guarantee a network request).
226
+ *
227
+ * See also [Refetching](https://www.apollographql.com/docs/react/data/queries/#refetching).
228
+ *
229
+ * @docGroup
230
+ *
231
+ * 3. Helper functions
232
+ */
233
+ refetch: (variables?: Partial<TVariables>) => Promise<QueryResult<MaybeMasked<TData>>>;
234
+ /**
235
+ * An object containing the variables that were provided for the query.
236
+ *
237
+ * @docGroup
238
+ *
239
+ * 1. Operation data
240
+ */
241
+ variables: TVariables;
242
+ /**
243
+ * A function that helps you fetch the next set of results for a [paginated list field](https://www.apollographql.com/docs/react/pagination/core-api/).
244
+ *
245
+ *
246
+ * @docGroup
247
+ *
248
+ * 3. Helper functions
249
+ */
250
+ fetchMore: <TFetchData = TData, TFetchVars extends OperationVariables = TVariables>(fetchMoreOptions: FetchMoreOptions<TData, TVariables, TFetchData, TFetchVars>) => Promise<QueryResult<MaybeMasked<TFetchData>>>;
251
+ } & GetDataState<MaybeMasked<TData>, TStates>;
252
+ }
253
+ export declare function useQuery<TData = unknown, TVariables extends OperationVariables = OperationVariables>(query: DocumentNode | TypedDocumentNode<TData, TVariables>, options: useQuery.Options<NoInfer<TData>, NoInfer<TVariables>> & {
254
+ returnPartialData: true;
255
+ }): useQuery.Result<TData, TVariables, "empty" | "complete" | "streaming" | "partial">;
256
+ export declare function useQuery<TData = unknown, TVariables extends OperationVariables = OperationVariables>(query: DocumentNode | TypedDocumentNode<TData, TVariables>, options: useQuery.Options<NoInfer<TData>, NoInfer<TVariables>> & {
257
+ returnPartialData: boolean;
258
+ }): useQuery.Result<TData, TVariables, "empty" | "complete" | "streaming" | "partial">;
259
+ export declare function useQuery<TData = unknown, TVariables extends OperationVariables = OperationVariables>(query: DocumentNode | TypedDocumentNode<TData, TVariables>, ...[options]: {} extends TVariables ? [
260
+ options?: useQuery.Options<NoInfer<TData>, NoInfer<TVariables>>
261
+ ] : [options: useQuery.Options<NoInfer<TData>, NoInfer<TVariables>>]): useQuery.Result<TData, TVariables, "empty" | "complete" | "streaming">;
262
+ export declare namespace useQuery {
263
+ var ssrDisabledResult: ApolloQueryResult<any>;
264
+ }
265
+ //# sourceMappingURL=useQuery.d.ts.map