@apollo/client 4.3.8 → 4.4.0-alpha.1

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 (324) hide show
  1. package/CHANGELOG.md +76 -3
  2. package/__cjs/cache/core/cache.cjs +50 -15
  3. package/__cjs/cache/core/cache.cjs.map +1 -1
  4. package/__cjs/cache/core/cache.d.cts +22 -4
  5. package/__cjs/cache/index.cjs.map +1 -1
  6. package/__cjs/cache/index.d.cts +1 -1
  7. package/__cjs/cache/inmemory/entityStore.cjs +4 -4
  8. package/__cjs/cache/inmemory/helpers.cjs +12 -0
  9. package/__cjs/cache/inmemory/helpers.cjs.map +1 -1
  10. package/__cjs/cache/inmemory/helpers.d.cts +10 -5
  11. package/__cjs/cache/inmemory/inMemoryCache.cjs +13 -2
  12. package/__cjs/cache/inmemory/inMemoryCache.cjs.map +1 -1
  13. package/__cjs/cache/inmemory/inMemoryCache.d.cts +19 -4
  14. package/__cjs/cache/inmemory/key-extractor.cjs +1 -1
  15. package/__cjs/cache/inmemory/policies.cjs +9 -9
  16. package/__cjs/cache/inmemory/policies.cjs.map +1 -1
  17. package/__cjs/cache/inmemory/policies.d.cts +1 -1
  18. package/__cjs/cache/inmemory/readFromStore.cjs +112 -19
  19. package/__cjs/cache/inmemory/readFromStore.cjs.map +1 -1
  20. package/__cjs/cache/inmemory/types.d.cts +12 -1
  21. package/__cjs/cache/inmemory/writeToStore.cjs +53 -23
  22. package/__cjs/cache/inmemory/writeToStore.cjs.map +1 -1
  23. package/__cjs/cache/inmemory/writeToStore.d.cts +8 -4
  24. package/__cjs/core/ApolloClient.cjs +19 -15
  25. package/__cjs/core/ApolloClient.cjs.map +1 -1
  26. package/__cjs/core/ApolloClient.d.cts +1 -0
  27. package/__cjs/core/ObservableQuery.cjs +8 -8
  28. package/__cjs/core/QueryInfo.cjs +1 -1
  29. package/__cjs/core/QueryManager.cjs +12 -12
  30. package/__cjs/core/RefetchEventManager.cjs +3 -3
  31. package/__cjs/errors/CombinedGraphQLErrors.cjs +3 -7
  32. package/__cjs/errors/CombinedGraphQLErrors.cjs.map +1 -1
  33. package/__cjs/errors/CombinedGraphQLErrors.d.cts +2 -2
  34. package/__cjs/errors/CombinedProtocolErrors.cjs +3 -8
  35. package/__cjs/errors/CombinedProtocolErrors.cjs.map +1 -1
  36. package/__cjs/errors/CombinedProtocolErrors.d.cts +2 -2
  37. package/__cjs/incremental/handlers/graphql17Alpha9.cjs +2 -2
  38. package/__cjs/incremental/handlers/notImplemented.cjs +1 -1
  39. package/__cjs/invariantErrorCodes.cjs +125 -120
  40. package/__cjs/link/batch-http/BaseBatchHttpLink.cjs +9 -18
  41. package/__cjs/link/batch-http/BaseBatchHttpLink.cjs.map +1 -1
  42. package/__cjs/link/batch-http/BaseBatchHttpLink.d.cts +0 -7
  43. package/__cjs/link/core/ApolloLink.cjs +3 -3
  44. package/__cjs/link/http/checkFetcher.cjs +1 -1
  45. package/__cjs/link/http/parseAndCheckHttpResponse.cjs +1 -1
  46. package/__cjs/link/persisted-queries/index.cjs +2 -2
  47. package/__cjs/link/ws/index.cjs +1 -1
  48. package/__cjs/local-state/LocalState.cjs +28 -16
  49. package/__cjs/local-state/LocalState.cjs.map +1 -1
  50. package/__cjs/masking/maskDefinition.cjs +20 -2
  51. package/__cjs/masking/maskDefinition.cjs.map +1 -1
  52. package/__cjs/masking/maskFragment.cjs +2 -2
  53. package/__cjs/masking/maskOperation.cjs +1 -1
  54. package/__cjs/masking/utils.cjs +3 -3
  55. package/__cjs/react/context/ApolloContext.cjs +1 -1
  56. package/__cjs/react/context/ApolloProvider.cjs +1 -1
  57. package/__cjs/react/hooks/internal/validateSuspenseHookOptions.cjs +2 -2
  58. package/__cjs/react/hooks/useApolloClient.cjs +1 -1
  59. package/__cjs/react/hooks/useFragment.cjs +8 -2
  60. package/__cjs/react/hooks/useFragment.cjs.map +1 -1
  61. package/__cjs/react/hooks/useLazyQuery.cjs +2 -2
  62. package/__cjs/react/hooks/useLoadableQuery.cjs +2 -2
  63. package/__cjs/react/hooks/useSubscription.cjs +1 -1
  64. package/__cjs/react/hooks/useSuspenseFragment.cjs +10 -4
  65. package/__cjs/react/hooks/useSuspenseFragment.cjs.map +1 -1
  66. package/__cjs/react/hooks/useSyncExternalStore.cjs +1 -1
  67. package/__cjs/react/internal/cache/FragmentReference.cjs +2 -2
  68. package/__cjs/react/internal/cache/FragmentReference.cjs.map +1 -1
  69. package/__cjs/react/internal/cache/FragmentReference.d.cts +4 -5
  70. package/__cjs/react/internal/cache/QueryReference.cjs +1 -1
  71. package/__cjs/react/internal/cache/SuspenseCache.cjs +3 -3
  72. package/__cjs/react/internal/cache/SuspenseCache.cjs.map +1 -1
  73. package/__cjs/react/internal/cache/SuspenseCache.d.cts +4 -5
  74. package/__cjs/react/internal/cache/types.d.cts +0 -5
  75. package/__cjs/react/ssr/prerenderStatic.cjs +2 -2
  76. package/__cjs/testing/core/mocking/mockLink.cjs +4 -4
  77. package/__cjs/utilities/graphql/DocumentTransform.cjs +1 -1
  78. package/__cjs/utilities/internal/DeepMerger.cjs +6 -2
  79. package/__cjs/utilities/internal/DeepMerger.cjs.map +1 -1
  80. package/__cjs/utilities/internal/DeepMerger.d.cts +13 -3
  81. package/__cjs/utilities/internal/argumentsObjectFromField.cjs.map +1 -1
  82. package/__cjs/utilities/internal/argumentsObjectFromField.d.cts +2 -2
  83. package/__cjs/utilities/internal/constants.cjs +33 -1
  84. package/__cjs/utilities/internal/constants.cjs.map +1 -1
  85. package/__cjs/utilities/internal/constants.d.cts +32 -0
  86. package/__cjs/utilities/internal/createArgumentNode.cjs +14 -0
  87. package/__cjs/utilities/internal/createArgumentNode.cjs.map +1 -0
  88. package/__cjs/utilities/internal/createArgumentNode.d.cts +3 -0
  89. package/__cjs/utilities/internal/createDirectiveNode.cjs +14 -0
  90. package/__cjs/utilities/internal/createDirectiveNode.cjs.map +1 -0
  91. package/__cjs/utilities/internal/createDirectiveNode.d.cts +3 -0
  92. package/__cjs/utilities/internal/createFragmentArgumentNode.cjs +13 -0
  93. package/__cjs/utilities/internal/createFragmentArgumentNode.cjs.map +1 -0
  94. package/__cjs/utilities/internal/createFragmentArgumentNode.d.cts +3 -0
  95. package/__cjs/utilities/internal/createFragmentSpreadNode.cjs +20 -0
  96. package/__cjs/utilities/internal/createFragmentSpreadNode.cjs.map +1 -0
  97. package/__cjs/utilities/internal/createFragmentSpreadNode.d.cts +6 -0
  98. package/__cjs/utilities/internal/createNameNode.cjs +8 -0
  99. package/__cjs/utilities/internal/createNameNode.cjs.map +1 -0
  100. package/__cjs/utilities/internal/createNameNode.d.cts +3 -0
  101. package/__cjs/utilities/internal/createValueNode.cjs +27 -0
  102. package/__cjs/utilities/internal/createValueNode.cjs.map +1 -0
  103. package/__cjs/utilities/internal/createValueNode.d.cts +12 -0
  104. package/__cjs/utilities/internal/createVariableNode.cjs +9 -0
  105. package/__cjs/utilities/internal/createVariableNode.cjs.map +1 -0
  106. package/__cjs/utilities/internal/createVariableNode.d.cts +3 -0
  107. package/__cjs/utilities/internal/equalByQuery.cjs +16 -3
  108. package/__cjs/utilities/internal/equalByQuery.cjs.map +1 -1
  109. package/__cjs/utilities/internal/equalByQuery.d.cts +2 -3
  110. package/__cjs/utilities/internal/getDefaultValues.cjs.map +1 -1
  111. package/__cjs/utilities/internal/getDefaultValues.d.cts +2 -2
  112. package/__cjs/utilities/internal/getFragmentDefinition.cjs +3 -3
  113. package/__cjs/utilities/internal/getFragmentDefinition.cjs.map +1 -1
  114. package/__cjs/utilities/internal/getFragmentFromSelection.cjs +1 -1
  115. package/__cjs/utilities/internal/getFragmentQueryDocument.cjs +20 -9
  116. package/__cjs/utilities/internal/getFragmentQueryDocument.cjs.map +1 -1
  117. package/__cjs/utilities/internal/getFragmentScope.cjs +23 -0
  118. package/__cjs/utilities/internal/getFragmentScope.cjs.map +1 -0
  119. package/__cjs/utilities/internal/getFragmentScope.d.cts +13 -0
  120. package/__cjs/utilities/internal/getFragmentVariables.cjs +33 -0
  121. package/__cjs/utilities/internal/getFragmentVariables.cjs.map +1 -0
  122. package/__cjs/utilities/internal/getFragmentVariables.d.cts +12 -0
  123. package/__cjs/utilities/internal/getMainDefinition.cjs +1 -1
  124. package/__cjs/utilities/internal/getQueryDefinition.cjs +1 -1
  125. package/__cjs/utilities/internal/index.cjs +11 -2
  126. package/__cjs/utilities/internal/index.cjs.map +1 -1
  127. package/__cjs/utilities/internal/index.d.cts +6 -1
  128. package/__cjs/utilities/internal/isNonEmptyObject.cjs +13 -0
  129. package/__cjs/utilities/internal/isNonEmptyObject.cjs.map +1 -0
  130. package/__cjs/utilities/internal/isNonEmptyObject.d.cts +7 -0
  131. package/__cjs/utilities/internal/isNonNullObject.cjs.map +1 -1
  132. package/__cjs/utilities/internal/isNonNullObject.d.cts +1 -1
  133. package/__cjs/utilities/internal/mapObservableFragment.cjs +14 -9
  134. package/__cjs/utilities/internal/mapObservableFragment.cjs.map +1 -1
  135. package/__cjs/utilities/internal/mapObservableFragment.d.cts +5 -1
  136. package/__cjs/utilities/internal/mergeDeepArray.cjs +2 -2
  137. package/__cjs/utilities/internal/mergeDeepArray.cjs.map +1 -1
  138. package/__cjs/utilities/internal/mergeDeepArray.d.cts +2 -1
  139. package/__cjs/utilities/internal/removeDirectivesFromDocument.cjs +121 -62
  140. package/__cjs/utilities/internal/removeDirectivesFromDocument.cjs.map +1 -1
  141. package/__cjs/utilities/internal/removeFragmentSpreads.cjs +55 -2
  142. package/__cjs/utilities/internal/removeFragmentSpreads.cjs.map +1 -1
  143. package/__cjs/utilities/internal/removeFragmentSpreads.d.cts +17 -1
  144. package/__cjs/utilities/internal/shouldInclude.cjs +4 -4
  145. package/__cjs/utilities/internal/types/FragmentInfo.cjs +3 -0
  146. package/__cjs/utilities/internal/types/FragmentInfo.cjs.map +1 -0
  147. package/__cjs/utilities/internal/types/FragmentInfo.d.cts +14 -0
  148. package/__cjs/utilities/internal/types/Mutable.cjs +3 -0
  149. package/__cjs/utilities/internal/types/Mutable.cjs.map +1 -0
  150. package/__cjs/utilities/internal/types/Mutable.d.cts +4 -0
  151. package/__cjs/utilities/internal/types/ObjectWithFragmentInfo.cjs +3 -0
  152. package/__cjs/utilities/internal/types/ObjectWithFragmentInfo.cjs.map +1 -0
  153. package/__cjs/utilities/internal/types/ObjectWithFragmentInfo.d.cts +13 -0
  154. package/__cjs/utilities/internal/valueToObjectRepresentation.cjs +1 -1
  155. package/__cjs/version.cjs +1 -1
  156. package/__cjs/version.cjs.map +1 -1
  157. package/cache/core/cache.d.ts +22 -4
  158. package/cache/core/cache.js +51 -16
  159. package/cache/core/cache.js.map +1 -1
  160. package/cache/index.d.ts +1 -1
  161. package/cache/index.js.map +1 -1
  162. package/cache/inmemory/entityStore.js +4 -4
  163. package/cache/inmemory/helpers.d.ts +10 -5
  164. package/cache/inmemory/helpers.js +12 -1
  165. package/cache/inmemory/helpers.js.map +1 -1
  166. package/cache/inmemory/inMemoryCache.d.ts +19 -4
  167. package/cache/inmemory/inMemoryCache.js +14 -3
  168. package/cache/inmemory/inMemoryCache.js.map +1 -1
  169. package/cache/inmemory/key-extractor.js +1 -1
  170. package/cache/inmemory/policies.d.ts +1 -1
  171. package/cache/inmemory/policies.js +9 -9
  172. package/cache/inmemory/policies.js.map +1 -1
  173. package/cache/inmemory/readFromStore.js +115 -22
  174. package/cache/inmemory/readFromStore.js.map +1 -1
  175. package/cache/inmemory/types.d.ts +12 -1
  176. package/cache/inmemory/types.js.map +1 -1
  177. package/cache/inmemory/writeToStore.d.ts +8 -4
  178. package/cache/inmemory/writeToStore.js +56 -26
  179. package/cache/inmemory/writeToStore.js.map +1 -1
  180. package/core/ApolloClient.d.ts +1 -0
  181. package/core/ApolloClient.js +20 -16
  182. package/core/ApolloClient.js.map +1 -1
  183. package/core/ObservableQuery.js +8 -8
  184. package/core/QueryInfo.js +1 -1
  185. package/core/QueryManager.js +12 -12
  186. package/core/RefetchEventManager.js +3 -3
  187. package/errors/CombinedGraphQLErrors.d.ts +2 -2
  188. package/errors/CombinedGraphQLErrors.js +3 -7
  189. package/errors/CombinedGraphQLErrors.js.map +1 -1
  190. package/errors/CombinedProtocolErrors.d.ts +2 -2
  191. package/errors/CombinedProtocolErrors.js +3 -8
  192. package/errors/CombinedProtocolErrors.js.map +1 -1
  193. package/incremental/handlers/graphql17Alpha9.js +2 -2
  194. package/incremental/handlers/notImplemented.js +1 -1
  195. package/invariantErrorCodes.js +125 -120
  196. package/link/batch-http/BaseBatchHttpLink.d.ts +0 -7
  197. package/link/batch-http/BaseBatchHttpLink.js +9 -18
  198. package/link/batch-http/BaseBatchHttpLink.js.map +1 -1
  199. package/link/core/ApolloLink.js +3 -3
  200. package/link/http/checkFetcher.js +1 -1
  201. package/link/http/parseAndCheckHttpResponse.js +1 -1
  202. package/link/persisted-queries/index.js +2 -2
  203. package/link/ws/index.js +1 -1
  204. package/local-state/LocalState.js +29 -17
  205. package/local-state/LocalState.js.map +1 -1
  206. package/masking/maskDefinition.js +21 -3
  207. package/masking/maskDefinition.js.map +1 -1
  208. package/masking/maskFragment.js +2 -2
  209. package/masking/maskOperation.js +1 -1
  210. package/masking/utils.js +3 -3
  211. package/package.json +2 -2
  212. package/react/context/ApolloContext.js +1 -1
  213. package/react/context/ApolloProvider.js +1 -1
  214. package/react/hooks/internal/validateSuspenseHookOptions.js +2 -2
  215. package/react/hooks/useApolloClient.js +1 -1
  216. package/react/hooks/useFragment.js +8 -2
  217. package/react/hooks/useFragment.js.map +1 -1
  218. package/react/hooks/useLazyQuery.js +2 -2
  219. package/react/hooks/useLoadableQuery.js +2 -2
  220. package/react/hooks/useSubscription.js +1 -1
  221. package/react/hooks/useSuspenseFragment.js +10 -4
  222. package/react/hooks/useSuspenseFragment.js.map +1 -1
  223. package/react/hooks/useSyncExternalStore.js +1 -1
  224. package/react/hooks-compiled/internal/validateSuspenseHookOptions.js +2 -2
  225. package/react/hooks-compiled/useApolloClient.js +1 -1
  226. package/react/hooks-compiled/useFragment.js +56 -32
  227. package/react/hooks-compiled/useFragment.js.map +1 -1
  228. package/react/hooks-compiled/useLazyQuery.js +2 -2
  229. package/react/hooks-compiled/useLoadableQuery.js +2 -2
  230. package/react/hooks-compiled/useSubscription.js +1 -1
  231. package/react/hooks-compiled/useSuspenseFragment.js +10 -4
  232. package/react/hooks-compiled/useSuspenseFragment.js.map +1 -1
  233. package/react/hooks-compiled/useSyncExternalStore.js +1 -1
  234. package/react/internal/cache/FragmentReference.d.ts +4 -5
  235. package/react/internal/cache/FragmentReference.js +2 -2
  236. package/react/internal/cache/FragmentReference.js.map +1 -1
  237. package/react/internal/cache/QueryReference.js +1 -1
  238. package/react/internal/cache/SuspenseCache.d.ts +4 -5
  239. package/react/internal/cache/SuspenseCache.js +3 -3
  240. package/react/internal/cache/SuspenseCache.js.map +1 -1
  241. package/react/internal/cache/types.d.ts +0 -5
  242. package/react/internal/cache/types.js.map +1 -1
  243. package/react/ssr/prerenderStatic.js +2 -2
  244. package/testing/core/mocking/mockLink.js +4 -4
  245. package/utilities/graphql/DocumentTransform.js +1 -1
  246. package/utilities/internal/DeepMerger.d.ts +13 -3
  247. package/utilities/internal/DeepMerger.js +6 -2
  248. package/utilities/internal/DeepMerger.js.map +1 -1
  249. package/utilities/internal/argumentsObjectFromField.d.ts +2 -2
  250. package/utilities/internal/argumentsObjectFromField.js.map +1 -1
  251. package/utilities/internal/constants.d.ts +32 -0
  252. package/utilities/internal/constants.js +32 -0
  253. package/utilities/internal/constants.js.map +1 -1
  254. package/utilities/internal/createArgumentNode.d.ts +3 -0
  255. package/utilities/internal/createArgumentNode.js +11 -0
  256. package/utilities/internal/createArgumentNode.js.map +1 -0
  257. package/utilities/internal/createDirectiveNode.d.ts +3 -0
  258. package/utilities/internal/createDirectiveNode.js +11 -0
  259. package/utilities/internal/createDirectiveNode.js.map +1 -0
  260. package/utilities/internal/createFragmentArgumentNode.d.ts +3 -0
  261. package/utilities/internal/createFragmentArgumentNode.js +10 -0
  262. package/utilities/internal/createFragmentArgumentNode.js.map +1 -0
  263. package/utilities/internal/createFragmentSpreadNode.d.ts +6 -0
  264. package/utilities/internal/createFragmentSpreadNode.js +17 -0
  265. package/utilities/internal/createFragmentSpreadNode.js.map +1 -0
  266. package/utilities/internal/createNameNode.d.ts +3 -0
  267. package/utilities/internal/createNameNode.js +5 -0
  268. package/utilities/internal/createNameNode.js.map +1 -0
  269. package/utilities/internal/createValueNode.d.ts +12 -0
  270. package/utilities/internal/createValueNode.js +24 -0
  271. package/utilities/internal/createValueNode.js.map +1 -0
  272. package/utilities/internal/createVariableNode.d.ts +3 -0
  273. package/utilities/internal/createVariableNode.js +6 -0
  274. package/utilities/internal/createVariableNode.js.map +1 -0
  275. package/utilities/internal/equalByQuery.d.ts +2 -3
  276. package/utilities/internal/equalByQuery.js +16 -3
  277. package/utilities/internal/equalByQuery.js.map +1 -1
  278. package/utilities/internal/getDefaultValues.d.ts +2 -2
  279. package/utilities/internal/getDefaultValues.js.map +1 -1
  280. package/utilities/internal/getFragmentDefinition.js +3 -3
  281. package/utilities/internal/getFragmentDefinition.js.map +1 -1
  282. package/utilities/internal/getFragmentFromSelection.js +1 -1
  283. package/utilities/internal/getFragmentQueryDocument.js +20 -9
  284. package/utilities/internal/getFragmentQueryDocument.js.map +1 -1
  285. package/utilities/internal/getFragmentScope.d.ts +13 -0
  286. package/utilities/internal/getFragmentScope.js +20 -0
  287. package/utilities/internal/getFragmentScope.js.map +1 -0
  288. package/utilities/internal/getFragmentVariables.d.ts +12 -0
  289. package/utilities/internal/getFragmentVariables.js +30 -0
  290. package/utilities/internal/getFragmentVariables.js.map +1 -0
  291. package/utilities/internal/getMainDefinition.js +1 -1
  292. package/utilities/internal/getQueryDefinition.js +1 -1
  293. package/utilities/internal/index.d.ts +6 -1
  294. package/utilities/internal/index.js +4 -1
  295. package/utilities/internal/index.js.map +1 -1
  296. package/utilities/internal/isNonEmptyObject.d.ts +7 -0
  297. package/utilities/internal/isNonEmptyObject.js +10 -0
  298. package/utilities/internal/isNonEmptyObject.js.map +1 -0
  299. package/utilities/internal/isNonNullObject.d.ts +1 -1
  300. package/utilities/internal/isNonNullObject.js.map +1 -1
  301. package/utilities/internal/mapObservableFragment.d.ts +5 -1
  302. package/utilities/internal/mapObservableFragment.js +14 -9
  303. package/utilities/internal/mapObservableFragment.js.map +1 -1
  304. package/utilities/internal/mergeDeepArray.d.ts +2 -1
  305. package/utilities/internal/mergeDeepArray.js +2 -2
  306. package/utilities/internal/mergeDeepArray.js.map +1 -1
  307. package/utilities/internal/removeDirectivesFromDocument.js +121 -62
  308. package/utilities/internal/removeDirectivesFromDocument.js.map +1 -1
  309. package/utilities/internal/removeFragmentSpreads.d.ts +18 -2
  310. package/utilities/internal/removeFragmentSpreads.js +56 -3
  311. package/utilities/internal/removeFragmentSpreads.js.map +1 -1
  312. package/utilities/internal/shouldInclude.js +4 -4
  313. package/utilities/internal/types/FragmentInfo.d.ts +14 -0
  314. package/utilities/internal/types/FragmentInfo.js +2 -0
  315. package/utilities/internal/types/FragmentInfo.js.map +1 -0
  316. package/utilities/internal/types/Mutable.d.ts +4 -0
  317. package/utilities/internal/types/Mutable.js +2 -0
  318. package/utilities/internal/types/Mutable.js.map +1 -0
  319. package/utilities/internal/types/ObjectWithFragmentInfo.d.ts +13 -0
  320. package/utilities/internal/types/ObjectWithFragmentInfo.js +2 -0
  321. package/utilities/internal/types/ObjectWithFragmentInfo.js.map +1 -0
  322. package/utilities/internal/valueToObjectRepresentation.js +1 -1
  323. package/version.js +1 -1
  324. package/version.js.map +1 -1
@@ -1448,6 +1448,7 @@ export declare class ApolloClient {
1448
1448
  setLink(newLink: ApolloLink): void;
1449
1449
  get defaultContext(): Partial<DefaultContext>;
1450
1450
  private maskedFragmentTransform;
1451
+ private fragmentVariablesTransform;
1451
1452
  private transform;
1452
1453
  /**
1453
1454
  * @experimental
@@ -110,7 +110,7 @@ class ObservableQuery {
110
110
  // Make sure we don't store "standby" as the initialFetchPolicy.
111
111
  initialFetchPolicy = fetchPolicy === "standby" ? defaultFetchPolicy : (fetchPolicy), } = options;
112
112
  if (options[internal_1.variablesUnknownSymbol]) {
113
- (0, invariant_1.invariant)(fetchPolicy === "standby", 85);
113
+ (0, invariant_1.invariant)(fetchPolicy === "standby", 86);
114
114
  this.variablesUnknown = true;
115
115
  }
116
116
  this.lastQuery = transformedQuery;
@@ -419,7 +419,7 @@ class ObservableQuery {
419
419
  const queryDef = (0, internal_1.getQueryDefinition)(this.query);
420
420
  const vars = queryDef.variableDefinitions;
421
421
  if (!vars || !vars.some((v) => v.variable.name.value === "variables")) {
422
- __DEV__ && invariant_1.invariant.warn(86, variables, queryDef.name?.value || queryDef);
422
+ __DEV__ && invariant_1.invariant.warn(87, variables, queryDef.name?.value || queryDef);
423
423
  }
424
424
  }
425
425
  if (variables && !(0, equality_1.equal)(this.variables, variables)) {
@@ -434,7 +434,7 @@ class ObservableQuery {
434
434
  fetchMore({ query, variables, context, errorPolicy, updateQuery, }) {
435
435
  (0, invariant_1.invariant)(
436
436
  this.options.fetchPolicy !== "cache-only",
437
- 87,
437
+ 88,
438
438
  (0, internal_1.getOperationName)(this.query, "(anonymous)")
439
439
  );
440
440
  const combinedOptions = {
@@ -468,7 +468,7 @@ class ObservableQuery {
468
468
  let wasUpdated = false;
469
469
  const isCached = this.options.fetchPolicy !== "no-cache";
470
470
  if (!isCached) {
471
- (0, invariant_1.invariant)(updateQuery, 88);
471
+ (0, invariant_1.invariant)(updateQuery, 89);
472
472
  }
473
473
  const { finalize, pushNotification } = this.pushOperation(networkStatus_js_1.NetworkStatus.fetchMore);
474
474
  pushNotification({
@@ -642,7 +642,7 @@ class ObservableQuery {
642
642
  onError(error);
643
643
  }
644
644
  else {
645
- invariant_1.invariant.error(89, error);
645
+ invariant_1.invariant.error(90, error);
646
646
  }
647
647
  return;
648
648
  }
@@ -893,7 +893,7 @@ class ObservableQuery {
893
893
  if (!this.didWarnCacheOnlyPolling &&
894
894
  pollInterval &&
895
895
  fetchPolicy === "cache-only") {
896
- __DEV__ && invariant_1.invariant.warn(90, (0, internal_1.getOperationName)(this.query, "(anonymous)"));
896
+ __DEV__ && invariant_1.invariant.warn(91, (0, internal_1.getOperationName)(this.query, "(anonymous)"));
897
897
  this.didWarnCacheOnlyPolling = true;
898
898
  }
899
899
  }
@@ -1520,7 +1520,7 @@ class ObservableQuery {
1520
1520
  exports.ObservableQuery = ObservableQuery;
1521
1521
  function logMissingFieldErrors(missing) {
1522
1522
  if (environment_1.__DEV__ && missing) {
1523
- __DEV__ && invariant_1.invariant.debug(91, missing);
1523
+ __DEV__ && invariant_1.invariant.debug(92, missing);
1524
1524
  }
1525
1525
  }
1526
1526
  function isEqualQuery(a, b) {
@@ -1565,7 +1565,7 @@ function getTrackingOperatorPromise(defaultValue) {
1565
1565
  }
1566
1566
  function warnOnFeud(query, diff) {
1567
1567
  __DEV__ && invariant_1.invariant.warn(
1568
- 92,
1568
+ 93,
1569
1569
  (0, internal_1.getOperationName)(query, "(anonymous)"),
1570
1570
  diff.missing?.missing
1571
1571
  );
@@ -363,7 +363,7 @@ class QueryInfo {
363
363
  exports.QueryInfo = QueryInfo;
364
364
  function warnAboutPartialCacheResult(query, networkResult, diff) {
365
365
  __DEV__ && invariant_1.invariant.warn(
366
- 93,
366
+ 94,
367
367
  (0, internal_1.getOperationName)(query, "(anonymous)"),
368
368
  diff.missing?.missing,
369
369
  networkResult,
@@ -106,7 +106,7 @@ class QueryManager {
106
106
  */
107
107
  stop() {
108
108
  this.obsQueries.forEach((oq) => oq.stop());
109
- this.cancelPendingFetches((0, invariant_1.newInvariantError)(94));
109
+ this.cancelPendingFetches((0, invariant_1.newInvariantError)(95));
110
110
  }
111
111
  cancelPendingFetches(error) {
112
112
  this.fetchCancelFns.forEach((cancel) => cancel(error));
@@ -121,7 +121,7 @@ class QueryManager {
121
121
  if (environment_1.__DEV__) {
122
122
  (0, invariant_1.invariant)(
123
123
  this.localState,
124
- 95,
124
+ 96,
125
125
  (0, internal_1.getOperationName)(mutation, "(anonymous)")
126
126
  );
127
127
  }
@@ -356,7 +356,7 @@ class QueryManager {
356
356
  // depend on values that previously existed in the data portion of the
357
357
  // store. So, we cancel the promises and observers that we have issued
358
358
  // so far and not yet resolved (in the case of queries).
359
- this.cancelPendingFetches((0, invariant_1.newInvariantError)(96));
359
+ this.cancelPendingFetches((0, invariant_1.newInvariantError)(97));
360
360
  this.obsQueries.forEach((observableQuery) => {
361
361
  // Set loading to true so listeners don't trigger unless they want
362
362
  // results with partial data.
@@ -426,10 +426,10 @@ class QueryManager {
426
426
  if (!included) {
427
427
  const queryName = queryNames.get(nameOrQueryString);
428
428
  if (queryName) {
429
- __DEV__ && invariant_1.invariant.warn(97, queryName);
429
+ __DEV__ && invariant_1.invariant.warn(98, queryName);
430
430
  }
431
431
  else {
432
- __DEV__ && invariant_1.invariant.warn(98);
432
+ __DEV__ && invariant_1.invariant.warn(99);
433
433
  }
434
434
  }
435
435
  });
@@ -458,7 +458,7 @@ class QueryManager {
458
458
  if (environment_1.__DEV__) {
459
459
  (0, invariant_1.invariant)(
460
460
  !this.getDocumentInfo(query).hasClientExports || this.localState,
461
- 99,
461
+ 100,
462
462
  (0, internal_1.getOperationName)(query, "(anonymous)")
463
463
  );
464
464
  }
@@ -610,14 +610,14 @@ class QueryManager {
610
610
  if (environment_1.__DEV__) {
611
611
  (0, invariant_1.invariant)(
612
612
  this.localState,
613
- 100,
613
+ 101,
614
614
  operation[0].toUpperCase() + operation.slice(1),
615
615
  operationName ?? "(anonymous)"
616
616
  );
617
617
  }
618
618
  (0, invariant_1.invariant)(
619
619
  !hasIncrementalDirective,
620
- 101,
620
+ 102,
621
621
  operation[0].toUpperCase() + operation.slice(1),
622
622
  operationName ?? "(anonymous)"
623
623
  );
@@ -787,7 +787,7 @@ class QueryManager {
787
787
  if (environment_1.__DEV__) {
788
788
  (0, invariant_1.invariant)(
789
789
  this.localState,
790
- 102,
790
+ 103,
791
791
  (0, internal_1.getOperationName)(normalized.query, "(anonymous)")
792
792
  );
793
793
  }
@@ -963,7 +963,7 @@ class QueryManager {
963
963
  !this.noCacheWarningsByCause.has(cause)) {
964
964
  this.noCacheWarningsByCause.add(cause);
965
965
  __DEV__ && invariant_1.invariant.warn(
966
- 103,
966
+ 104,
967
967
  (0, internal_1.getOperationName)(document, `Unnamed ${operationType ?? "operation"}`)
968
968
  );
969
969
  }
@@ -1030,7 +1030,7 @@ class QueryManager {
1030
1030
  if (environment_1.__DEV__) {
1031
1031
  (0, invariant_1.invariant)(
1032
1032
  this.localState,
1033
- 104,
1033
+ 105,
1034
1034
  (0, internal_1.getOperationName)(query, "(anonymous)")
1035
1035
  );
1036
1036
  }
@@ -1154,7 +1154,7 @@ function validateDidEmitValue() {
1154
1154
  didEmitValue = true;
1155
1155
  },
1156
1156
  complete() {
1157
- (0, invariant_1.invariant)(didEmitValue, 105);
1157
+ (0, invariant_1.invariant)(didEmitValue, 106);
1158
1158
  },
1159
1159
  });
1160
1160
  }
@@ -34,7 +34,7 @@ class RefetchEventManager {
34
34
  }
35
35
  if (this.client) {
36
36
  if (environment_1.__DEV__) {
37
- __DEV__ && invariant_1.invariant.warn(106);
37
+ __DEV__ && invariant_1.invariant.warn(107);
38
38
  }
39
39
  this.disconnect();
40
40
  }
@@ -103,13 +103,13 @@ class RefetchEventManager {
103
103
  const [payload] = args;
104
104
  if (!this.client) {
105
105
  if (environment_1.__DEV__) {
106
- __DEV__ && invariant_1.invariant.warn(107, source);
106
+ __DEV__ && invariant_1.invariant.warn(108, source);
107
107
  }
108
108
  return;
109
109
  }
110
110
  if (!this.hasSource(source)) {
111
111
  if (environment_1.__DEV__) {
112
- __DEV__ && invariant_1.invariant.warn(108, source);
112
+ __DEV__ && invariant_1.invariant.warn(109, source);
113
113
  }
114
114
  return;
115
115
  }
@@ -42,7 +42,7 @@ function defaultFormatMessage(errors) {
42
42
  * }
43
43
  * ```
44
44
  */
45
- class CombinedGraphQLErrors extends Error {
45
+ class CombinedGraphQLErrors extends AggregateError {
46
46
  /**
47
47
  * A method that determines whether an error is a `CombinedGraphQLErrors`
48
48
  * object. This method enables TypeScript to narrow the error type.
@@ -77,10 +77,6 @@ class CombinedGraphQLErrors extends Error {
77
77
  */
78
78
  static formatMessage = defaultFormatMessage;
79
79
  /**
80
- * The raw list of GraphQL errors returned by the `errors` field in the GraphQL response.
81
- */
82
- errors;
83
- /**
84
80
  * Partial data returned in the `data` field of the GraphQL response.
85
81
  */
86
82
  data;
@@ -89,11 +85,11 @@ class CombinedGraphQLErrors extends Error {
89
85
  */
90
86
  extensions;
91
87
  constructor(result, errors = result.errors || []) {
92
- super(CombinedGraphQLErrors.formatMessage(errors, {
88
+ super(errors, CombinedGraphQLErrors.formatMessage(errors, {
93
89
  result,
94
90
  defaultFormatMessage,
95
91
  }));
96
- this.errors = errors;
92
+ Object.defineProperty(this, "errors", { enumerable: true });
97
93
  this.data = result.data;
98
94
  this.extensions = result.extensions;
99
95
  this.name = "CombinedGraphQLErrors";
@@ -1 +1 @@
1
- {"version":3,"file":"CombinedGraphQLErrors.cjs","sources":["../../../src/errors/CombinedGraphQLErrors.ts"],"sourcesContent":["import type { FormattedExecutionResult, GraphQLFormattedError } from \"graphql\";\n\nimport type { ApolloLink } from \"@apollo/client/link\";\n\nimport { brand, isBranded } from \"./utils.js\";\n\nexport declare namespace CombinedGraphQLErrors {\n export interface MessageFormatterOptions {\n /**\n * The raw result returned from the server.\n */\n result: ApolloLink.Result<unknown>;\n\n /**\n * The default message formatter. Call this to get a string with the default\n * formatted message.\n *\n * @remarks\n * To format part of the message using the default message formatter, call\n * the `defaultFormatMessage` function provided to the `options` argument of\n * your message formatter.\n *\n * @example\n *\n * The following example prepends a string to the message and uses the\n * default message formatter to format the error messages.\n *\n * ```ts\n * CombinedGraphQLErrors.formatMessage = (errors, { defaultFormatMessage }) => {\n * return `[GraphQL errors]: ${defaultFormatMessage(errors)}`;\n * };\n * ```\n */\n defaultFormatMessage: (\n errors: ReadonlyArray<GraphQLFormattedError>\n ) => string;\n }\n\n /**\n * By default, `CombinedGraphQLErrors` formats the `message` property by\n * joining each error's `message` field with a newline. To customize the\n * format of the `message`, such as changing the delimiter or adding a message\n * prefix, override the static `formatMessage` method.\n *\n * @example\n *\n * The following example demonstrates how to format the error message by\n * joining each error with a comma.\n *\n * ```ts\n * import { CombinedGraphQLErrors } from \"@apollo/client/errors\";\n *\n * CombinedGraphQLErrors.formatMessage = (errors) => {\n * return errors.map((error) => error.message).join(\", \");\n * };\n * ```\n *\n * @remarks\n *\n * See the [`formatMessage`](https://www.apollographql.com/docs/react/api/errors/CombinedGraphQLErrors#formatmessage) docs for details about the parameters provided to the `formatMessage` function.\n *\n * > [!NOTE]\n * > The message formatter needs to be configured before any operation is executed by Apollo Client, otherwise the default message formatter is used. We recommend configuring the message formatter before initializing your `ApolloClient` instance.\n *\n * @param errors - The array of GraphQL errors returned from the server in the\n * `errors` field of the response.\n * @param options - Additional context that could be useful when formatting\n * the message.\n */\n export type MessageFormatter = (\n errors: ReadonlyArray<GraphQLFormattedError>,\n options: MessageFormatterOptions\n ) => string;\n\n namespace DocumentationTypes {\n /**\n * A function that formats the error message used for the error's `message`\n * property. Override this method to provide your own formatting.\n *\n * @remarks\n *\n * The `formatMessage` function is called by the `CombinedGraphQLErrors`\n * constructor to provide a formatted message as the `message` property of the\n * `CombinedGraphQLErrors` object. Follow the [\"Providing a custom message\n * formatter\"](https://www.apollographql.com/docs/react/api/errors/CombinedGraphQLErrors#providing-a-custom-message-formatter) guide to learn how to modify the message format.\n *\n * @param errors - The array of GraphQL errors returned from the server in\n * the `errors` field of the response.\n * @param options - Additional context that could be useful when formatting\n * the message.\n */\n function formatMessage(\n errors: ReadonlyArray<GraphQLFormattedError>,\n options: MessageFormatterOptions\n ): string;\n\n interface InstanceProperties {\n /**\n * The raw list of GraphQL errors returned by the `errors` field in the GraphQL response.\n */\n readonly errors: ReadonlyArray<GraphQLFormattedError>;\n\n /**\n * Partial data returned in the `data` field of the GraphQL response.\n */\n readonly data: Record<string, unknown> | null | undefined;\n\n /**\n * Extensions returned by the `extensions` field in the GraphQL response.\n */\n readonly extensions: Record<string, unknown> | undefined;\n }\n\n /**\n * A method that determines whether an error is a `{{errorClass}}`\n * object. This method enables TypeScript to narrow the error type.\n *\n * @example\n *\n * ```ts\n * if ({{errorClass}}.is(error)) {\n * // TypeScript now knows `error` is a `{{errorClass}}` object\n * console.log(error.errors);\n * }\n * ```\n */\n function is(error: unknown): boolean;\n }\n}\n\nfunction defaultFormatMessage(errors: ReadonlyArray<GraphQLFormattedError>) {\n return (\n errors\n // Handle non-spec-compliant servers: See #1185\n .filter((e) => e)\n .map((e) => e.message || \"Error message not found.\")\n .join(\"\\n\")\n );\n}\n\n/**\n * Represents the combined list of GraphQL errors returned from the server in a\n * GraphQL response. This error type is used when your GraphQL operation returns\n * errors in the `errors` field of the response.\n *\n * @remarks\n *\n * When your GraphQL operation encounters errors on the server side (such as\n * resolver errors, validation errors, or syntax errors), the server returns\n * these errors in the `errors` array of the GraphQL response. Apollo Client\n * wraps these errors in a `CombinedGraphQLErrors` object, which provides access\n * to the individual errors while maintaining additional context about the\n * response.\n *\n * @example\n *\n * ```ts\n * import { CombinedGraphQLErrors } from \"@apollo/client/errors\";\n *\n * // Check if an error is a CombinedGraphQLErrors object\n * if (CombinedGraphQLErrors.is(error)) {\n * // Access individual GraphQL errors\n * error.errors.forEach((graphQLError) => {\n * console.log(graphQLError.message);\n * console.log(graphQLError.path);\n * console.log(graphQLError.locations);\n * });\n *\n * // Access the original GraphQL result\n * console.log(error.result);\n * }\n * ```\n */\nexport class CombinedGraphQLErrors extends Error {\n /**\n * {@inheritDoc @apollo/client!CombinedGraphQLErrors.DocumentationTypes.is:function(1) {\"errorClass\":\"CombinedGraphQLErrors\"}}\n */\n static is(error: unknown): error is CombinedGraphQLErrors {\n return isBranded(error, \"CombinedGraphQLErrors\");\n }\n\n /** {@inheritDoc @apollo/client!CombinedGraphQLErrors.DocumentationTypes.formatMessage:function(1)} */\n static formatMessage: CombinedGraphQLErrors.MessageFormatter =\n defaultFormatMessage;\n\n /** {@inheritDoc @apollo/client!CombinedGraphQLErrors.DocumentationTypes.InstanceProperties#errors:member} */\n readonly errors: ReadonlyArray<GraphQLFormattedError>;\n\n /** {@inheritDoc @apollo/client!CombinedGraphQLErrors.DocumentationTypes.InstanceProperties#data:member} */\n readonly data: Record<string, unknown> | null | undefined;\n\n /** {@inheritDoc @apollo/client!CombinedGraphQLErrors.DocumentationTypes.InstanceProperties#extensions:member} */\n readonly extensions: Record<string, unknown> | undefined;\n\n constructor(result: FormattedExecutionResult<any>);\n constructor(\n result: ApolloLink.Result<any>,\n errors: ReadonlyArray<GraphQLFormattedError>\n );\n\n constructor(\n result: ApolloLink.Result<any> | FormattedExecutionResult<any>,\n errors = (result as FormattedExecutionResult<any>).errors || []\n ) {\n super(\n CombinedGraphQLErrors.formatMessage(errors, {\n result,\n defaultFormatMessage,\n })\n );\n this.errors = errors;\n this.data = (result as Partial<FormattedExecutionResult>).data;\n this.extensions = (result as Partial<FormattedExecutionResult>).extensions;\n this.name = \"CombinedGraphQLErrors\";\n\n brand(this);\n Object.setPrototypeOf(this, CombinedGraphQLErrors.prototype);\n }\n}\n"],"names":[],"mappings":";;;AAIA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AA8HA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAS,CAAT,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAA6B,CAAC,CAA9B,CAAA,CAAA,CAAA,CAAA,CAA0E,EAA1E;IACE,CAAF,CAAA,CAAA,CAAA,CAAA,EAAS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,CAAA,CAAA,CAAA,CAAyB,CAAC,CAA1B,CAAA,CAAA,CAA8B,EAAE,CAAhC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAqD,CAAC,CAAtD,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAA+D,CAAC;IAC9D;;AA5CF,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,EAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;"}
1
+ {"version":3,"file":"CombinedGraphQLErrors.cjs","sources":["../../../src/errors/CombinedGraphQLErrors.ts"],"sourcesContent":["import type { FormattedExecutionResult, GraphQLFormattedError } from \"graphql\";\n\nimport type { ApolloLink } from \"@apollo/client/link\";\n\nimport { brand, isBranded } from \"./utils.js\";\n\nexport declare namespace CombinedGraphQLErrors {\n export interface MessageFormatterOptions {\n /**\n * The raw result returned from the server.\n */\n result: ApolloLink.Result<unknown>;\n\n /**\n * The default message formatter. Call this to get a string with the default\n * formatted message.\n *\n * @remarks\n * To format part of the message using the default message formatter, call\n * the `defaultFormatMessage` function provided to the `options` argument of\n * your message formatter.\n *\n * @example\n *\n * The following example prepends a string to the message and uses the\n * default message formatter to format the error messages.\n *\n * ```ts\n * CombinedGraphQLErrors.formatMessage = (errors, { defaultFormatMessage }) => {\n * return `[GraphQL errors]: ${defaultFormatMessage(errors)}`;\n * };\n * ```\n */\n defaultFormatMessage: (\n errors: ReadonlyArray<GraphQLFormattedError>\n ) => string;\n }\n\n /**\n * By default, `CombinedGraphQLErrors` formats the `message` property by\n * joining each error's `message` field with a newline. To customize the\n * format of the `message`, such as changing the delimiter or adding a message\n * prefix, override the static `formatMessage` method.\n *\n * @example\n *\n * The following example demonstrates how to format the error message by\n * joining each error with a comma.\n *\n * ```ts\n * import { CombinedGraphQLErrors } from \"@apollo/client/errors\";\n *\n * CombinedGraphQLErrors.formatMessage = (errors) => {\n * return errors.map((error) => error.message).join(\", \");\n * };\n * ```\n *\n * @remarks\n *\n * See the [`formatMessage`](https://www.apollographql.com/docs/react/api/errors/CombinedGraphQLErrors#formatmessage) docs for details about the parameters provided to the `formatMessage` function.\n *\n * > [!NOTE]\n * > The message formatter needs to be configured before any operation is executed by Apollo Client, otherwise the default message formatter is used. We recommend configuring the message formatter before initializing your `ApolloClient` instance.\n *\n * @param errors - The array of GraphQL errors returned from the server in the\n * `errors` field of the response.\n * @param options - Additional context that could be useful when formatting\n * the message.\n */\n export type MessageFormatter = (\n errors: ReadonlyArray<GraphQLFormattedError>,\n options: MessageFormatterOptions\n ) => string;\n\n namespace DocumentationTypes {\n /**\n * A function that formats the error message used for the error's `message`\n * property. Override this method to provide your own formatting.\n *\n * @remarks\n *\n * The `formatMessage` function is called by the `CombinedGraphQLErrors`\n * constructor to provide a formatted message as the `message` property of the\n * `CombinedGraphQLErrors` object. Follow the [\"Providing a custom message\n * formatter\"](https://www.apollographql.com/docs/react/api/errors/CombinedGraphQLErrors#providing-a-custom-message-formatter) guide to learn how to modify the message format.\n *\n * @param errors - The array of GraphQL errors returned from the server in\n * the `errors` field of the response.\n * @param options - Additional context that could be useful when formatting\n * the message.\n */\n function formatMessage(\n errors: ReadonlyArray<GraphQLFormattedError>,\n options: MessageFormatterOptions\n ): string;\n\n interface InstanceProperties {\n /**\n * The raw list of GraphQL errors returned by the `errors` field in the GraphQL response.\n */\n readonly errors: ReadonlyArray<GraphQLFormattedError>;\n\n /**\n * Partial data returned in the `data` field of the GraphQL response.\n */\n readonly data: Record<string, unknown> | null | undefined;\n\n /**\n * Extensions returned by the `extensions` field in the GraphQL response.\n */\n readonly extensions: Record<string, unknown> | undefined;\n }\n\n /**\n * A method that determines whether an error is a `{{errorClass}}`\n * object. This method enables TypeScript to narrow the error type.\n *\n * @example\n *\n * ```ts\n * if ({{errorClass}}.is(error)) {\n * // TypeScript now knows `error` is a `{{errorClass}}` object\n * console.log(error.errors);\n * }\n * ```\n */\n function is(error: unknown): boolean;\n }\n}\n\nfunction defaultFormatMessage(errors: ReadonlyArray<GraphQLFormattedError>) {\n return (\n errors\n // Handle non-spec-compliant servers: See #1185\n .filter((e) => e)\n .map((e) => e.message || \"Error message not found.\")\n .join(\"\\n\")\n );\n}\n\n/**\n * Represents the combined list of GraphQL errors returned from the server in a\n * GraphQL response. This error type is used when your GraphQL operation returns\n * errors in the `errors` field of the response.\n *\n * @remarks\n *\n * When your GraphQL operation encounters errors on the server side (such as\n * resolver errors, validation errors, or syntax errors), the server returns\n * these errors in the `errors` array of the GraphQL response. Apollo Client\n * wraps these errors in a `CombinedGraphQLErrors` object, which provides access\n * to the individual errors while maintaining additional context about the\n * response.\n *\n * @example\n *\n * ```ts\n * import { CombinedGraphQLErrors } from \"@apollo/client/errors\";\n *\n * // Check if an error is a CombinedGraphQLErrors object\n * if (CombinedGraphQLErrors.is(error)) {\n * // Access individual GraphQL errors\n * error.errors.forEach((graphQLError) => {\n * console.log(graphQLError.message);\n * console.log(graphQLError.path);\n * console.log(graphQLError.locations);\n * });\n *\n * // Access the original GraphQL result\n * console.log(error.result);\n * }\n * ```\n */\nexport class CombinedGraphQLErrors extends AggregateError {\n /**\n * {@inheritDoc @apollo/client!CombinedGraphQLErrors.DocumentationTypes.is:function(1) {\"errorClass\":\"CombinedGraphQLErrors\"}}\n */\n static is(error: unknown): error is CombinedGraphQLErrors {\n return isBranded(error, \"CombinedGraphQLErrors\");\n }\n\n /** {@inheritDoc @apollo/client!CombinedGraphQLErrors.DocumentationTypes.formatMessage:function(1)} */\n static formatMessage: CombinedGraphQLErrors.MessageFormatter =\n defaultFormatMessage;\n\n /** {@inheritDoc @apollo/client!CombinedGraphQLErrors.DocumentationTypes.InstanceProperties#errors:member} */\n declare errors: Array<GraphQLFormattedError>;\n\n /** {@inheritDoc @apollo/client!CombinedGraphQLErrors.DocumentationTypes.InstanceProperties#data:member} */\n readonly data: Record<string, unknown> | null | undefined;\n\n /** {@inheritDoc @apollo/client!CombinedGraphQLErrors.DocumentationTypes.InstanceProperties#extensions:member} */\n readonly extensions: Record<string, unknown> | undefined;\n\n constructor(result: FormattedExecutionResult<any>);\n constructor(\n result: ApolloLink.Result<any>,\n errors: ReadonlyArray<GraphQLFormattedError>\n );\n\n constructor(\n result: ApolloLink.Result<any> | FormattedExecutionResult<any>,\n errors: ReadonlyArray<GraphQLFormattedError> = (\n result as FormattedExecutionResult<any>\n ).errors || []\n ) {\n super(\n errors,\n CombinedGraphQLErrors.formatMessage(errors, {\n result,\n defaultFormatMessage,\n })\n );\n Object.defineProperty(this, \"errors\", { enumerable: true });\n this.data = (result as Partial<FormattedExecutionResult>).data;\n this.extensions = (result as Partial<FormattedExecutionResult>).extensions;\n this.name = \"CombinedGraphQLErrors\";\n\n brand(this);\n Object.setPrototypeOf(this, CombinedGraphQLErrors.prototype);\n }\n}\n"],"names":[],"mappings":";;;AAIA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AA8HA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAS,CAAT,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAA6B,CAAC,CAA9B,CAAA,CAAA,CAAA,CA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,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAuC;QAEnC,CAAJ,CAAA,EAAI,CAAJ,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAS,CAAT,CAAU,CAAV,CAAA,CAAA,CAAc,CAAC;QACX,CAAJ,CAAA,CAAA,CAAA,CAAA,CAAU,CAAC,CAAX,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAyB,CAAC,CAA1B,CAAA,CAAA,CAA8B,EAAE,CAAhC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAqD,CAAC,CAAtD,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAA+D,CAAC;IAC9D;;AA/CF,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,EAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;"}
@@ -141,7 +141,7 @@ export declare namespace CombinedGraphQLErrors {
141
141
  * }
142
142
  * ```
143
143
  */
144
- export declare class CombinedGraphQLErrors extends Error {
144
+ export declare class CombinedGraphQLErrors extends AggregateError {
145
145
  /**
146
146
  * A method that determines whether an error is a `CombinedGraphQLErrors`
147
147
  * object. This method enables TypeScript to narrow the error type.
@@ -176,7 +176,7 @@ export declare class CombinedGraphQLErrors extends Error {
176
176
  /**
177
177
  * The raw list of GraphQL errors returned by the `errors` field in the GraphQL response.
178
178
  */
179
- readonly errors: ReadonlyArray<GraphQLFormattedError>;
179
+ errors: Array<GraphQLFormattedError>;
180
180
  /**
181
181
  * Partial data returned in the `data` field of the GraphQL response.
182
182
  */
@@ -31,7 +31,7 @@ function defaultFormatMessage(errors) {
31
31
  * }
32
32
  * ```
33
33
  */
34
- class CombinedProtocolErrors extends Error {
34
+ class CombinedProtocolErrors extends AggregateError {
35
35
  /**
36
36
  * A method that determines whether an error is a `CombinedProtocolErrors`
37
37
  * object. This method enables TypeScript to narrow the error type.
@@ -65,17 +65,12 @@ class CombinedProtocolErrors extends Error {
65
65
  * the message.
66
66
  */
67
67
  static formatMessage = defaultFormatMessage;
68
- /**
69
- * The raw list of errors returned by the top-level `errors` field in the
70
- * multipart HTTP subscription response.
71
- */
72
- errors;
73
68
  constructor(protocolErrors) {
74
- super(CombinedProtocolErrors.formatMessage(protocolErrors, {
69
+ super(protocolErrors, CombinedProtocolErrors.formatMessage(protocolErrors, {
75
70
  defaultFormatMessage,
76
71
  }));
77
72
  this.name = "CombinedProtocolErrors";
78
- this.errors = protocolErrors;
73
+ Object.defineProperty(this, "errors", { enumerable: true });
79
74
  (0, utils_js_1.brand)(this);
80
75
  Object.setPrototypeOf(this, CombinedProtocolErrors.prototype);
81
76
  }
@@ -1 +1 @@
1
- {"version":3,"file":"CombinedProtocolErrors.cjs","sources":["../../../src/errors/CombinedProtocolErrors.ts"],"sourcesContent":["import type { GraphQLFormattedError } from \"graphql\";\n\nimport { brand, isBranded } from \"./utils.js\";\n\nexport declare namespace CombinedProtocolErrors {\n export interface MessageFormatterOptions {\n /**\n * The default message formatter. Call this to get a string with the default\n * formatted message.\n *\n * @remarks\n * To format part of the message using the default message formatter, call\n * the `defaultFormatMessage` function provided to the `options` argument of\n * your message formatter.\n *\n * @example\n *\n * The following example prepends a string to the message and uses the\n * default message formatter to format the error messages.\n *\n * ```ts\n * CombinedProtocolErrors.formatMessage = (errors, { defaultFormatMessage }) => {\n * return `[Protocol errors]: ${defaultFormatMessage(errors)}`;\n * };\n * ```\n */\n defaultFormatMessage: (\n errors: ReadonlyArray<GraphQLFormattedError>\n ) => string;\n }\n\n /**\n * By default, `CombinedProtocolErrors` formats the `message` property by\n * joining each error's `message` field with a newline. To customize the\n * format of the `message`, such as changing the delimiter or adding a message\n * prefix, override the static `formatMessage` method.\n *\n * @remarks\n *\n * See the [`formatMessage`](https://www.apollographql.com/docs/react/api/errors/CombinedProtocolErrors) section for details about the parameters provided to the `formatMessage` function.\n *\n * > [!NOTE]\n * > The message formatter needs to be configured before any operation is executed by Apollo Client, otherwise the default message formatter is used. We recommend configuring the message formatter before initializing your `ApolloClient` instance.\n *\n * @example\n *\n * The following example demonstrates how to format the error message by\n * joining each error with a comma.\n *\n * ```ts\n * import { CombinedProtocolErrors } from \"@apollo/client/errors\";\n *\n * CombinedProtocolErrors.formatMessage = (errors) => {\n * return errors.map((error) => error.message).join(\", \");\n * };\n * ```\n *\n * @param errors - The array of GraphQL errors returned from the server in the\n * `errors` field of the response.\n * @param options - Additional context that could be useful when formatting\n * the message.\n */\n export type MessageFormatter = (\n errors: ReadonlyArray<GraphQLFormattedError>,\n options: MessageFormatterOptions\n ) => string;\n\n namespace DocumentationTypes {\n /**\n * A function that formats the error message used for the error's `message`\n * property. Override this method to provide your own formatting.\n *\n * @remarks\n *\n * The `formatMessage` function is called by the `CombinedProtocolErrors`\n * constructor to provide a formatted message as the `message` property of the\n * `CombinedProtocolErrors` object. Follow the [\"Providing a custom message\n * formatter\"](https://www.apollographql.com/docs/react/api/errors/CombinedProtocolErrors#providing-a-custom-message-formatter) guide to learn how to modify the message format.\n *\n * @param errors - The array of GraphQL errors returned from the server in the\n * `errors` field of the response.\n * @param options - Additional context that could be useful when formatting\n * the message.\n */\n function formatMessage(\n errors: ReadonlyArray<GraphQLFormattedError>,\n options: MessageFormatterOptions\n ): string;\n\n interface InstanceProperties {\n /**\n * The raw list of errors returned by the top-level `errors` field in the\n * multipart HTTP subscription response.\n */\n readonly errors: ReadonlyArray<GraphQLFormattedError>;\n }\n }\n}\n\nfunction defaultFormatMessage(errors: ReadonlyArray<GraphQLFormattedError>) {\n return errors.map((e) => e.message || \"Error message not found.\").join(\"\\n\");\n}\n\n/**\n * Fatal transport-level errors returned when executing a subscription using the\n * multipart HTTP subscription protocol. See the documentation on the\n * [multipart HTTP protocol for GraphQL Subscriptions](https://www.apollographql.com/docs/graphos/routing/operations/subscriptions/multipart-protocol) for more information on these errors.\n *\n * @remarks\n *\n * These errors indicate issues with the subscription transport itself, rather\n * than GraphQL-level errors. They typically occur when there are problems\n * communicating with subgraphs from the Apollo Router.\n *\n * @example\n *\n * ```ts\n * import { CombinedProtocolErrors } from \"@apollo/client/errors\";\n *\n * // Check if an error is a CombinedProtocolErrors instance\n * if (CombinedProtocolErrors.is(error)) {\n * // Access individual protocol errors\n * error.errors.forEach((protocolError) => {\n * console.log(protocolError.message);\n * console.log(protocolError.extensions);\n * });\n * }\n * ```\n */\nexport class CombinedProtocolErrors extends Error {\n /**\n * A method that determines whether an error is a `CombinedProtocolErrors`\n * object. This method enables TypeScript to narrow the error type.\n *\n * @example\n *\n * ```ts\n * if (CombinedProtocolErrors.is(error)) {\n * // TypeScript now knows `error` is a CombinedProtocolErrors object\n * console.log(error.errors);\n * }\n * ```\n */\n static is(error: unknown): error is CombinedProtocolErrors {\n return isBranded(error, \"CombinedProtocolErrors\");\n }\n\n /** {@inheritDoc @apollo/client!CombinedProtocolErrors.DocumentationTypes.formatMessage:function(1)} */\n static formatMessage: CombinedProtocolErrors.MessageFormatter =\n defaultFormatMessage;\n\n /** {@inheritDoc @apollo/client!CombinedProtocolErrors.DocumentationTypes.InstanceProperties#errors:member} */\n readonly errors: ReadonlyArray<GraphQLFormattedError>;\n\n constructor(\n protocolErrors:\n | Array<GraphQLFormattedError>\n | ReadonlyArray<GraphQLFormattedError>\n ) {\n super(\n CombinedProtocolErrors.formatMessage(protocolErrors, {\n defaultFormatMessage,\n })\n );\n this.name = \"CombinedProtocolErr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,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAgE,CAAC;IAC/D;;AAxCF,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,EAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;"}
1
+ {"version":3,"file":"CombinedProtocolErrors.cjs","sources":["../../../src/errors/CombinedProtocolErrors.ts"],"sourcesContent":["import type { GraphQLFormattedError } from \"graphql\";\n\nimport { brand, isBranded } from \"./utils.js\";\n\nexport declare namespace CombinedProtocolErrors {\n export interface MessageFormatterOptions {\n /**\n * The default message formatter. Call this to get a string with the default\n * formatted message.\n *\n * @remarks\n * To format part of the message using the default message formatter, call\n * the `defaultFormatMessage` function provided to the `options` argument of\n * your message formatter.\n *\n * @example\n *\n * The following example prepends a string to the message and uses the\n * default message formatter to format the error messages.\n *\n * ```ts\n * CombinedProtocolErrors.formatMessage = (errors, { defaultFormatMessage }) => {\n * return `[Protocol errors]: ${defaultFormatMessage(errors)}`;\n * };\n * ```\n */\n defaultFormatMessage: (\n errors: ReadonlyArray<GraphQLFormattedError>\n ) => string;\n }\n\n /**\n * By default, `CombinedProtocolErrors` formats the `message` property by\n * joining each error's `message` field with a newline. To customize the\n * format of the `message`, such as changing the delimiter or adding a message\n * prefix, override the static `formatMessage` method.\n *\n * @remarks\n *\n * See the [`formatMessage`](https://www.apollographql.com/docs/react/api/errors/CombinedProtocolErrors) section for details about the parameters provided to the `formatMessage` function.\n *\n * > [!NOTE]\n * > The message formatter needs to be configured before any operation is executed by Apollo Client, otherwise the default message formatter is used. We recommend configuring the message formatter before initializing your `ApolloClient` instance.\n *\n * @example\n *\n * The following example demonstrates how to format the error message by\n * joining each error with a comma.\n *\n * ```ts\n * import { CombinedProtocolErrors } from \"@apollo/client/errors\";\n *\n * CombinedProtocolErrors.formatMessage = (errors) => {\n * return errors.map((error) => error.message).join(\", \");\n * };\n * ```\n *\n * @param errors - The array of GraphQL errors returned from the server in the\n * `errors` field of the response.\n * @param options - Additional context that could be useful when formatting\n * the message.\n */\n export type MessageFormatter = (\n errors: ReadonlyArray<GraphQLFormattedError>,\n options: MessageFormatterOptions\n ) => string;\n\n namespace DocumentationTypes {\n /**\n * A function that formats the error message used for the error's `message`\n * property. Override this method to provide your own formatting.\n *\n * @remarks\n *\n * The `formatMessage` function is called by the `CombinedProtocolErrors`\n * constructor to provide a formatted message as the `message` property of the\n * `CombinedProtocolErrors` object. Follow the [\"Providing a custom message\n * formatter\"](https://www.apollographql.com/docs/react/api/errors/CombinedProtocolErrors#providing-a-custom-message-formatter) guide to learn how to modify the message format.\n *\n * @param errors - The array of GraphQL errors returned from the server in the\n * `errors` field of the response.\n * @param options - Additional context that could be useful when formatting\n * the message.\n */\n function formatMessage(\n errors: ReadonlyArray<GraphQLFormattedError>,\n options: MessageFormatterOptions\n ): string;\n\n interface InstanceProperties {\n /**\n * The raw list of errors returned by the top-level `errors` field in the\n * multipart HTTP subscription response.\n */\n readonly errors: ReadonlyArray<GraphQLFormattedError>;\n }\n }\n}\n\nfunction defaultFormatMessage(errors: ReadonlyArray<GraphQLFormattedError>) {\n return errors.map((e) => e.message || \"Error message not found.\").join(\"\\n\");\n}\n\n/**\n * Fatal transport-level errors returned when executing a subscription using the\n * multipart HTTP subscription protocol. See the documentation on the\n * [multipart HTTP protocol for GraphQL Subscriptions](https://www.apollographql.com/docs/graphos/routing/operations/subscriptions/multipart-protocol) for more information on these errors.\n *\n * @remarks\n *\n * These errors indicate issues with the subscription transport itself, rather\n * than GraphQL-level errors. They typically occur when there are problems\n * communicating with subgraphs from the Apollo Router.\n *\n * @example\n *\n * ```ts\n * import { CombinedProtocolErrors } from \"@apollo/client/errors\";\n *\n * // Check if an error is a CombinedProtocolErrors instance\n * if (CombinedProtocolErrors.is(error)) {\n * // Access individual protocol errors\n * error.errors.forEach((protocolError) => {\n * console.log(protocolError.message);\n * console.log(protocolError.extensions);\n * });\n * }\n * ```\n */\nexport class CombinedProtocolErrors extends AggregateError {\n /**\n * A method that determines whether an error is a `CombinedProtocolErrors`\n * object. This method enables TypeScript to narrow the error type.\n *\n * @example\n *\n * ```ts\n * if (CombinedProtocolErrors.is(error)) {\n * // TypeScript now knows `error` is a CombinedProtocolErrors object\n * console.log(error.errors);\n * }\n * ```\n */\n static is(error: unknown): error is CombinedProtocolErrors {\n return isBranded(error, \"CombinedProtocolErrors\");\n }\n\n /** {@inheritDoc @apollo/client!CombinedProtocolErrors.DocumentationTypes.formatMessage:function(1)} */\n static formatMessage: CombinedProtocolErrors.MessageFormatter =\n defaultFormatMessage;\n\n /** {@inheritDoc @apollo/client!CombinedProtocolErrors.DocumentationTypes.InstanceProperties#errors:member} */\n declare errors: Array<GraphQLFormattedError>;\n\n constructor(\n protocolErrors:\n | Array<GraphQLFormattedError>\n | ReadonlyArray<GraphQLFormattedError>\n ) {\n super(\n protocolErrors,\n CombinedProtocolErrors.formatMessage(protocolErrors, {\n defaultFormatMessage,\n })\n );\n this.name = \"CombinedProtocolErrors\";\n Object.defineProperty(this, \"errors\", { enumerable: true });\n\n brand(this);\n Object.setPrototypeOf(this, CombinedProtocolErrors.prototype);\n }\n}\n"],"names":[],"mappings":";;;AAEA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAiGA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAS,CA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A,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,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;"}
@@ -108,7 +108,7 @@ export declare namespace CombinedProtocolErrors {
108
108
  * }
109
109
  * ```
110
110
  */
111
- export declare class CombinedProtocolErrors extends Error {
111
+ export declare class CombinedProtocolErrors extends AggregateError {
112
112
  /**
113
113
  * A method that determines whether an error is a `CombinedProtocolErrors`
114
114
  * object. This method enables TypeScript to narrow the error type.
@@ -144,7 +144,7 @@ export declare class CombinedProtocolErrors extends Error {
144
144
  * The raw list of errors returned by the top-level `errors` field in the
145
145
  * multipart HTTP subscription response.
146
146
  */
147
- readonly errors: ReadonlyArray<GraphQLFormattedError>;
147
+ errors: Array<GraphQLFormattedError>;
148
148
  constructor(protocolErrors: Array<GraphQLFormattedError> | ReadonlyArray<GraphQLFormattedError>);
149
149
  }
150
150
  //# sourceMappingURL=CombinedProtocolErrors.d.cts.map
@@ -37,7 +37,7 @@ class IncrementalRequest {
37
37
  const name = node.name.value;
38
38
  if (name === "defer") {
39
39
  const labelNode = node.arguments?.find((arg) => arg.name.value === "label");
40
- (0, invariant_1.invariant)(labelNode && labelNode.value.kind === "StringValue", 68);
40
+ (0, invariant_1.invariant)(labelNode && labelNode.value.kind === "StringValue", 69);
41
41
  this.deferLabels.add(labelNode.value.value);
42
42
  }
43
43
  },
@@ -111,7 +111,7 @@ class IncrementalRequest {
111
111
  if (hasIncrementalChunks(chunk)) {
112
112
  for (const incremental of chunk.incremental) {
113
113
  const pending = this.pendingMap.get(incremental.id);
114
- (0, invariant_1.invariant)(pending, 69);
114
+ (0, invariant_1.invariant)(pending, 70);
115
115
  const path = pending.path.concat(incremental.subPath ?? []);
116
116
  let data;
117
117
  if ("items" in incremental) {
@@ -8,7 +8,7 @@ class NotImplementedHandler {
8
8
  return false;
9
9
  }
10
10
  prepareRequest(request) {
11
- (0, invariant_1.invariant)(!(0, internal_1.hasDirectives)(["defer", "stream"], request.query), 70);
11
+ (0, invariant_1.invariant)(!(0, internal_1.hasDirectives)(["defer", "stream"], request.query), 71);
12
12
  return request;
13
13
  }
14
14
  extractErrors() { }