@apollo/client 4.0.0-alpha.21 → 4.0.0-alpha.23

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 (379) hide show
  1. package/CHANGELOG.md +341 -2
  2. package/__cjs/cache/core/cache.cjs +1 -1
  3. package/__cjs/cache/inmemory/entityStore.cjs +3 -3
  4. package/__cjs/cache/inmemory/key-extractor.cjs +1 -1
  5. package/__cjs/cache/inmemory/key-extractor.cjs.map +1 -1
  6. package/__cjs/cache/inmemory/policies.cjs +4 -4
  7. package/__cjs/cache/inmemory/policies.cjs.map +1 -1
  8. package/__cjs/cache/inmemory/readFromStore.cjs +2 -2
  9. package/__cjs/cache/inmemory/writeToStore.cjs +4 -4
  10. package/__cjs/core/ApolloClient.cjs +24 -19
  11. package/__cjs/core/ApolloClient.cjs.map +1 -1
  12. package/__cjs/core/ApolloClient.d.cts +15 -11
  13. package/__cjs/core/ObservableQuery.cjs +52 -48
  14. package/__cjs/core/ObservableQuery.cjs.map +1 -1
  15. package/__cjs/core/ObservableQuery.d.cts +48 -14
  16. package/__cjs/core/QueryInfo.cjs +146 -168
  17. package/__cjs/core/QueryInfo.cjs.map +1 -1
  18. package/__cjs/core/QueryInfo.d.cts +14 -11
  19. package/__cjs/core/QueryManager.cjs +138 -123
  20. package/__cjs/core/QueryManager.cjs.map +1 -1
  21. package/__cjs/core/QueryManager.d.cts +17 -6
  22. package/__cjs/core/index.cjs +2 -1
  23. package/__cjs/core/index.cjs.map +1 -1
  24. package/__cjs/core/index.d.cts +4 -4
  25. package/__cjs/core/types.d.cts +72 -18
  26. package/__cjs/core/watchQueryOptions.d.cts +2 -24
  27. package/__cjs/dev/setErrorMessageHandler.cjs.map +1 -1
  28. package/__cjs/errors/CombinedGraphQLErrors.cjs +6 -3
  29. package/__cjs/errors/CombinedGraphQLErrors.cjs.map +1 -1
  30. package/__cjs/errors/CombinedGraphQLErrors.d.cts +7 -2
  31. package/__cjs/errors/index.cjs +1 -1
  32. package/__cjs/errors/index.cjs.map +1 -1
  33. package/__cjs/errors/index.d.cts +1 -3
  34. package/__cjs/incremental/handlers/defer20220824.cjs +102 -0
  35. package/__cjs/incremental/handlers/defer20220824.cjs.map +1 -0
  36. package/__cjs/incremental/handlers/defer20220824.d.cts +55 -0
  37. package/__cjs/incremental/handlers/notImplemented.cjs +19 -0
  38. package/__cjs/incremental/handlers/notImplemented.cjs.map +1 -0
  39. package/__cjs/incremental/handlers/notImplemented.d.cts +9 -0
  40. package/__cjs/incremental/index.cjs +9 -0
  41. package/__cjs/incremental/index.cjs.map +1 -0
  42. package/__cjs/incremental/index.d.cts +4 -0
  43. package/__cjs/incremental/types.cjs +3 -0
  44. package/__cjs/incremental/types.cjs.map +1 -0
  45. package/__cjs/incremental/types.d.cts +24 -0
  46. package/__cjs/invariantErrorCodes.cjs +131 -114
  47. package/__cjs/link/batch-http/batchHttpLink.cjs +14 -14
  48. package/__cjs/link/batch-http/batchHttpLink.cjs.map +1 -1
  49. package/__cjs/link/batch-http/batchHttpLink.d.cts +4 -0
  50. package/__cjs/link/batch-http/index.cjs +2 -1
  51. package/__cjs/link/batch-http/index.cjs.map +1 -1
  52. package/__cjs/link/batch-http/index.d.cts +1 -1
  53. package/__cjs/link/client-awareness/ClientAwarenessLink.cjs +45 -0
  54. package/__cjs/link/client-awareness/ClientAwarenessLink.cjs.map +1 -0
  55. package/__cjs/link/client-awareness/ClientAwarenessLink.d.cts +62 -0
  56. package/__cjs/link/client-awareness/index.cjs +6 -0
  57. package/__cjs/link/client-awareness/index.cjs.map +1 -0
  58. package/__cjs/link/client-awareness/index.d.cts +2 -0
  59. package/__cjs/link/context/index.cjs +36 -25
  60. package/__cjs/link/context/index.cjs.map +1 -1
  61. package/__cjs/link/context/index.d.cts +8 -1
  62. package/__cjs/link/core/types.d.cts +5 -38
  63. package/__cjs/link/error/index.cjs +68 -65
  64. package/__cjs/link/error/index.cjs.map +1 -1
  65. package/__cjs/link/error/index.d.cts +15 -14
  66. package/__cjs/link/http/BaseHttpLink.cjs +111 -0
  67. package/__cjs/link/http/BaseHttpLink.cjs.map +1 -0
  68. package/__cjs/link/http/BaseHttpLink.d.cts +6 -0
  69. package/__cjs/link/http/HttpLink.cjs +12 -5
  70. package/__cjs/link/http/HttpLink.cjs.map +1 -1
  71. package/__cjs/link/http/HttpLink.d.cts +20 -4
  72. package/__cjs/link/http/checkFetcher.cjs +1 -1
  73. package/__cjs/link/http/index.cjs +4 -3
  74. package/__cjs/link/http/index.cjs.map +1 -1
  75. package/__cjs/link/http/index.d.cts +2 -2
  76. package/__cjs/link/http/parseAndCheckHttpResponse.cjs +45 -57
  77. package/__cjs/link/http/parseAndCheckHttpResponse.cjs.map +1 -1
  78. package/__cjs/link/http/selectHttpOptionsAndBody.cjs +6 -5
  79. package/__cjs/link/http/selectHttpOptionsAndBody.cjs.map +1 -1
  80. package/__cjs/link/index.cjs.map +1 -1
  81. package/__cjs/link/index.d.cts +1 -1
  82. package/__cjs/link/persisted-queries/index.cjs +159 -141
  83. package/__cjs/link/persisted-queries/index.cjs.map +1 -1
  84. package/__cjs/link/persisted-queries/index.d.cts +19 -19
  85. package/__cjs/link/remove-typename/index.cjs +2 -1
  86. package/__cjs/link/remove-typename/index.cjs.map +1 -1
  87. package/__cjs/link/remove-typename/index.d.cts +1 -1
  88. package/__cjs/link/remove-typename/removeTypenameFromVariables.cjs +34 -23
  89. package/__cjs/link/remove-typename/removeTypenameFromVariables.cjs.map +1 -1
  90. package/__cjs/link/remove-typename/removeTypenameFromVariables.d.cts +8 -9
  91. package/__cjs/link/utils/validateOperation.cjs +1 -1
  92. package/__cjs/local-state/LocalState.cjs +10 -18
  93. package/__cjs/local-state/LocalState.cjs.map +1 -1
  94. package/__cjs/local-state/LocalState.d.cts +3 -4
  95. package/__cjs/masking/maskDefinition.cjs +2 -2
  96. package/__cjs/masking/maskFragment.cjs +2 -2
  97. package/__cjs/masking/maskOperation.cjs +1 -1
  98. package/__cjs/masking/types.d.cts +6 -5
  99. package/__cjs/masking/utils.cjs +3 -3
  100. package/__cjs/react/context/ApolloConsumer.cjs +1 -1
  101. package/__cjs/react/context/ApolloContext.cjs +1 -1
  102. package/__cjs/react/context/ApolloProvider.cjs +1 -1
  103. package/__cjs/react/hooks/internal/validateSuspenseHookOptions.cjs +2 -2
  104. package/__cjs/react/hooks/useApolloClient.cjs +1 -1
  105. package/__cjs/react/hooks/useBackgroundQuery.cjs +1 -0
  106. package/__cjs/react/hooks/useBackgroundQuery.cjs.map +1 -1
  107. package/__cjs/react/hooks/useFragment.cjs +1 -0
  108. package/__cjs/react/hooks/useFragment.cjs.map +1 -1
  109. package/__cjs/react/hooks/useLazyQuery.cjs +4 -4
  110. package/__cjs/react/hooks/useLazyQuery.cjs.map +1 -1
  111. package/__cjs/react/hooks/useLazyQuery.d.cts +2 -7
  112. package/__cjs/react/hooks/useLoadableQuery.cjs +2 -2
  113. package/__cjs/react/hooks/useLoadableQuery.cjs.map +1 -1
  114. package/__cjs/react/hooks/useMutation.cjs.map +1 -1
  115. package/__cjs/react/hooks/useMutation.d.cts +2 -2
  116. package/__cjs/react/hooks/useQuery.cjs +23 -21
  117. package/__cjs/react/hooks/useQuery.cjs.map +1 -1
  118. package/__cjs/react/hooks/useQuery.d.cts +3 -8
  119. package/__cjs/react/hooks/useQueryRefHandlers.cjs +1 -0
  120. package/__cjs/react/hooks/useQueryRefHandlers.cjs.map +1 -1
  121. package/__cjs/react/hooks/useReadQuery.cjs +1 -0
  122. package/__cjs/react/hooks/useReadQuery.cjs.map +1 -1
  123. package/__cjs/react/hooks/useSubscription.cjs +1 -1
  124. package/__cjs/react/hooks/useSuspenseFragment.cjs +1 -0
  125. package/__cjs/react/hooks/useSuspenseFragment.cjs.map +1 -1
  126. package/__cjs/react/hooks/useSuspenseQuery.cjs +1 -0
  127. package/__cjs/react/hooks/useSuspenseQuery.cjs.map +1 -1
  128. package/__cjs/react/hooks/useSyncExternalStore.cjs +1 -1
  129. package/__cjs/react/internal/cache/QueryReference.cjs +5 -5
  130. package/__cjs/react/internal/cache/QueryReference.cjs.map +1 -1
  131. package/__cjs/react/internal/cache/QueryReference.d.cts +2 -3
  132. package/__cjs/react/internal/types.d.cts +2 -7
  133. package/__cjs/react/ssr/prerenderStatic.cjs +2 -2
  134. package/__cjs/testing/core/mocking/mockLink.cjs +4 -4
  135. package/__cjs/utilities/caching/sizes.cjs.map +1 -1
  136. package/__cjs/utilities/caching/sizes.d.cts +6 -0
  137. package/__cjs/utilities/graphql/DocumentTransform.cjs +1 -1
  138. package/__cjs/utilities/graphql/isFormattedExecutionResult.cjs +9 -0
  139. package/__cjs/utilities/graphql/isFormattedExecutionResult.cjs.map +1 -0
  140. package/__cjs/utilities/graphql/isFormattedExecutionResult.d.cts +3 -0
  141. package/__cjs/utilities/index.cjs +3 -1
  142. package/__cjs/utilities/index.cjs.map +1 -1
  143. package/__cjs/utilities/index.d.cts +1 -0
  144. package/__cjs/utilities/internal/checkDocument.cjs +47 -13
  145. package/__cjs/utilities/internal/checkDocument.cjs.map +1 -1
  146. package/__cjs/utilities/internal/checkDocument.d.cts +1 -1
  147. package/__cjs/utilities/internal/getFragmentDefinition.cjs +3 -3
  148. package/__cjs/utilities/internal/getFragmentFromSelection.cjs +1 -1
  149. package/__cjs/utilities/internal/getFragmentQueryDocument.cjs +2 -2
  150. package/__cjs/utilities/internal/getGraphQLErrorsFromResult.cjs +1 -12
  151. package/__cjs/utilities/internal/getGraphQLErrorsFromResult.cjs.map +1 -1
  152. package/__cjs/utilities/internal/getGraphQLErrorsFromResult.d.cts +4 -2
  153. package/__cjs/utilities/internal/getMainDefinition.cjs +1 -1
  154. package/__cjs/utilities/internal/getMemoryInternals.cjs +1 -0
  155. package/__cjs/utilities/internal/getMemoryInternals.cjs.map +1 -1
  156. package/__cjs/utilities/internal/getMemoryInternals.d.cts +0 -1
  157. package/__cjs/utilities/internal/getQueryDefinition.cjs +1 -1
  158. package/__cjs/utilities/internal/graphQLResultHasError.cjs +1 -4
  159. package/__cjs/utilities/internal/graphQLResultHasError.cjs.map +1 -1
  160. package/__cjs/utilities/internal/graphQLResultHasError.d.cts +2 -2
  161. package/__cjs/utilities/internal/index.cjs +2 -10
  162. package/__cjs/utilities/internal/index.cjs.map +1 -1
  163. package/__cjs/utilities/internal/index.d.cts +0 -4
  164. package/__cjs/utilities/internal/removeDirectivesFromDocument.cjs +1 -1
  165. package/__cjs/utilities/internal/shouldInclude.cjs +4 -4
  166. package/__cjs/utilities/internal/valueToObjectRepresentation.cjs +1 -1
  167. package/__cjs/version.cjs +3 -2
  168. package/__cjs/version.cjs.map +1 -1
  169. package/__cjs/version.d.cts +1 -0
  170. package/cache/core/cache.js +1 -1
  171. package/cache/inmemory/entityStore.js +3 -3
  172. package/cache/inmemory/key-extractor.js +1 -1
  173. package/cache/inmemory/key-extractor.js.map +1 -1
  174. package/cache/inmemory/policies.js +4 -4
  175. package/cache/inmemory/policies.js.map +1 -1
  176. package/cache/inmemory/readFromStore.js +2 -2
  177. package/cache/inmemory/writeToStore.js +4 -4
  178. package/core/ApolloClient.d.ts +15 -11
  179. package/core/ApolloClient.js +25 -20
  180. package/core/ApolloClient.js.map +1 -1
  181. package/core/ObservableQuery.d.ts +48 -14
  182. package/core/ObservableQuery.js +53 -49
  183. package/core/ObservableQuery.js.map +1 -1
  184. package/core/QueryInfo.d.ts +14 -11
  185. package/core/QueryInfo.js +147 -169
  186. package/core/QueryInfo.js.map +1 -1
  187. package/core/QueryManager.d.ts +17 -6
  188. package/core/QueryManager.js +140 -125
  189. package/core/QueryManager.js.map +1 -1
  190. package/core/index.d.ts +4 -4
  191. package/core/index.js +1 -1
  192. package/core/index.js.map +1 -1
  193. package/core/types.d.ts +72 -18
  194. package/core/watchQueryOptions.d.ts +2 -24
  195. package/dev/setErrorMessageHandler.js.map +1 -1
  196. package/errors/CombinedGraphQLErrors.d.ts +7 -2
  197. package/errors/CombinedGraphQLErrors.js +6 -3
  198. package/errors/CombinedGraphQLErrors.js.map +1 -1
  199. package/errors/index.d.ts +1 -3
  200. package/errors/index.js +1 -1
  201. package/errors/index.js.map +1 -1
  202. package/incremental/handlers/defer20220824.d.ts +55 -0
  203. package/incremental/handlers/defer20220824.js +97 -0
  204. package/incremental/handlers/defer20220824.js.map +1 -0
  205. package/incremental/handlers/notImplemented.d.ts +9 -0
  206. package/incremental/handlers/notImplemented.js +15 -0
  207. package/incremental/handlers/notImplemented.js.map +1 -0
  208. package/incremental/index.d.ts +4 -0
  209. package/incremental/index.js +3 -0
  210. package/incremental/index.js.map +1 -0
  211. package/incremental/types.d.ts +24 -0
  212. package/incremental/types.js +2 -0
  213. package/incremental/types.js.map +1 -0
  214. package/invariantErrorCodes.js +132 -118
  215. package/legacyEntryPoints/incremental/incremental.cjs +1 -0
  216. package/legacyEntryPoints/incremental/incremental.d.cts +1 -0
  217. package/legacyEntryPoints/incremental/index.d.ts +1 -0
  218. package/legacyEntryPoints/incremental/index.js +1 -0
  219. package/legacyEntryPoints/link/client-awareness/client-awareness.cjs +1 -0
  220. package/legacyEntryPoints/link/client-awareness/client-awareness.d.cts +1 -0
  221. package/legacyEntryPoints/link/client-awareness/index.d.ts +1 -0
  222. package/legacyEntryPoints/link/client-awareness/index.js +1 -0
  223. package/link/batch-http/batchHttpLink.d.ts +4 -0
  224. package/link/batch-http/batchHttpLink.js +11 -12
  225. package/link/batch-http/batchHttpLink.js.map +1 -1
  226. package/link/batch-http/index.d.ts +1 -1
  227. package/link/batch-http/index.js +1 -1
  228. package/link/batch-http/index.js.map +1 -1
  229. package/link/client-awareness/ClientAwarenessLink.d.ts +62 -0
  230. package/link/client-awareness/ClientAwarenessLink.js +41 -0
  231. package/link/client-awareness/ClientAwarenessLink.js.map +1 -0
  232. package/link/client-awareness/index.d.ts +2 -0
  233. package/link/client-awareness/index.js +2 -0
  234. package/link/client-awareness/index.js.map +1 -0
  235. package/link/context/index.d.ts +8 -1
  236. package/link/context/index.js +34 -25
  237. package/link/context/index.js.map +1 -1
  238. package/link/core/types.d.ts +5 -38
  239. package/link/error/index.d.ts +15 -14
  240. package/link/error/index.js +68 -65
  241. package/link/error/index.js.map +1 -1
  242. package/link/http/BaseHttpLink.d.ts +6 -0
  243. package/link/http/BaseHttpLink.js +107 -0
  244. package/link/http/BaseHttpLink.js.map +1 -0
  245. package/link/http/HttpLink.d.ts +20 -4
  246. package/link/http/HttpLink.js +10 -4
  247. package/link/http/HttpLink.js.map +1 -1
  248. package/link/http/checkFetcher.js +1 -1
  249. package/link/http/index.d.ts +2 -2
  250. package/link/http/index.js +2 -2
  251. package/link/http/index.js.map +1 -1
  252. package/link/http/parseAndCheckHttpResponse.js +45 -57
  253. package/link/http/parseAndCheckHttpResponse.js.map +1 -1
  254. package/link/http/selectHttpOptionsAndBody.js +6 -5
  255. package/link/http/selectHttpOptionsAndBody.js.map +1 -1
  256. package/link/index.d.ts +1 -1
  257. package/link/index.js.map +1 -1
  258. package/link/persisted-queries/index.d.ts +19 -19
  259. package/link/persisted-queries/index.js +157 -140
  260. package/link/persisted-queries/index.js.map +1 -1
  261. package/link/remove-typename/index.d.ts +1 -1
  262. package/link/remove-typename/index.js +1 -1
  263. package/link/remove-typename/index.js.map +1 -1
  264. package/link/remove-typename/removeTypenameFromVariables.d.ts +8 -9
  265. package/link/remove-typename/removeTypenameFromVariables.js +32 -22
  266. package/link/remove-typename/removeTypenameFromVariables.js.map +1 -1
  267. package/link/utils/validateOperation.js +1 -1
  268. package/local-state/LocalState.d.ts +3 -4
  269. package/local-state/LocalState.js +10 -18
  270. package/local-state/LocalState.js.map +1 -1
  271. package/masking/maskDefinition.js +2 -2
  272. package/masking/maskFragment.js +2 -2
  273. package/masking/maskOperation.js +1 -1
  274. package/masking/types.d.ts +6 -5
  275. package/masking/utils.js +3 -3
  276. package/package.json +15 -2
  277. package/react/context/ApolloConsumer.js +1 -1
  278. package/react/context/ApolloContext.js +1 -1
  279. package/react/context/ApolloProvider.js +1 -1
  280. package/react/hooks/internal/validateSuspenseHookOptions.js +2 -2
  281. package/react/hooks/useApolloClient.js +15 -2
  282. package/react/hooks/useApolloClient.js.map +1 -1
  283. package/react/hooks/useBackgroundQuery.js +7 -6
  284. package/react/hooks/useBackgroundQuery.js.map +1 -1
  285. package/react/hooks/useFragment.js +12 -11
  286. package/react/hooks/useFragment.js.map +1 -1
  287. package/react/hooks/useLazyQuery.d.ts +2 -7
  288. package/react/hooks/useLazyQuery.js +17 -17
  289. package/react/hooks/useLazyQuery.js.map +1 -1
  290. package/react/hooks/useLoadableQuery.js +229 -69
  291. package/react/hooks/useLoadableQuery.js.map +1 -1
  292. package/react/hooks/useMutation.d.ts +2 -2
  293. package/react/hooks/useMutation.js +191 -81
  294. package/react/hooks/useMutation.js.map +1 -1
  295. package/react/hooks/useQuery.d.ts +3 -8
  296. package/react/hooks/useQuery.js +243 -70
  297. package/react/hooks/useQuery.js.map +1 -1
  298. package/react/hooks/useQueryRefHandlers.js +64 -23
  299. package/react/hooks/useQueryRefHandlers.js.map +1 -1
  300. package/react/hooks/useReadQuery.js +3 -2
  301. package/react/hooks/useReadQuery.js.map +1 -1
  302. package/react/hooks/useSubscription.js +5 -5
  303. package/react/hooks/useSubscription.js.map +1 -1
  304. package/react/hooks/useSuspenseFragment.js +1 -0
  305. package/react/hooks/useSuspenseFragment.js.map +1 -1
  306. package/react/hooks/useSuspenseQuery.js +59 -33
  307. package/react/hooks/useSuspenseQuery.js.map +1 -1
  308. package/react/hooks/useSyncExternalStore.js +1 -1
  309. package/react/internal/cache/QueryReference.d.ts +2 -3
  310. package/react/internal/cache/QueryReference.js +5 -5
  311. package/react/internal/cache/QueryReference.js.map +1 -1
  312. package/react/internal/types.d.ts +2 -7
  313. package/react/ssr/prerenderStatic.js +2 -2
  314. package/testing/core/mocking/mockLink.js +4 -4
  315. package/utilities/caching/sizes.d.ts +6 -0
  316. package/utilities/caching/sizes.js.map +1 -1
  317. package/utilities/graphql/DocumentTransform.js +1 -1
  318. package/utilities/graphql/isFormattedExecutionResult.d.ts +3 -0
  319. package/utilities/graphql/isFormattedExecutionResult.js +6 -0
  320. package/utilities/graphql/isFormattedExecutionResult.js.map +1 -0
  321. package/utilities/index.d.ts +1 -0
  322. package/utilities/index.js +1 -0
  323. package/utilities/index.js.map +1 -1
  324. package/utilities/internal/checkDocument.d.ts +1 -1
  325. package/utilities/internal/checkDocument.js +46 -12
  326. package/utilities/internal/checkDocument.js.map +1 -1
  327. package/utilities/internal/getFragmentDefinition.js +3 -3
  328. package/utilities/internal/getFragmentFromSelection.js +1 -1
  329. package/utilities/internal/getFragmentQueryDocument.js +2 -2
  330. package/utilities/internal/getGraphQLErrorsFromResult.d.ts +4 -2
  331. package/utilities/internal/getGraphQLErrorsFromResult.js +1 -12
  332. package/utilities/internal/getGraphQLErrorsFromResult.js.map +1 -1
  333. package/utilities/internal/getMainDefinition.js +1 -1
  334. package/utilities/internal/getMemoryInternals.d.ts +0 -1
  335. package/utilities/internal/getMemoryInternals.js +1 -0
  336. package/utilities/internal/getMemoryInternals.js.map +1 -1
  337. package/utilities/internal/getQueryDefinition.js +1 -1
  338. package/utilities/internal/graphQLResultHasError.d.ts +2 -2
  339. package/utilities/internal/graphQLResultHasError.js +1 -4
  340. package/utilities/internal/graphQLResultHasError.js.map +1 -1
  341. package/utilities/internal/index.d.ts +0 -4
  342. package/utilities/internal/index.js +0 -4
  343. package/utilities/internal/index.js.map +1 -1
  344. package/utilities/internal/removeDirectivesFromDocument.js +1 -1
  345. package/utilities/internal/shouldInclude.js +4 -4
  346. package/utilities/internal/valueToObjectRepresentation.js +1 -1
  347. package/version.d.ts +1 -0
  348. package/version.js +2 -1
  349. package/version.js.map +1 -1
  350. package/__cjs/link/http/createHttpLink.cjs +0 -151
  351. package/__cjs/link/http/createHttpLink.cjs.map +0 -1
  352. package/__cjs/link/http/createHttpLink.d.cts +0 -4
  353. package/__cjs/utilities/internal/isExecutionPatchIncrementalResult.cjs +0 -12
  354. package/__cjs/utilities/internal/isExecutionPatchIncrementalResult.cjs.map +0 -1
  355. package/__cjs/utilities/internal/isExecutionPatchIncrementalResult.d.cts +0 -8
  356. package/__cjs/utilities/internal/isExecutionPatchIninitialResult.cjs +0 -12
  357. package/__cjs/utilities/internal/isExecutionPatchIninitialResult.cjs.map +0 -1
  358. package/__cjs/utilities/internal/isExecutionPatchIninitialResult.d.cts +0 -8
  359. package/__cjs/utilities/internal/isExecutionPatchResult.cjs +0 -15
  360. package/__cjs/utilities/internal/isExecutionPatchResult.cjs.map +0 -1
  361. package/__cjs/utilities/internal/isExecutionPatchResult.d.cts +0 -8
  362. package/__cjs/utilities/internal/mergeIncrementalData.cjs +0 -30
  363. package/__cjs/utilities/internal/mergeIncrementalData.cjs.map +0 -1
  364. package/__cjs/utilities/internal/mergeIncrementalData.d.cts +0 -8
  365. package/link/http/createHttpLink.d.ts +0 -4
  366. package/link/http/createHttpLink.js +0 -143
  367. package/link/http/createHttpLink.js.map +0 -1
  368. package/utilities/internal/isExecutionPatchIncrementalResult.d.ts +0 -8
  369. package/utilities/internal/isExecutionPatchIncrementalResult.js +0 -9
  370. package/utilities/internal/isExecutionPatchIncrementalResult.js.map +0 -1
  371. package/utilities/internal/isExecutionPatchIninitialResult.d.ts +0 -8
  372. package/utilities/internal/isExecutionPatchIninitialResult.js +0 -9
  373. package/utilities/internal/isExecutionPatchIninitialResult.js.map +0 -1
  374. package/utilities/internal/isExecutionPatchResult.d.ts +0 -8
  375. package/utilities/internal/isExecutionPatchResult.js +0 -12
  376. package/utilities/internal/isExecutionPatchResult.js.map +0 -1
  377. package/utilities/internal/mergeIncrementalData.d.ts +0 -8
  378. package/utilities/internal/mergeIncrementalData.js +0 -27
  379. package/utilities/internal/mergeIncrementalData.js.map +0 -1
@@ -1,6 +1,6 @@
1
1
  import { Trie } from "@wry/trie";
2
2
  import { BREAK, Kind, OperationTypeNode, visit } from "graphql";
3
- import { Observable } from "rxjs";
3
+ import { Observable, throwError } from "rxjs";
4
4
  import { catchError, concat, EMPTY, filter, finalize, from, lastValueFrom, map, materialize, mergeMap, of, share, shareReplay, Subject, tap, } from "rxjs";
5
5
  import { canonicalStringify } from "@apollo/client/cache";
6
6
  import { CombinedGraphQLErrors, graphQLResultHasProtocolErrors, registerLinkError, toErrorLike, } from "@apollo/client/errors";
@@ -9,7 +9,7 @@ import { execute } from "@apollo/client/link";
9
9
  import { maskFragment, maskOperation } from "@apollo/client/masking";
10
10
  import { cacheSizes, DocumentTransform, print } from "@apollo/client/utilities";
11
11
  import { __DEV__ } from "@apollo/client/utilities/environment";
12
- import { AutoCleanedWeakCache, checkDocument, filterMap, getDefaultValues, getGraphQLErrorsFromResult, getOperationDefinition, getOperationName, graphQLResultHasError, hasDirectives, hasForcedResolvers, isDocumentNode, isExecutionPatchResult, isNonNullObject, makeUniqueId, removeDirectivesFromDocument, toQueryResult, } from "@apollo/client/utilities/internal";
12
+ import { AutoCleanedWeakCache, checkDocument, filterMap, getDefaultValues, getOperationDefinition, getOperationName, graphQLResultHasError, hasDirectives, hasForcedResolvers, isDocumentNode, isNonNullObject, makeUniqueId, removeDirectivesFromDocument, toQueryResult, } from "@apollo/client/utilities/internal";
13
13
  import { invariant, newInvariantError, } from "@apollo/client/utilities/invariant";
14
14
  import { isNetworkRequestInFlight, NetworkStatus } from "./networkStatus.js";
15
15
  import { logMissingFieldErrors, ObservableQuery } from "./ObservableQuery.js";
@@ -17,14 +17,18 @@ import { QueryInfo } from "./QueryInfo.js";
17
17
  export class QueryManager {
18
18
  defaultOptions;
19
19
  client;
20
+ /**
21
+ * The options that were passed to the ApolloClient constructor.
22
+ */
23
+ clientOptions;
20
24
  assumeImmutableResults;
21
25
  documentTransform;
22
26
  ssrMode;
23
27
  defaultContext;
24
28
  dataMasking;
29
+ incrementalHandler;
25
30
  localState;
26
31
  queryDeduplication;
27
- clientAwareness = {};
28
32
  /**
29
33
  * Whether to prioritize cache values over network results when
30
34
  * `fetchObservableWithInfo` is called.
@@ -54,11 +58,12 @@ export class QueryManager {
54
58
  this.client = options.client;
55
59
  this.defaultOptions = options.defaultOptions;
56
60
  this.queryDeduplication = options.queryDeduplication;
57
- this.clientAwareness = options.clientAwareness;
61
+ this.clientOptions = options.clientOptions;
58
62
  this.ssrMode = options.ssrMode;
59
63
  this.assumeImmutableResults = options.assumeImmutableResults;
60
64
  this.dataMasking = options.dataMasking;
61
65
  this.localState = options.localState;
66
+ this.incrementalHandler = options.incrementalHandler;
62
67
  const documentTransform = options.documentTransform;
63
68
  this.documentTransform =
64
69
  documentTransform ?
@@ -87,23 +92,20 @@ export class QueryManager {
87
92
  */
88
93
  stop() {
89
94
  this.obsQueries.forEach((oq) => oq.stop());
90
- this.cancelPendingFetches(newInvariantError(81));
95
+ this.cancelPendingFetches(newInvariantError(85));
91
96
  }
92
97
  cancelPendingFetches(error) {
93
98
  this.fetchCancelFns.forEach((cancel) => cancel(error));
94
99
  this.fetchCancelFns.clear();
95
100
  }
96
- async mutate({ mutation, variables, optimisticResponse, updateQueries, refetchQueries = [], awaitRefetchQueries = false, update: updateWithProxyFn, onQueryUpdated, fetchPolicy = this.defaultOptions.mutate?.fetchPolicy || "network-only", errorPolicy = this.defaultOptions.mutate?.errorPolicy || "none", keepRootFields, context, }) {
97
- invariant(mutation, 82);
98
- checkDocument(mutation, OperationTypeNode.MUTATION);
99
- invariant(fetchPolicy === "network-only" || fetchPolicy === "no-cache", 83);
101
+ async mutate({ mutation, variables, optimisticResponse, updateQueries, refetchQueries = [], awaitRefetchQueries = false, update: updateWithProxyFn, onQueryUpdated, fetchPolicy, errorPolicy, keepRootFields, context, }) {
100
102
  const queryInfo = new QueryInfo(this);
101
103
  mutation = this.cache.transformForLink(this.transform(mutation));
102
104
  const { hasClientExports } = this.getDocumentInfo(mutation);
103
105
  variables = this.getVariables(mutation, variables);
104
106
  if (hasClientExports) {
105
107
  if (__DEV__) {
106
- invariant(this.localState, 84, getOperationName(mutation, "(anonymous)"));
108
+ invariant(this.localState, 86, getOperationName(mutation, "(anonymous)"));
107
109
  }
108
110
  variables = await this.localState.getExportedVariables({
109
111
  client: this.client,
@@ -140,21 +142,7 @@ export class QueryManager {
140
142
  optimisticResponse: isOptimistic ? optimisticResponse : void 0,
141
143
  }, variables, {}, false)
142
144
  .observable.pipe(validateDidEmitValue(), mergeMap((result) => {
143
- const hasErrors = graphQLResultHasError(result);
144
- if (hasErrors && errorPolicy === "none") {
145
- throw new CombinedGraphQLErrors(result);
146
- }
147
- if (mutationStoreValue) {
148
- mutationStoreValue.loading = false;
149
- mutationStoreValue.error = null;
150
- }
151
145
  const storeResult = { ...result };
152
- if (typeof refetchQueries === "function") {
153
- refetchQueries = refetchQueries(storeResult);
154
- }
155
- if (errorPolicy === "ignore" && hasErrors) {
156
- delete storeResult.errors;
157
- }
158
146
  return from(queryInfo.markMutationResult(storeResult, {
159
147
  document: mutation,
160
148
  variables,
@@ -171,6 +159,17 @@ export class QueryManager {
171
159
  onQueryUpdated,
172
160
  keepRootFields,
173
161
  }));
162
+ }))
163
+ .pipe(map((storeResult) => {
164
+ const hasErrors = graphQLResultHasError(storeResult);
165
+ if (hasErrors && errorPolicy === "none") {
166
+ throw new CombinedGraphQLErrors(storeResult);
167
+ }
168
+ if (mutationStoreValue) {
169
+ mutationStoreValue.loading = false;
170
+ mutationStoreValue.error = null;
171
+ }
172
+ return storeResult;
174
173
  }))
175
174
  .subscribe({
176
175
  next: (storeResult) => {
@@ -180,7 +179,7 @@ export class QueryManager {
180
179
  // we resolve with a SingleExecutionResult or after the final
181
180
  // ExecutionPatchResult has arrived and we have assembled the
182
181
  // multipart response into a single result.
183
- if (!("hasNext" in storeResult) || storeResult.hasNext === false) {
182
+ if (!queryInfo.hasNext) {
184
183
  const result = {
185
184
  data: this.maskOperation({
186
185
  document: mutation,
@@ -192,7 +191,7 @@ export class QueryManager {
192
191
  if (graphQLResultHasError(storeResult)) {
193
192
  result.error = new CombinedGraphQLErrors(storeResult);
194
193
  }
195
- if (storeResult.extensions) {
194
+ if (Object.keys(storeResult.extensions || {}).length) {
196
195
  result.extensions = storeResult.extensions;
197
196
  }
198
197
  resolve(result);
@@ -219,7 +218,10 @@ export class QueryManager {
219
218
  });
220
219
  }
221
220
  fetchQuery(options, networkStatus) {
222
- return lastValueFrom(this.fetchObservableWithInfo(options, {
221
+ checkDocument(options.query, OperationTypeNode.QUERY);
222
+ // do the rest asynchronously to keep the same rejection timing as
223
+ // checks further in `.mutate`
224
+ return (async () => lastValueFrom(this.fetchObservableWithInfo(options, {
223
225
  networkStatus,
224
226
  }).observable.pipe(filterMap((value) => {
225
227
  switch (value.kind) {
@@ -234,7 +236,7 @@ export class QueryManager {
234
236
  // This default is needed when a `standby` fetch policy is used to avoid
235
237
  // an EmptyError from rejecting this promise.
236
238
  defaultValue: { data: undefined },
237
- });
239
+ }))();
238
240
  }
239
241
  transform(document) {
240
242
  return this.documentTransform.transformDocument(document);
@@ -254,6 +256,7 @@ export class QueryManager {
254
256
  hasClientExports: hasDirectives(["client", "export"], document, true),
255
257
  hasForcedResolvers: hasForcedResolvers(document),
256
258
  hasNonreactiveDirective: hasDirectives(["nonreactive"], document),
259
+ hasIncrementalDirective: hasDirectives(["defer"], document),
257
260
  nonReactiveQuery: addNonReactiveToNamedFragments(document),
258
261
  clientQuery: hasDirectives(["client"], document) ? document : null,
259
262
  serverQuery: removeDirectivesFromDocument([
@@ -279,7 +282,11 @@ export class QueryManager {
279
282
  };
280
283
  transformCache.set(document, cacheEntry);
281
284
  }
282
- return transformCache.get(document);
285
+ const entry = transformCache.get(document);
286
+ if (entry.violation) {
287
+ throw entry.violation;
288
+ }
289
+ return entry;
283
290
  }
284
291
  getVariables(document, variables) {
285
292
  const defaultVars = this.getDocumentInfo(document).defaultVars;
@@ -309,7 +316,7 @@ export class QueryManager {
309
316
  });
310
317
  return observable;
311
318
  }
312
- async query(options) {
319
+ query(options) {
313
320
  const query = this.transform(options.query);
314
321
  return this.fetchQuery({
315
322
  ...options,
@@ -335,7 +342,7 @@ export class QueryManager {
335
342
  // depend on values that previously existed in the data portion of the
336
343
  // store. So, we cancel the promises and observers that we have issued
337
344
  // so far and not yet resolved (in the case of queries).
338
- this.cancelPendingFetches(newInvariantError(85));
345
+ this.cancelPendingFetches(newInvariantError(87));
339
346
  this.obsQueries.forEach((observableQuery) => {
340
347
  // Set loading to true so listeners don't trigger unless they want
341
348
  // results with partial data.
@@ -405,10 +412,10 @@ export class QueryManager {
405
412
  if (!included) {
406
413
  const queryName = queryNames.get(nameOrQueryString);
407
414
  if (queryName) {
408
- __DEV__ && invariant.warn(86, queryName);
415
+ __DEV__ && invariant.warn(88, queryName);
409
416
  }
410
417
  else {
411
- __DEV__ && invariant.warn(87);
418
+ __DEV__ && invariant.warn(89);
412
419
  }
413
420
  }
414
421
  });
@@ -419,8 +426,8 @@ export class QueryManager {
419
426
  const observableQueryPromises = [];
420
427
  this.getObservableQueries(includeStandby ? "all" : "active").forEach((observableQuery) => {
421
428
  const { fetchPolicy } = observableQuery.options;
422
- if (includeStandby ||
423
- (fetchPolicy !== "standby" && fetchPolicy !== "cache-only")) {
429
+ if ((includeStandby || fetchPolicy !== "standby") &&
430
+ fetchPolicy !== "cache-only") {
424
431
  observableQueryPromises.push(observableQuery.refetch());
425
432
  }
426
433
  });
@@ -437,7 +444,7 @@ export class QueryManager {
437
444
  if (__DEV__) {
438
445
  invariant(
439
446
  !this.getDocumentInfo(query).hasClientExports || this.localState,
440
- 88,
447
+ 90,
441
448
  getOperationName(query, "(anonymous)")
442
449
  );
443
450
  }
@@ -505,82 +512,92 @@ export class QueryManager {
505
512
  deduplication = context?.queryDeduplication ??
506
513
  this.queryDeduplication) {
507
514
  let entry = {};
508
- const { serverQuery, clientQuery, operationType } = this.getDocumentInfo(query);
515
+ const { serverQuery, clientQuery, operationType, hasIncrementalDirective } = this.getDocumentInfo(query);
509
516
  const operationName = getOperationName(query);
510
517
  const executeContext = {
511
518
  client: this.client,
512
519
  };
513
520
  if (serverQuery) {
514
521
  const { inFlightLinkObservables, link } = this;
515
- const operation = {
516
- query: serverQuery,
517
- variables,
518
- operationName,
519
- context: {
520
- ...this.defaultContext,
521
- ...context,
522
- queryDeduplication: deduplication,
523
- clientAwareness: this.clientAwareness,
524
- },
525
- extensions,
526
- };
527
- context = operation.context;
528
- function withRestart(source) {
529
- return new Observable((observer) => {
530
- function subscribe() {
531
- return source.subscribe({
532
- next: observer.next.bind(observer),
533
- complete: observer.complete.bind(observer),
534
- error: observer.error.bind(observer),
535
- });
536
- }
537
- let subscription = subscribe();
538
- entry.restart ||= () => {
539
- subscription.unsubscribe();
540
- subscription = subscribe();
541
- };
542
- return () => {
543
- subscription.unsubscribe();
544
- entry.restart = undefined;
545
- };
522
+ try {
523
+ const operation = this.incrementalHandler.prepareRequest({
524
+ query: serverQuery,
525
+ variables,
526
+ operationName,
527
+ context: {
528
+ ...this.defaultContext,
529
+ ...context,
530
+ queryDeduplication: deduplication,
531
+ },
532
+ extensions,
546
533
  });
547
- }
548
- if (deduplication) {
549
- const printedServerQuery = print(serverQuery);
550
- const varJson = canonicalStringify(variables);
551
- entry = inFlightLinkObservables.lookup(printedServerQuery, varJson);
552
- if (!entry.observable) {
553
- entry.observable = execute(link, operation, executeContext).pipe(withRestart, finalize(() => {
554
- if (inFlightLinkObservables.peek(printedServerQuery, varJson) ===
555
- entry) {
556
- inFlightLinkObservables.remove(printedServerQuery, varJson);
534
+ context = operation.context;
535
+ function withRestart(source) {
536
+ return new Observable((observer) => {
537
+ function subscribe() {
538
+ return source.subscribe({
539
+ next: observer.next.bind(observer),
540
+ complete: observer.complete.bind(observer),
541
+ error: observer.error.bind(observer),
542
+ });
557
543
  }
558
- }),
559
- // We don't want to replay the last emitted value for
560
- // subscriptions and instead opt to wait to receive updates until
561
- // the subscription emits new values.
562
- operationType === OperationTypeNode.SUBSCRIPTION ?
563
- share()
564
- : shareReplay({ refCount: true }));
544
+ let subscription = subscribe();
545
+ entry.restart ||= () => {
546
+ subscription.unsubscribe();
547
+ subscription = subscribe();
548
+ };
549
+ return () => {
550
+ subscription.unsubscribe();
551
+ entry.restart = undefined;
552
+ };
553
+ });
554
+ }
555
+ if (deduplication) {
556
+ const printedServerQuery = print(serverQuery);
557
+ const varJson = canonicalStringify(variables);
558
+ entry = inFlightLinkObservables.lookup(printedServerQuery, varJson);
559
+ if (!entry.observable) {
560
+ entry.observable = execute(link, operation, executeContext).pipe(withRestart, finalize(() => {
561
+ if (inFlightLinkObservables.peek(printedServerQuery, varJson) ===
562
+ entry) {
563
+ inFlightLinkObservables.remove(printedServerQuery, varJson);
564
+ }
565
+ }),
566
+ // We don't want to replay the last emitted value for
567
+ // subscriptions and instead opt to wait to receive updates until
568
+ // the subscription emits new values.
569
+ operationType === OperationTypeNode.SUBSCRIPTION ?
570
+ share()
571
+ : shareReplay({ refCount: true }));
572
+ }
573
+ }
574
+ else {
575
+ entry.observable = execute(link, operation, executeContext).pipe(withRestart);
565
576
  }
566
577
  }
567
- else {
568
- entry.observable = execute(link, operation, executeContext).pipe(withRestart);
578
+ catch (error) {
579
+ entry.observable = throwError(() => error);
569
580
  }
570
581
  }
571
582
  else {
572
583
  entry.observable = of({ data: {} });
573
584
  }
574
585
  if (clientQuery) {
586
+ const { operation } = getOperationDefinition(query);
575
587
  if (__DEV__) {
576
- const { operation } = getOperationDefinition(query);
577
588
  invariant(
578
589
  this.localState,
579
- 89,
590
+ 91,
580
591
  operation[0].toUpperCase() + operation.slice(1),
581
592
  operationName ?? "(anonymous)"
582
593
  );
583
594
  }
595
+ invariant(
596
+ !hasIncrementalDirective,
597
+ 92,
598
+ operation[0].toUpperCase() + operation.slice(1),
599
+ operationName ?? "(anonymous)"
600
+ );
584
601
  entry.observable = entry.observable.pipe(mergeMap((result) => {
585
602
  return from(this.localState.execute({
586
603
  client: this.client,
@@ -607,30 +624,24 @@ export class QueryManager {
607
624
  // missing fragment definitions (for example) before sending this document
608
625
  // through the link chain.
609
626
  const linkDocument = this.cache.transformForLink(options.query);
610
- return this.getObservableFromLink(linkDocument, options.context, options.variables).observable.pipe(map((result) => {
611
- const graphQLErrors = getGraphQLErrorsFromResult(result);
612
- const hasErrors = graphQLErrors.length > 0;
613
- // If we interrupted this request by calling getResultsFromLink again
614
- // with the same QueryInfo object, we ignore the old results.
615
- if (requestId >= queryInfo.lastRequestId) {
616
- if (hasErrors && errorPolicy === "none") {
617
- queryInfo.resetLastWrite();
618
- observableQuery?.["resetNotifications"]();
619
- // Throwing here effectively calls observer.error.
620
- throw new CombinedGraphQLErrors(result);
621
- }
622
- // Use linkDocument rather than queryInfo.document so the
623
- // operation/fragments used to write the result are the same as the
624
- // ones used to obtain it from the link.
625
- queryInfo.markQueryResult(result, {
626
- ...options,
627
- document: linkDocument,
628
- cacheWriteBehavior,
629
- });
627
+ return this.getObservableFromLink(linkDocument, options.context, options.variables).observable.pipe(map((incoming) => {
628
+ // Use linkDocument rather than queryInfo.document so the
629
+ // operation/fragments used to write the result are the same as the
630
+ // ones used to obtain it from the link.
631
+ const result = queryInfo.markQueryResult(incoming, {
632
+ ...options,
633
+ document: linkDocument,
634
+ cacheWriteBehavior,
635
+ });
636
+ const hasErrors = graphQLResultHasError(result);
637
+ if (hasErrors && errorPolicy === "none") {
638
+ queryInfo.resetLastWrite();
639
+ observableQuery?.["resetNotifications"]();
640
+ throw new CombinedGraphQLErrors(result);
630
641
  }
631
642
  const aqr = {
632
643
  data: result.data,
633
- ...(isExecutionPatchResult(result) && result.hasNext ?
644
+ ...(queryInfo.hasNext ?
634
645
  {
635
646
  loading: true,
636
647
  networkStatus: NetworkStatus.streaming,
@@ -648,15 +659,16 @@ export class QueryManager {
648
659
  // want to ensure we properly set `data` if we're reporting on an old
649
660
  // result which will not be caught by the conditional above that ends up
650
661
  // throwing the markError result.
651
- if (hasErrors && errorPolicy === "none") {
652
- aqr.data = void 0;
653
- aqr.dataState = "empty";
654
- }
655
- if (hasErrors && errorPolicy !== "ignore") {
656
- aqr.error = new CombinedGraphQLErrors(result);
657
- aqr.networkStatus = NetworkStatus.error;
658
- if (aqr.data) {
659
- aqr.dataState = "complete";
662
+ if (hasErrors) {
663
+ if (errorPolicy === "none") {
664
+ aqr.data = void 0;
665
+ aqr.dataState = "empty";
666
+ }
667
+ if (errorPolicy !== "ignore") {
668
+ aqr.error = new CombinedGraphQLErrors(result);
669
+ if (aqr.dataState !== "streaming") {
670
+ aqr.networkStatus = NetworkStatus.error;
671
+ }
660
672
  }
661
673
  }
662
674
  return aqr;
@@ -749,7 +761,7 @@ export class QueryManager {
749
761
  // we deprecated and removed LocalState.
750
762
  if (this.getDocumentInfo(normalized.query).hasClientExports) {
751
763
  if (__DEV__) {
752
- invariant(this.localState, 90, getOperationName(normalized.query, "(anonymous)"));
764
+ invariant(this.localState, 93, getOperationName(normalized.query, "(anonymous)"));
753
765
  }
754
766
  observable = from(this.localState.getExportedVariables({
755
767
  client: this.client,
@@ -784,6 +796,9 @@ export class QueryManager {
784
796
  const includedQueriesByOq = new Map();
785
797
  if (include) {
786
798
  this.getObservableQueries(include).forEach((oq) => {
799
+ if (oq.options.fetchPolicy === "cache-only") {
800
+ return;
801
+ }
787
802
  const current = oq.getCurrentResult();
788
803
  includedQueriesByOq.set(oq, {
789
804
  oq,
@@ -863,7 +878,8 @@ export class QueryManager {
863
878
  // onQueryUpdated returns false.
864
879
  return result;
865
880
  }
866
- if (onQueryUpdated !== null) {
881
+ if (onQueryUpdated !== null &&
882
+ oq.options.fetchPolicy !== "cache-only") {
867
883
  // If we don't have an onQueryUpdated function, and onQueryUpdated
868
884
  // was not disabled by passing null, make sure this query is
869
885
  // "included" like any other options.include-specified query.
@@ -918,7 +934,7 @@ export class QueryManager {
918
934
  !isFullyUnmaskedOperation(document) &&
919
935
  !this.noCacheWarningsByCause.has(cause)) {
920
936
  this.noCacheWarningsByCause.add(cause);
921
- __DEV__ && invariant.warn(91, getOperationName(document, `Unnamed ${operationType ?? "operation"}`));
937
+ __DEV__ && invariant.warn(94, getOperationName(document, `Unnamed ${operationType ?? "operation"}`));
922
938
  }
923
939
  }
924
940
  return (this.dataMasking ?
@@ -976,7 +992,7 @@ export class QueryManager {
976
992
  (diff.complete || returnPartialData) &&
977
993
  this.getDocumentInfo(query).hasForcedResolvers) {
978
994
  if (__DEV__) {
979
- invariant(this.localState, 92, getOperationName(query, "(anonymous)"));
995
+ invariant(this.localState, 95, getOperationName(query, "(anonymous)"));
980
996
  }
981
997
  onCacheHit();
982
998
  return from(this.localState.execute({
@@ -1067,7 +1083,7 @@ function validateDidEmitValue() {
1067
1083
  didEmitValue = true;
1068
1084
  },
1069
1085
  complete() {
1070
- invariant(didEmitValue, 93);
1086
+ invariant(didEmitValue, 96);
1071
1087
  },
1072
1088
  });
1073
1089
  }
@@ -1086,7 +1102,6 @@ function isFullyUnmaskedOperation(document) {
1086
1102
  return isUnmasked;
1087
1103
  }
1088
1104
  function addNonReactiveToNamedFragments(document) {
1089
- checkDocument(document);
1090
1105
  return visit(document, {
1091
1106
  FragmentSpread: (node) => {
1092
1107
  // Do not add `@nonreactive` if the fragment is marked with `@unmask`