@apollo/client 3.8.7 → 3.8.8

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 (609) hide show
  1. package/.changeset/README.md +8 -0
  2. package/.changeset/config.json +14 -0
  3. package/CHANGELOG.md +3357 -0
  4. package/apollo-client.cjs +314 -316
  5. package/apollo-client.cjs.map +1 -1
  6. package/apollo-client.min.cjs +1 -1
  7. package/cache/cache.cjs +133 -152
  8. package/cache/cache.cjs.map +1 -1
  9. package/cache/cache.cjs.native.js +133 -152
  10. package/cache/core/cache.d.ts +10 -0
  11. package/cache/core/cache.js +17 -5
  12. package/cache/core/cache.js.map +1 -1
  13. package/cache/core/types/Cache.d.ts +1 -1
  14. package/cache/core/types/Cache.js.map +1 -1
  15. package/cache/core/types/DataProxy.d.ts +92 -0
  16. package/cache/core/types/common.js +4 -1
  17. package/cache/core/types/common.js.map +1 -1
  18. package/cache/inmemory/entityStore.d.ts +1 -1
  19. package/cache/inmemory/entityStore.js +190 -29
  20. package/cache/inmemory/entityStore.js.map +1 -1
  21. package/cache/inmemory/fixPolyfills.js +9 -0
  22. package/cache/inmemory/fixPolyfills.js.map +1 -1
  23. package/cache/inmemory/fixPolyfills.native.js +12 -0
  24. package/cache/inmemory/fixPolyfills.native.js.map +1 -1
  25. package/cache/inmemory/fragmentRegistry.js +23 -12
  26. package/cache/inmemory/fragmentRegistry.js.map +1 -1
  27. package/cache/inmemory/helpers.js +20 -11
  28. package/cache/inmemory/helpers.js.map +1 -1
  29. package/cache/inmemory/inMemoryCache.js +161 -8
  30. package/cache/inmemory/inMemoryCache.js.map +1 -1
  31. package/cache/inmemory/key-extractor.js +72 -4
  32. package/cache/inmemory/key-extractor.js.map +1 -1
  33. package/cache/inmemory/object-canon.js +91 -3
  34. package/cache/inmemory/object-canon.js.map +1 -1
  35. package/cache/inmemory/policies.js +193 -43
  36. package/cache/inmemory/policies.js.map +1 -1
  37. package/cache/inmemory/reactiveVars.js +20 -2
  38. package/cache/inmemory/reactiveVars.js.map +1 -1
  39. package/cache/inmemory/readFromStore.d.ts +4 -0
  40. package/cache/inmemory/readFromStore.js +54 -9
  41. package/cache/inmemory/readFromStore.js.map +1 -1
  42. package/cache/inmemory/types.d.ts +28 -0
  43. package/cache/inmemory/types.js.map +1 -1
  44. package/cache/inmemory/writeToStore.js +152 -25
  45. package/cache/inmemory/writeToStore.js.map +1 -1
  46. package/config/jest/setup.js +2 -0
  47. package/config/jest/setup.js.map +1 -1
  48. package/core/ApolloClient.d.ts +264 -3
  49. package/core/ApolloClient.js +235 -7
  50. package/core/ApolloClient.js.map +1 -1
  51. package/core/LocalState.d.ts +4 -6
  52. package/core/LocalState.js +56 -18
  53. package/core/LocalState.js.map +1 -1
  54. package/core/ObservableQuery.d.ts +25 -0
  55. package/core/ObservableQuery.js +239 -30
  56. package/core/ObservableQuery.js.map +1 -1
  57. package/core/QueryInfo.d.ts +3 -3
  58. package/core/QueryInfo.js +116 -13
  59. package/core/QueryInfo.js.map +1 -1
  60. package/core/QueryManager.d.ts +4 -0
  61. package/core/QueryManager.js +229 -33
  62. package/core/QueryManager.js.map +1 -1
  63. package/core/core.cjs +112 -103
  64. package/core/core.cjs.map +1 -1
  65. package/core/core.cjs.native.js +112 -103
  66. package/core/equalByQuery.js +20 -1
  67. package/core/equalByQuery.js.map +1 -1
  68. package/core/index.d.ts +1 -1
  69. package/core/index.js +19 -0
  70. package/core/index.js.map +1 -1
  71. package/core/networkStatus.d.ts +39 -0
  72. package/core/networkStatus.js +39 -0
  73. package/core/networkStatus.js.map +1 -1
  74. package/core/types.d.ts +9 -0
  75. package/core/types.js.map +1 -1
  76. package/core/watchQueryOptions.d.ts +225 -1
  77. package/core/watchQueryOptions.js.map +1 -1
  78. package/dev/dev.cjs +5 -111
  79. package/dev/dev.cjs.map +1 -1
  80. package/dev/dev.cjs.native.js +5 -111
  81. package/dev/loadErrorMessageHandler.js.map +1 -1
  82. package/errors/errors.cjs +1 -1
  83. package/errors/errors.cjs.map +1 -1
  84. package/errors/errors.cjs.native.js +1 -1
  85. package/errors/index.js +14 -1
  86. package/errors/index.js.map +1 -1
  87. package/invariantErrorCodes.js +1 -0
  88. package/link/batch/batch.cjs +2 -2
  89. package/link/batch/batch.cjs.map +1 -1
  90. package/link/batch/batch.cjs.native.js +2 -2
  91. package/link/batch/batchLink.d.ts +21 -0
  92. package/link/batch/batchLink.js +2 -1
  93. package/link/batch/batchLink.js.map +1 -1
  94. package/link/batch/batching.js +24 -1
  95. package/link/batch/batching.js.map +1 -1
  96. package/link/batch-http/batch-http.cjs +3 -2
  97. package/link/batch-http/batch-http.cjs.map +1 -1
  98. package/link/batch-http/batch-http.cjs.native.js +3 -2
  99. package/link/batch-http/batchHttpLink.d.ts +4 -0
  100. package/link/batch-http/batchHttpLink.js +53 -2
  101. package/link/batch-http/batchHttpLink.js.map +1 -1
  102. package/link/context/context.cjs.map +1 -1
  103. package/link/context/index.js +1 -0
  104. package/link/context/index.js.map +1 -1
  105. package/link/core/ApolloLink.js +12 -5
  106. package/link/core/ApolloLink.js.map +1 -1
  107. package/link/core/core.cjs +5 -5
  108. package/link/core/core.cjs.map +1 -1
  109. package/link/core/core.cjs.native.js +5 -5
  110. package/link/error/error.cjs +1 -1
  111. package/link/error/error.cjs.map +1 -1
  112. package/link/error/error.cjs.native.js +1 -1
  113. package/link/error/index.d.ts +3 -0
  114. package/link/error/index.js +4 -1
  115. package/link/error/index.js.map +1 -1
  116. package/link/http/HttpLink.d.ts +0 -2
  117. package/link/http/HttpLink.js +1 -1
  118. package/link/http/HttpLink.js.map +1 -1
  119. package/link/http/checkFetcher.js.map +1 -1
  120. package/link/http/createHttpLink.js +23 -1
  121. package/link/http/createHttpLink.js.map +1 -1
  122. package/link/http/createSignalIfSupported.d.ts +5 -0
  123. package/link/http/createSignalIfSupported.js +5 -0
  124. package/link/http/createSignalIfSupported.js.map +1 -1
  125. package/link/http/http.cjs +14 -12
  126. package/link/http/http.cjs.map +1 -1
  127. package/link/http/http.cjs.native.js +14 -12
  128. package/link/http/index.js +2 -1
  129. package/link/http/index.js.map +1 -1
  130. package/link/http/iterators/async.d.ts +4 -0
  131. package/link/http/iterators/async.js +4 -0
  132. package/link/http/iterators/async.js.map +1 -1
  133. package/link/http/iterators/nodeStream.d.ts +4 -0
  134. package/link/http/iterators/nodeStream.js +4 -0
  135. package/link/http/iterators/nodeStream.js.map +1 -1
  136. package/link/http/iterators/promise.d.ts +4 -0
  137. package/link/http/iterators/promise.js +4 -0
  138. package/link/http/iterators/promise.js.map +1 -1
  139. package/link/http/iterators/reader.d.ts +4 -0
  140. package/link/http/iterators/reader.js +4 -0
  141. package/link/http/iterators/reader.js.map +1 -1
  142. package/link/http/parseAndCheckHttpResponse.js +51 -10
  143. package/link/http/parseAndCheckHttpResponse.js.map +1 -1
  144. package/link/http/responseIterator.d.ts +4 -0
  145. package/link/http/responseIterator.js +6 -0
  146. package/link/http/responseIterator.js.map +1 -1
  147. package/link/http/rewriteURIForGET.d.ts +1 -1
  148. package/link/http/rewriteURIForGET.js +10 -0
  149. package/link/http/rewriteURIForGET.js.map +1 -1
  150. package/link/http/selectHttpOptionsAndBody.d.ts +45 -0
  151. package/link/http/selectHttpOptionsAndBody.js +23 -0
  152. package/link/http/selectHttpOptionsAndBody.js.map +1 -1
  153. package/link/http/selectURI.js.map +1 -1
  154. package/link/http/serializeFetchParameter.js.map +1 -1
  155. package/link/persisted-queries/index.js +34 -4
  156. package/link/persisted-queries/index.js.map +1 -1
  157. package/link/persisted-queries/persisted-queries.cjs +4 -4
  158. package/link/persisted-queries/persisted-queries.cjs.map +1 -1
  159. package/link/persisted-queries/persisted-queries.cjs.native.js +4 -4
  160. package/link/remove-typename/remove-typename.cjs +12 -9
  161. package/link/remove-typename/remove-typename.cjs.map +1 -1
  162. package/link/remove-typename/remove-typename.cjs.native.js +12 -9
  163. package/link/remove-typename/removeTypenameFromVariables.js +12 -9
  164. package/link/remove-typename/removeTypenameFromVariables.js.map +1 -1
  165. package/link/retry/delayFunction.d.ts +29 -0
  166. package/link/retry/delayFunction.js +6 -0
  167. package/link/retry/delayFunction.js.map +1 -1
  168. package/link/retry/retry.cjs +5 -5
  169. package/link/retry/retry.cjs.map +1 -1
  170. package/link/retry/retry.cjs.native.js +5 -5
  171. package/link/retry/retryFunction.d.ts +20 -0
  172. package/link/retry/retryLink.d.ts +6 -0
  173. package/link/retry/retryLink.js +31 -6
  174. package/link/retry/retryLink.js.map +1 -1
  175. package/link/schema/index.d.ts +13 -0
  176. package/link/schema/index.js +3 -3
  177. package/link/schema/index.js.map +1 -1
  178. package/link/schema/schema.cjs +3 -3
  179. package/link/schema/schema.cjs.map +1 -1
  180. package/link/schema/schema.cjs.native.js +3 -3
  181. package/link/subscriptions/index.js +35 -2
  182. package/link/subscriptions/index.js.map +1 -1
  183. package/link/subscriptions/subscriptions.cjs +3 -2
  184. package/link/subscriptions/subscriptions.cjs.map +1 -1
  185. package/link/subscriptions/subscriptions.cjs.native.js +3 -2
  186. package/link/utils/createOperation.js.map +1 -1
  187. package/link/utils/filterOperationVariables.js +4 -0
  188. package/link/utils/filterOperationVariables.js.map +1 -1
  189. package/link/utils/toPromise.js.map +1 -1
  190. package/link/utils/transformOperation.js +3 -2
  191. package/link/utils/transformOperation.js.map +1 -1
  192. package/link/utils/utils.cjs +2 -2
  193. package/link/utils/utils.cjs.map +1 -1
  194. package/link/utils/utils.cjs.native.js +2 -2
  195. package/link/utils/validateOperation.js.map +1 -1
  196. package/link/ws/index.d.ts +12 -0
  197. package/link/ws/index.js +1 -1
  198. package/link/ws/index.js.map +1 -1
  199. package/link/ws/ws.cjs +1 -1
  200. package/link/ws/ws.cjs.map +1 -1
  201. package/link/ws/ws.cjs.native.js +1 -1
  202. package/package.json +49 -38
  203. package/react/cache/QueryReference.d.ts +6 -1
  204. package/react/cache/QueryReference.js +26 -1
  205. package/react/cache/QueryReference.js.map +1 -1
  206. package/react/cache/SuspenseCache.d.ts +10 -0
  207. package/react/cache/SuspenseCache.js +1 -1
  208. package/react/cache/SuspenseCache.js.map +1 -1
  209. package/react/cache/getSuspenseCache.js.map +1 -1
  210. package/react/context/ApolloContext.d.ts +5 -0
  211. package/react/context/ApolloContext.js +10 -3
  212. package/react/context/ApolloContext.js.map +1 -1
  213. package/react/context/context.cjs +1 -3
  214. package/react/context/context.cjs.map +1 -1
  215. package/react/context/context.cjs.native.js +1 -3
  216. package/react/hoc/graphql.js.map +1 -1
  217. package/react/hoc/hoc-utils.js +3 -1
  218. package/react/hoc/hoc-utils.js.map +1 -1
  219. package/react/hoc/hoc.cjs +9 -17
  220. package/react/hoc/hoc.cjs.map +1 -1
  221. package/react/hoc/hoc.cjs.native.js +9 -17
  222. package/react/hoc/mutation-hoc.js +9 -4
  223. package/react/hoc/mutation-hoc.js.map +1 -1
  224. package/react/hoc/query-hoc.js +10 -4
  225. package/react/hoc/query-hoc.js.map +1 -1
  226. package/react/hoc/subscription-hoc.js +10 -4
  227. package/react/hoc/subscription-hoc.js.map +1 -1
  228. package/react/hoc/withApollo.js +3 -4
  229. package/react/hoc/withApollo.js.map +1 -1
  230. package/react/hooks/hooks.cjs +30 -22
  231. package/react/hooks/hooks.cjs.map +1 -1
  232. package/react/hooks/hooks.cjs.native.js +30 -22
  233. package/react/hooks/internal/__use.js +5 -0
  234. package/react/hooks/internal/__use.js.map +1 -1
  235. package/react/hooks/internal/index.js +1 -0
  236. package/react/hooks/internal/index.js.map +1 -1
  237. package/react/hooks/internal/useDeepMemo.js.map +1 -1
  238. package/react/hooks/internal/useIsomorphicLayoutEffect.js +6 -3
  239. package/react/hooks/internal/useIsomorphicLayoutEffect.js.map +1 -1
  240. package/react/hooks/useBackgroundQuery.js +6 -0
  241. package/react/hooks/useBackgroundQuery.js.map +1 -1
  242. package/react/hooks/useFragment.js +4 -3
  243. package/react/hooks/useFragment.js.map +1 -1
  244. package/react/hooks/useLazyQuery.js +13 -4
  245. package/react/hooks/useLazyQuery.js.map +1 -1
  246. package/react/hooks/useMutation.js +8 -3
  247. package/react/hooks/useMutation.js.map +1 -1
  248. package/react/hooks/useQuery.d.ts +11 -0
  249. package/react/hooks/useQuery.js +137 -5
  250. package/react/hooks/useQuery.js.map +1 -1
  251. package/react/hooks/useReactiveVar.js +5 -0
  252. package/react/hooks/useReactiveVar.js.map +1 -1
  253. package/react/hooks/useReadQuery.d.ts +19 -0
  254. package/react/hooks/useReadQuery.js.map +1 -1
  255. package/react/hooks/useSubscription.js +5 -0
  256. package/react/hooks/useSubscription.js.map +1 -1
  257. package/react/hooks/useSuspenseQuery.js +11 -5
  258. package/react/hooks/useSuspenseQuery.js.map +1 -1
  259. package/react/hooks/useSyncExternalStore.js +53 -1
  260. package/react/hooks/useSyncExternalStore.js.map +1 -1
  261. package/react/parser/index.js +4 -5
  262. package/react/parser/index.js.map +1 -1
  263. package/react/parser/parser.cjs +2 -4
  264. package/react/parser/parser.cjs.map +1 -1
  265. package/react/parser/parser.cjs.native.js +2 -4
  266. package/react/ssr/RenderPromises.js +21 -1
  267. package/react/ssr/RenderPromises.js.map +1 -1
  268. package/react/ssr/getDataFromTree.js +18 -3
  269. package/react/ssr/getDataFromTree.js.map +1 -1
  270. package/react/ssr/ssr.cjs +6 -4
  271. package/react/ssr/ssr.cjs.map +1 -1
  272. package/react/ssr/ssr.cjs.native.js +6 -4
  273. package/react/types/types.d.ts +66 -0
  274. package/testing/core/core.cjs +14 -11
  275. package/testing/core/core.cjs.map +1 -1
  276. package/testing/core/core.cjs.native.js +14 -11
  277. package/testing/core/itAsync.d.ts +1 -1
  278. package/testing/core/itAsync.js.map +1 -1
  279. package/testing/core/mocking/mockFetch.d.ts +2 -2
  280. package/testing/core/mocking/mockFetch.js +8 -4
  281. package/testing/core/mocking/mockFetch.js.map +1 -1
  282. package/testing/core/mocking/mockLink.js +17 -7
  283. package/testing/core/mocking/mockLink.js.map +1 -1
  284. package/testing/core/mocking/mockQueryManager.js +2 -0
  285. package/testing/core/mocking/mockQueryManager.js.map +1 -1
  286. package/testing/core/mocking/mockSubscriptionLink.d.ts +1 -1
  287. package/testing/core/mocking/mockSubscriptionLink.js +1 -1
  288. package/testing/core/mocking/mockSubscriptionLink.js.map +1 -1
  289. package/testing/core/mocking/mockWatchQuery.js +1 -1
  290. package/testing/core/mocking/mockWatchQuery.js.map +1 -1
  291. package/testing/core/observableToPromise.d.ts +17 -3
  292. package/testing/core/observableToPromise.js +5 -0
  293. package/testing/core/observableToPromise.js.map +1 -1
  294. package/testing/core/subscribeAndCount.js +3 -0
  295. package/testing/core/subscribeAndCount.js.map +1 -1
  296. package/testing/core/wait.js +2 -2
  297. package/testing/core/wait.js.map +1 -1
  298. package/testing/core/withConsoleSpy.d.ts +3 -0
  299. package/testing/core/withConsoleSpy.js +7 -1
  300. package/testing/core/withConsoleSpy.js.map +1 -1
  301. package/testing/core/wrap.js +2 -0
  302. package/testing/core/wrap.js.map +1 -1
  303. package/testing/internal/ObservableStream.js +14 -14
  304. package/testing/internal/ObservableStream.js.map +1 -1
  305. package/testing/internal/disposables/spyOnConsole.d.ts +1 -0
  306. package/testing/internal/disposables/spyOnConsole.js +2 -0
  307. package/testing/internal/disposables/spyOnConsole.js.map +1 -1
  308. package/testing/internal/disposables/withCleanup.d.ts +1 -0
  309. package/testing/internal/disposables/withCleanup.js +3 -0
  310. package/testing/internal/disposables/withCleanup.js.map +1 -1
  311. package/testing/internal/profile/Render.d.ts +28 -0
  312. package/testing/internal/profile/Render.js +12 -1
  313. package/testing/internal/profile/Render.js.map +1 -1
  314. package/testing/internal/profile/profile.d.ts +44 -7
  315. package/testing/internal/profile/profile.js +63 -51
  316. package/testing/internal/profile/profile.js.map +1 -1
  317. package/testing/internal/profile/traces.d.ts +4 -0
  318. package/testing/internal/profile/traces.js +9 -5
  319. package/testing/internal/profile/traces.js.map +1 -1
  320. package/testing/matchers/ProfiledComponent.js +27 -22
  321. package/testing/matchers/ProfiledComponent.js.map +1 -1
  322. package/testing/matchers/toHaveSuspenseCacheEntryUsing.js.map +1 -1
  323. package/testing/matchers/toMatchDocument.js.map +1 -1
  324. package/testing/react/MockedProvider.d.ts +4 -0
  325. package/testing/react/MockedProvider.js +6 -2
  326. package/testing/react/MockedProvider.js.map +1 -1
  327. package/testing/testing.cjs +4 -2
  328. package/testing/testing.cjs.map +1 -1
  329. package/testing/testing.cjs.native.js +4 -2
  330. package/utilities/common/arrays.js +1 -0
  331. package/utilities/common/arrays.js.map +1 -1
  332. package/utilities/common/canUse.js +16 -1
  333. package/utilities/common/canUse.js.map +1 -1
  334. package/utilities/common/cloneDeep.d.ts +3 -0
  335. package/utilities/common/cloneDeep.js +5 -0
  336. package/utilities/common/cloneDeep.js.map +1 -1
  337. package/utilities/common/compact.d.ts +4 -0
  338. package/utilities/common/compact.js +4 -0
  339. package/utilities/common/compact.js.map +1 -1
  340. package/utilities/common/errorHandling.js +1 -3
  341. package/utilities/common/errorHandling.js.map +1 -1
  342. package/utilities/common/incrementalResult.js +3 -0
  343. package/utilities/common/incrementalResult.js.map +1 -1
  344. package/utilities/common/makeUniqueId.js +2 -0
  345. package/utilities/common/makeUniqueId.js.map +1 -1
  346. package/utilities/common/maybeDeepFreeze.js +3 -0
  347. package/utilities/common/maybeDeepFreeze.js.map +1 -1
  348. package/utilities/common/mergeDeep.js +12 -1
  349. package/utilities/common/mergeDeep.js.map +1 -1
  350. package/utilities/common/mergeOptions.d.ts +1 -1
  351. package/utilities/common/mergeOptions.js.map +1 -1
  352. package/utilities/common/omitDeep.js.map +1 -1
  353. package/utilities/globals/global.js +7 -1
  354. package/utilities/globals/global.js.map +1 -1
  355. package/utilities/globals/globals.cjs +4 -5
  356. package/utilities/globals/globals.cjs.map +1 -1
  357. package/utilities/globals/globals.cjs.native.js +4 -5
  358. package/utilities/globals/index.d.ts +4 -0
  359. package/utilities/globals/index.js +7 -0
  360. package/utilities/globals/index.js.map +1 -1
  361. package/utilities/globals/invariantWrappers.d.ts +40 -0
  362. package/utilities/globals/invariantWrappers.js +11 -3
  363. package/utilities/globals/invariantWrappers.js.map +1 -1
  364. package/utilities/globals/maybe.js.map +1 -1
  365. package/utilities/graphql/DocumentTransform.js +19 -6
  366. package/utilities/graphql/DocumentTransform.js.map +1 -1
  367. package/utilities/graphql/directives.js +3 -0
  368. package/utilities/graphql/directives.js.map +1 -1
  369. package/utilities/graphql/fragments.d.ts +25 -0
  370. package/utilities/graphql/fragments.js +36 -0
  371. package/utilities/graphql/fragments.js.map +1 -1
  372. package/utilities/graphql/getFromAST.d.ts +5 -0
  373. package/utilities/graphql/getFromAST.js +9 -0
  374. package/utilities/graphql/getFromAST.js.map +1 -1
  375. package/utilities/graphql/print.js.map +1 -1
  376. package/utilities/graphql/storeUtils.d.ts +14 -0
  377. package/utilities/graphql/storeUtils.js +7 -2
  378. package/utilities/graphql/storeUtils.js.map +1 -1
  379. package/utilities/graphql/transform.js +106 -7
  380. package/utilities/graphql/transform.js.map +1 -1
  381. package/utilities/observables/Concast.d.ts +1 -1
  382. package/utilities/observables/Concast.js +84 -1
  383. package/utilities/observables/Concast.js.map +1 -1
  384. package/utilities/observables/Observable.js +6 -0
  385. package/utilities/observables/Observable.js.map +1 -1
  386. package/utilities/observables/asyncMap.js +12 -3
  387. package/utilities/observables/asyncMap.js.map +1 -1
  388. package/utilities/observables/iteration.js +3 -0
  389. package/utilities/observables/iteration.js.map +1 -1
  390. package/utilities/observables/subclassing.js +14 -0
  391. package/utilities/observables/subclassing.js.map +1 -1
  392. package/utilities/policies/pagination.js +47 -3
  393. package/utilities/policies/pagination.js.map +1 -1
  394. package/utilities/promises/decoration.js +1 -0
  395. package/utilities/promises/decoration.js.map +1 -1
  396. package/utilities/types/DeepOmit.js.map +1 -1
  397. package/utilities/types/DeepPartial.d.ts +1 -1
  398. package/utilities/types/DeepPartial.js +4 -0
  399. package/utilities/types/DeepPartial.js.map +1 -1
  400. package/utilities/types/IsStrictlyAny.js.map +1 -1
  401. package/utilities/types/TODO.d.ts +3 -0
  402. package/utilities/types/TODO.js +2 -0
  403. package/utilities/types/TODO.js.map +1 -0
  404. package/utilities/utilities.cjs +31 -27
  405. package/utilities/utilities.cjs.map +1 -1
  406. package/utilities/utilities.cjs.native.js +31 -27
  407. package/version.js +1 -1
  408. package/cache/core/cache.d.ts.map +0 -1
  409. package/cache/core/types/Cache.d.ts.map +0 -1
  410. package/cache/core/types/DataProxy.d.ts.map +0 -1
  411. package/cache/core/types/common.d.ts.map +0 -1
  412. package/cache/index.d.ts.map +0 -1
  413. package/cache/inmemory/entityStore.d.ts.map +0 -1
  414. package/cache/inmemory/fixPolyfills.d.ts.map +0 -1
  415. package/cache/inmemory/fixPolyfills.native.d.ts.map +0 -1
  416. package/cache/inmemory/fragmentRegistry.d.ts.map +0 -1
  417. package/cache/inmemory/helpers.d.ts.map +0 -1
  418. package/cache/inmemory/inMemoryCache.d.ts.map +0 -1
  419. package/cache/inmemory/key-extractor.d.ts.map +0 -1
  420. package/cache/inmemory/object-canon.d.ts.map +0 -1
  421. package/cache/inmemory/policies.d.ts.map +0 -1
  422. package/cache/inmemory/reactiveVars.d.ts.map +0 -1
  423. package/cache/inmemory/readFromStore.d.ts.map +0 -1
  424. package/cache/inmemory/types.d.ts.map +0 -1
  425. package/cache/inmemory/writeToStore.d.ts.map +0 -1
  426. package/config/jest/setup.d.ts.map +0 -1
  427. package/core/ApolloClient.d.ts.map +0 -1
  428. package/core/LocalState.d.ts.map +0 -1
  429. package/core/ObservableQuery.d.ts.map +0 -1
  430. package/core/QueryInfo.d.ts.map +0 -1
  431. package/core/QueryManager.d.ts.map +0 -1
  432. package/core/equalByQuery.d.ts.map +0 -1
  433. package/core/index.d.ts.map +0 -1
  434. package/core/networkStatus.d.ts.map +0 -1
  435. package/core/types.d.ts.map +0 -1
  436. package/core/watchQueryOptions.d.ts.map +0 -1
  437. package/dev/index.d.ts.map +0 -1
  438. package/dev/loadDevMessages.d.ts.map +0 -1
  439. package/dev/loadErrorMessageHandler.d.ts.map +0 -1
  440. package/dev/loadErrorMessages.d.ts.map +0 -1
  441. package/errors/index.d.ts.map +0 -1
  442. package/index.d.ts.map +0 -1
  443. package/invariantErrorCodes.d.ts.map +0 -1
  444. package/link/batch/batchLink.d.ts.map +0 -1
  445. package/link/batch/batching.d.ts.map +0 -1
  446. package/link/batch/index.d.ts.map +0 -1
  447. package/link/batch-http/batchHttpLink.d.ts.map +0 -1
  448. package/link/batch-http/index.d.ts.map +0 -1
  449. package/link/context/index.d.ts.map +0 -1
  450. package/link/core/ApolloLink.d.ts.map +0 -1
  451. package/link/core/concat.d.ts.map +0 -1
  452. package/link/core/empty.d.ts.map +0 -1
  453. package/link/core/execute.d.ts.map +0 -1
  454. package/link/core/from.d.ts.map +0 -1
  455. package/link/core/index.d.ts.map +0 -1
  456. package/link/core/split.d.ts.map +0 -1
  457. package/link/core/types.d.ts.map +0 -1
  458. package/link/error/index.d.ts.map +0 -1
  459. package/link/http/HttpLink.d.ts.map +0 -1
  460. package/link/http/checkFetcher.d.ts.map +0 -1
  461. package/link/http/createHttpLink.d.ts.map +0 -1
  462. package/link/http/createSignalIfSupported.d.ts.map +0 -1
  463. package/link/http/index.d.ts.map +0 -1
  464. package/link/http/iterators/async.d.ts.map +0 -1
  465. package/link/http/iterators/nodeStream.d.ts.map +0 -1
  466. package/link/http/iterators/promise.d.ts.map +0 -1
  467. package/link/http/iterators/reader.d.ts.map +0 -1
  468. package/link/http/parseAndCheckHttpResponse.d.ts.map +0 -1
  469. package/link/http/responseIterator.d.ts.map +0 -1
  470. package/link/http/rewriteURIForGET.d.ts.map +0 -1
  471. package/link/http/selectHttpOptionsAndBody.d.ts.map +0 -1
  472. package/link/http/selectURI.d.ts.map +0 -1
  473. package/link/http/serializeFetchParameter.d.ts.map +0 -1
  474. package/link/persisted-queries/index.d.ts.map +0 -1
  475. package/link/remove-typename/index.d.ts.map +0 -1
  476. package/link/remove-typename/removeTypenameFromVariables.d.ts.map +0 -1
  477. package/link/retry/delayFunction.d.ts.map +0 -1
  478. package/link/retry/index.d.ts.map +0 -1
  479. package/link/retry/retryFunction.d.ts.map +0 -1
  480. package/link/retry/retryLink.d.ts.map +0 -1
  481. package/link/schema/index.d.ts.map +0 -1
  482. package/link/subscriptions/index.d.ts.map +0 -1
  483. package/link/utils/createOperation.d.ts.map +0 -1
  484. package/link/utils/filterOperationVariables.d.ts.map +0 -1
  485. package/link/utils/fromError.d.ts.map +0 -1
  486. package/link/utils/fromPromise.d.ts.map +0 -1
  487. package/link/utils/index.d.ts.map +0 -1
  488. package/link/utils/throwServerError.d.ts.map +0 -1
  489. package/link/utils/toPromise.d.ts.map +0 -1
  490. package/link/utils/transformOperation.d.ts.map +0 -1
  491. package/link/utils/validateOperation.d.ts.map +0 -1
  492. package/link/ws/index.d.ts.map +0 -1
  493. package/react/cache/QueryReference.d.ts.map +0 -1
  494. package/react/cache/SuspenseCache.d.ts.map +0 -1
  495. package/react/cache/getSuspenseCache.d.ts.map +0 -1
  496. package/react/cache/index.d.ts.map +0 -1
  497. package/react/cache/types.d.ts.map +0 -1
  498. package/react/components/Mutation.d.ts.map +0 -1
  499. package/react/components/Query.d.ts.map +0 -1
  500. package/react/components/Subscription.d.ts.map +0 -1
  501. package/react/components/index.d.ts.map +0 -1
  502. package/react/components/types.d.ts.map +0 -1
  503. package/react/context/ApolloConsumer.d.ts.map +0 -1
  504. package/react/context/ApolloContext.d.ts.map +0 -1
  505. package/react/context/ApolloProvider.d.ts.map +0 -1
  506. package/react/context/index.d.ts.map +0 -1
  507. package/react/hoc/graphql.d.ts.map +0 -1
  508. package/react/hoc/hoc-utils.d.ts.map +0 -1
  509. package/react/hoc/index.d.ts.map +0 -1
  510. package/react/hoc/mutation-hoc.d.ts.map +0 -1
  511. package/react/hoc/query-hoc.d.ts.map +0 -1
  512. package/react/hoc/subscription-hoc.d.ts.map +0 -1
  513. package/react/hoc/types.d.ts.map +0 -1
  514. package/react/hoc/withApollo.d.ts.map +0 -1
  515. package/react/hooks/constants.d.ts.map +0 -1
  516. package/react/hooks/index.d.ts.map +0 -1
  517. package/react/hooks/internal/__use.d.ts.map +0 -1
  518. package/react/hooks/internal/index.d.ts.map +0 -1
  519. package/react/hooks/internal/useDeepMemo.d.ts.map +0 -1
  520. package/react/hooks/internal/useIsomorphicLayoutEffect.d.ts.map +0 -1
  521. package/react/hooks/useApolloClient.d.ts.map +0 -1
  522. package/react/hooks/useBackgroundQuery.d.ts.map +0 -1
  523. package/react/hooks/useFragment.d.ts.map +0 -1
  524. package/react/hooks/useLazyQuery.d.ts.map +0 -1
  525. package/react/hooks/useMutation.d.ts.map +0 -1
  526. package/react/hooks/useQuery.d.ts.map +0 -1
  527. package/react/hooks/useReactiveVar.d.ts.map +0 -1
  528. package/react/hooks/useReadQuery.d.ts.map +0 -1
  529. package/react/hooks/useSubscription.d.ts.map +0 -1
  530. package/react/hooks/useSuspenseQuery.d.ts.map +0 -1
  531. package/react/hooks/useSyncExternalStore.d.ts.map +0 -1
  532. package/react/index.d.ts.map +0 -1
  533. package/react/parser/index.d.ts.map +0 -1
  534. package/react/ssr/RenderPromises.d.ts.map +0 -1
  535. package/react/ssr/getDataFromTree.d.ts.map +0 -1
  536. package/react/ssr/index.d.ts.map +0 -1
  537. package/react/ssr/renderToStringWithData.d.ts.map +0 -1
  538. package/react/types/types.d.ts.map +0 -1
  539. package/testing/core/index.d.ts.map +0 -1
  540. package/testing/core/itAsync.d.ts.map +0 -1
  541. package/testing/core/mocking/mockClient.d.ts.map +0 -1
  542. package/testing/core/mocking/mockFetch.d.ts.map +0 -1
  543. package/testing/core/mocking/mockLink.d.ts.map +0 -1
  544. package/testing/core/mocking/mockQueryManager.d.ts.map +0 -1
  545. package/testing/core/mocking/mockSubscriptionLink.d.ts.map +0 -1
  546. package/testing/core/mocking/mockWatchQuery.d.ts.map +0 -1
  547. package/testing/core/observableToPromise.d.ts.map +0 -1
  548. package/testing/core/subscribeAndCount.d.ts.map +0 -1
  549. package/testing/core/wait.d.ts.map +0 -1
  550. package/testing/core/withConsoleSpy.d.ts.map +0 -1
  551. package/testing/core/wrap.d.ts.map +0 -1
  552. package/testing/index.d.ts.map +0 -1
  553. package/testing/internal/ObservableStream.d.ts.map +0 -1
  554. package/testing/internal/disposables/index.d.ts.map +0 -1
  555. package/testing/internal/disposables/spyOnConsole.d.ts.map +0 -1
  556. package/testing/internal/disposables/withCleanup.d.ts.map +0 -1
  557. package/testing/internal/index.d.ts.map +0 -1
  558. package/testing/internal/profile/Render.d.ts.map +0 -1
  559. package/testing/internal/profile/index.d.ts.map +0 -1
  560. package/testing/internal/profile/profile.d.ts.map +0 -1
  561. package/testing/internal/profile/traces.d.ts.map +0 -1
  562. package/testing/matchers/ProfiledComponent.d.ts.map +0 -1
  563. package/testing/matchers/index.d.ts.map +0 -1
  564. package/testing/matchers/toHaveSuspenseCacheEntryUsing.d.ts.map +0 -1
  565. package/testing/matchers/toMatchDocument.d.ts.map +0 -1
  566. package/testing/react/MockedProvider.d.ts.map +0 -1
  567. package/utilities/common/arrays.d.ts.map +0 -1
  568. package/utilities/common/canUse.d.ts.map +0 -1
  569. package/utilities/common/cloneDeep.d.ts.map +0 -1
  570. package/utilities/common/compact.d.ts.map +0 -1
  571. package/utilities/common/errorHandling.d.ts.map +0 -1
  572. package/utilities/common/filterInPlace.d.ts +0 -2
  573. package/utilities/common/filterInPlace.d.ts.map +0 -1
  574. package/utilities/common/filterInPlace.js +0 -11
  575. package/utilities/common/filterInPlace.js.map +0 -1
  576. package/utilities/common/incrementalResult.d.ts.map +0 -1
  577. package/utilities/common/makeUniqueId.d.ts.map +0 -1
  578. package/utilities/common/maybeDeepFreeze.d.ts.map +0 -1
  579. package/utilities/common/mergeDeep.d.ts.map +0 -1
  580. package/utilities/common/mergeOptions.d.ts.map +0 -1
  581. package/utilities/common/objects.d.ts.map +0 -1
  582. package/utilities/common/omitDeep.d.ts.map +0 -1
  583. package/utilities/common/stringifyForDisplay.d.ts.map +0 -1
  584. package/utilities/common/stripTypename.d.ts.map +0 -1
  585. package/utilities/globals/global.d.ts.map +0 -1
  586. package/utilities/globals/index.d.ts.map +0 -1
  587. package/utilities/globals/invariantWrappers.d.ts.map +0 -1
  588. package/utilities/globals/maybe.d.ts.map +0 -1
  589. package/utilities/graphql/DocumentTransform.d.ts.map +0 -1
  590. package/utilities/graphql/directives.d.ts.map +0 -1
  591. package/utilities/graphql/fragments.d.ts.map +0 -1
  592. package/utilities/graphql/getFromAST.d.ts.map +0 -1
  593. package/utilities/graphql/operations.d.ts.map +0 -1
  594. package/utilities/graphql/print.d.ts.map +0 -1
  595. package/utilities/graphql/storeUtils.d.ts.map +0 -1
  596. package/utilities/graphql/transform.d.ts.map +0 -1
  597. package/utilities/index.d.ts.map +0 -1
  598. package/utilities/observables/Concast.d.ts.map +0 -1
  599. package/utilities/observables/Observable.d.ts.map +0 -1
  600. package/utilities/observables/asyncMap.d.ts.map +0 -1
  601. package/utilities/observables/iteration.d.ts.map +0 -1
  602. package/utilities/observables/subclassing.d.ts.map +0 -1
  603. package/utilities/policies/pagination.d.ts.map +0 -1
  604. package/utilities/promises/decoration.d.ts.map +0 -1
  605. package/utilities/types/DeepOmit.d.ts.map +0 -1
  606. package/utilities/types/DeepPartial.d.ts.map +0 -1
  607. package/utilities/types/IsStrictlyAny.d.ts.map +0 -1
  608. package/utilities/types/Primitive.d.ts.map +0 -1
  609. package/version.d.ts.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"pagination.js","sourceRoot":"","sources":["../../../src/utilities/policies/pagination.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAG/B,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAMnD,MAAM,UAAU,gBAAgB,CAC9B,OAAwB;IAAxB,wBAAA,EAAA,eAAwB;IAExB,OAAO;QACL,OAAO,SAAA;QACP,KAAK,YAAC,QAAQ,EAAE,QAAQ;YACtB,OAAO,QAAQ,CAAC,CAAC,iCAAK,QAAQ,SAAK,QAAQ,QAAE,CAAC,CAAC,QAAQ,CAAC;QAC1D,CAAC;KACF,C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AC,KAAK,WAAW;wBAAE,QAAQ,CAAC,WAAW,GAAG,WAAW,CAAC;oBAC/D,IAAI,KAAK,CAAC,KAAK,SAAS;wBAAE,QAAQ,CAAC,SAAS,GAAG,SAAS,CAAC;iBAC1D;aACF;YAED,sCACK,SAAS,CAAC,QAAQ,CAAC,GACnB,SAAS,CAAC,QAAQ,CAAC,KACtB,KAAK,OAAA,EACL,QAAQ,UAAA,IACR;QACJ,CAAC;KACF,CAAC;AACJ,CAAC;AAGD,IAAM,SAAS,GAAG,UAAC,GAAwB,IAAK,OAAA,MAAM,CAAC,GAAG,EAAE,SAAS,CAAC,EAAtB,CAAsB,CAAC;AACvE,IAAM,SAAS,GAAG,CAAC,OAAO,EAAE,UAAU,CAAC,CAAC;AAExC,SAAS,aAAa;IACpB,OAAO;QACL,KAAK,EAAE,EAAE;QACT,QAAQ,EAAE;YACR,eAAe,EAAE,KAAK;YACtB,WAAW,EAAE,IAAI;YACjB,WAAW,EAAE,EAAE;YACf,SAAS,EAAE,EAAE;SACd;KACF,CAAC;AACJ,CAAC","sourcesContent":["import { __rest } from \"tslib\";\n\nimport type { FieldPolicy, Reference } from \"../../cache/index.js\";\nimport { mergeDeep } from \"../common/mergeDeep.js\";\n\ntype KeyArgs = FieldPolicy<any>[\"keyArgs\"];\n\n// A very basic pagination field policy that always concatenates new\n// results onto the existing array, without examining options.args.\nexport function concatPagination<T = Reference>(\n keyArgs: KeyArgs = false\n): FieldPolicy<T[]> {\n return {\n keyArgs,\n merge(existing, incoming) {\n return existing ? [...existing, ...incoming] : incoming;\n },\n };\n}\n\n// A basic field policy that uses options.args.{offset,limit} to splice\n// the incoming data into the existing array. If your arguments are called\n// something different (like args.{start,count}), feel free to copy/paste\n// this implementation and make the appropriate changes.\nexport function offsetLimitPagination<T = Reference>(\n keyArgs: KeyArgs = false\n): FieldPolicy<T[]> {\n return {\n keyArgs,\n merge(existing, incoming, { args }) {\n const merged = existing ? existing.slice(0) : [];\n\n if (incoming) {\n if (args) {\n // Assume an offset of 0 if args.offset omitted.\n const { offset = 0 } = args;\n for (let i = 0; i < incoming.length; ++i) {\n merged[offset + i] = incoming[i];\n }\n } else {\n // It's unusual (probably a mistake) for a paginated field not\n // to receive any arguments, so you might prefer to throw an\n // exception here, instead of recovering by appending incoming\n // onto the existing array.\n merged.push.apply(merged, incoming);\n }\n }\n\n return merged;\n },\n };\n}\n\n// Whether TRelayEdge<TNode> is a normalized Reference or a non-normalized\n// object, it needs a .cursor property where the relayStylePagination\n// merge function can store cursor strings taken from pageInfo. Storing an\n// extra reference.cursor property should be safe, and is easier than\n// attempting to update the cursor field of the normalized StoreObject\n// that the reference refers to, or managing edge wrapper objects\n// (something I attempted in #7023, but abandoned because of #7088).\nexport type TRelayEdge<TNode> =\n | {\n cursor?: string;\n node: TNode;\n }\n | (Reference & { cursor?: string });\n\nexport type TRelayPageInfo = {\n hasPreviousPage: boolean;\n hasNextPage: boolean;\n startCursor: string;\n endCursor: string;\n};\n\nexport type TExistingRelay<TNode> = Readonly<{\n edges: TRelayEdge<TNode>[];\n pageInfo: TRelayPageInfo;\n}>;\n\nexport type TIncomingRelay<TNode> = {\n edges?: TRelayEdge<TNode>[];\n pageInfo?: TRelayPageInfo;\n};\n\nexport type RelayFieldPolicy<TNode> = FieldPolicy<\n TExistingRelay<TNode> | null,\n TIncomingRelay<TNode> | null,\n TIncomingRelay<TNode> | null\n>;\n\n// As proof of the flexibility of field policies, this function generates\n// one that handles Relay-style pagination, without Apollo Client knowing\n// anything about connections, edges, cursors, or pageInfo objects.\nexport function relayStylePagination<TNode extends Reference = Reference>(\n keyArgs: KeyArgs = false\n): RelayFieldPolicy<TNode> {\n return {\n keyArgs,\n\n read(existing, { canRead, readField }) {\n if (!existing) return existing;\n\n const edges: TRelayEdge<TNode>[] = [];\n let firstEdgeCursor = \"\";\n let lastEdgeCursor = \"\";\n existing.edges.forEach((edge) => {\n // Edges themselves could be Reference objects, so it's important\n // to use readField to access the edge.edge.node property.\n if (canRead(readField(\"node\", edge))) {\n edges.push(edge);\n if (edge.cursor) {\n firstEdgeCursor = firstEdgeCursor || edge.cursor || \"\";\n lastEdgeCursor = edge.cursor || lastEdgeCursor;\n }\n }\n });\n\n if (edges.length > 1 && firstEdgeCursor === lastEdgeCursor) {\n firstEdgeCursor = \"\";\n }\n\n const { startCursor, endCursor } = existing.pageInfo || {};\n\n return {\n // Some implementations return additional Connection fields, such\n // as existing.totalCount. These fields are saved by the merge\n // function, so the read function should also preserve them.\n ...getExtras(existing),\n edges,\n pageInfo: {\n ...existing.pageInfo,\n // If existing.pageInfo.{start,end}Cursor are undefined or \"\", default\n // to firstEdgeCursor and/or lastEdgeCursor.\n startCursor: startCursor || firstEdgeCursor,\n endCursor: endCursor || lastEdgeCursor,\n },\n };\n },\n\n merge(existing, incoming, { args, isReference, readField }) {\n if (!existing) {\n existing = makeEmptyData();\n }\n\n if (!incoming) {\n return existing;\n }\n\n const incomingEdges = incoming.edges\n ? incoming.edges.map((edge) => {\n if (isReference((edge = { ...edge }))) {\n // In case edge is a Reference, we read out its cursor field and\n // store it as an extra property of the Reference object.\n edge.cursor = readField<string>(\"cursor\", edge);\n }\n return edge;\n })\n : [];\n\n if (incoming.pageInfo) {\n const { pageInfo } = incoming;\n const { startCursor, endCursor } = pageInfo;\n const firstEdge = incomingEdges[0];\n const lastEdge = incomingEdges[incomingEdges.length - 1];\n // In case we did not request the cursor field for edges in this\n // query, we can still infer cursors from pageInfo.\n if (firstEdge && startCursor) {\n firstEdge.cursor = startCursor;\n }\n if (lastEdge && endCursor) {\n lastEdge.cursor = endCursor;\n }\n // Cursors can also come from edges, so we default\n // pageInfo.{start,end}Cursor to {first,last}Edge.cursor.\n const firstCursor = firstEdge && firstEdge.cursor;\n if (firstCursor && !startCursor) {\n incoming = mergeDeep(incoming, {\n pageInfo: {\n startCursor: firstCursor,\n },\n });\n }\n const lastCursor = lastEdge && lastEdge.cursor;\n if (lastCursor && !endCursor) {\n incoming = mergeDeep(incoming, {\n pageInfo: {\n endCursor: lastCursor,\n },\n });\n }\n }\n\n let prefix = existing.edges;\n let suffix: typeof prefix = [];\n\n if (args && args.after) {\n // This comparison does not need to use readField(\"cursor\", edge),\n // because we stored the cursor field of any Reference edges as an\n // extra property of the Reference object.\n const index = prefix.findIndex((edge) => edge.cursor === args.after);\n if (index >= 0) {\n prefix = prefix.slice(0, index + 1);\n // suffix = []; // already true\n }\n } else if (args && args.before) {\n const index = prefix.findIndex((edge) => edge.cursor === args.before);\n suffix = index < 0 ? prefix : prefix.slice(index);\n prefix = [];\n } else if (incoming.edges) {\n // If we have neither args.after nor args.before, the incoming\n // edges cannot be spliced into the existing edges, so they must\n // replace the existing edges. See #6592 for a motivating example.\n prefix = [];\n }\n\n const edges = [...prefix, ...incomingEdges, ...suffix];\n\n const pageInfo: TRelayPageInfo = {\n // The ordering of these two ...spreads may be surprising, but it\n // makes sense because we want to combine PageInfo properties with a\n // preference for existing values, *unless* the existing values are\n // overridden by the logic below, which is permitted only when the\n // incoming page falls at the beginning or end of the data.\n ...incoming.pageInfo,\n ...existing.pageInfo,\n };\n\n if (incoming.pageInfo) {\n const {\n hasPreviousPage,\n hasNextPage,\n startCursor,\n endCursor,\n ...extras\n } = incoming.pageInfo;\n\n // If incoming.pageInfo had any extra non-standard properties,\n // assume they should take precedence over any existing properties\n // of the same name, regardless of where this page falls with\n // respect to the existing data.\n Object.assign(pageInfo, extras);\n\n // Keep existing.pageInfo.has{Previous,Next}Page unless the\n // placement of the incoming edges means incoming.hasPreviousPage\n // or incoming.hasNextPage should become the new values for those\n // properties in existing.pageInfo. Note that these updates are\n // only permitted when the beginning or end of the incoming page\n // coincides with the beginning or end of the existing data, as\n // determined using prefix.length and suffix.length.\n if (!prefix.length) {\n if (void 0 !== hasPreviousPage)\n pageInfo.hasPreviousPage = hasPreviousPage;\n if (void 0 !== startCursor) pageInfo.startCursor = startCursor;\n }\n if (!suffix.length) {\n if (void 0 !== hasNextPage) pageInfo.hasNextPage = hasNextPage;\n if (void 0 !== endCursor) pageInfo.endCursor = endCursor;\n }\n }\n\n return {\n ...getExtras(existing),\n ...getExtras(incoming),\n edges,\n pageInfo,\n };\n },\n };\n}\n\n// Returns any unrecognized properties of the given object.\nconst getExtras = (obj: Record<string, any>) => __rest(obj, notExtras);\nconst notExtras = [\"edges\", \"pageInfo\"];\n\nfunction makeEmptyData(): TExistingRelay<any> {\n return {\n edges: [],\n pageInfo: {\n hasPreviousPage: false,\n hasNextPage: true,\n startCursor: \"\",\n endCursor: \"\",\n },\n };\n}\n"]}
1
+ {"version":3,"file":"pagination.js","sourceRoot":"","sources":["../../../src/utilities/policies/pagination.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAG/B,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAInD,oEAAoE;AACpE,mEAAmE;AACnE,MAAM,UAAU,gBAAgB,CAC9B,OAAwB;IAAxB,wBAAA,EAAA,eAAwB;IAExB,OAAO;QACL,OAAO,SAAA;QACP,KAAK,YAAC,QAAQ,EAAE,QAAQ;YACtB,OAAO,QAAQ,CAAC,CAAC,iCAAK,QAAQ,SAAK,QAAQ,QAAE,CAAC,CAAC,QAAQ,CAAC;QAC1D,CAAC;KACF,CAAC;AACJ,CAAC;AAED,uEAAuE;AACvE,0EAA0E;AAC1E,yEAAyE;AACzE,wDAAwD;AACxD,MAAM,UAAU,qBAAqB,CACnC,OAAwB;IAAxB,wBAAA,EAAA,eAAwB;IAExB,OAAO;QACL,OAAO,SAAA;QACP,KAAK,YAAC,QAAQ,EAAE,QAAQ,EAAE,EAAQ;gBAAN,IAAI,UAAA;YAC9B,IAAM,MAAM,GAAG,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;YAEjD,IAAI,QAAQ,EAAE,CAAC;gBACb,IAAI,IAAI,EAAE,CAAC;oBACT,gDAAgD;oBACxC,IAAA,KAA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hC,2DAA2D;gBAC3D,iEAAiE;gBACjE,iEAAiE;gBACjE,+DAA+D;gBAC/D,gEAAgE;gBAChE,+DAA+D;gBAC/D,oDAAoD;gBACpD,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC;oBACnB,IAAI,KAAK,CAAC,KAAK,eAAe;wBAC5B,QAAQ,CAAC,eAAe,GAAG,eAAe,CAAC;oBAC7C,IAAI,KAAK,CAAC,KAAK,WAAW;wBAAE,QAAQ,CAAC,WAAW,GAAG,WAAW,CAAC;gBACjE,CAAC;gBACD,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC;oBACnB,IAAI,KAAK,CAAC,KAAK,WAAW;wBAAE,QAAQ,CAAC,WAAW,GAAG,WAAW,CAAC;oBAC/D,IAAI,KAAK,CAAC,KAAK,SAAS;wBAAE,QAAQ,CAAC,SAAS,GAAG,SAAS,CAAC;gBAC3D,CAAC;YACH,CAAC;YAED,sCACK,SAAS,CAAC,QAAQ,CAAC,GACnB,SAAS,CAAC,QAAQ,CAAC,KACtB,KAAK,OAAA,EACL,QAAQ,UAAA,IACR;QACJ,CAAC;KACF,CAAC;AACJ,CAAC;AAED,2DAA2D;AAC3D,IAAM,SAAS,GAAG,UAAC,GAAwB,IAAK,OAAA,MAAM,CAAC,GAAG,EAAE,SAAS,CAAC,EAAtB,CAAsB,CAAC;AACvE,IAAM,SAAS,GAAG,CAAC,OAAO,EAAE,UAAU,CAAC,CAAC;AAExC,SAAS,aAAa;IACpB,OAAO;QACL,KAAK,EAAE,EAAE;QACT,QAAQ,EAAE;YACR,eAAe,EAAE,KAAK;YACtB,WAAW,EAAE,IAAI;YACjB,WAAW,EAAE,EAAE;YACf,SAAS,EAAE,EAAE;SACd;KACF,CAAC;AACJ,CAAC","sourcesContent":["import { __rest } from \"tslib\";\n\nimport type { FieldPolicy, Reference } from \"../../cache/index.js\";\nimport { mergeDeep } from \"../common/mergeDeep.js\";\n\ntype KeyArgs = FieldPolicy<any>[\"keyArgs\"];\n\n// A very basic pagination field policy that always concatenates new\n// results onto the existing array, without examining options.args.\nexport function concatPagination<T = Reference>(\n keyArgs: KeyArgs = false\n): FieldPolicy<T[]> {\n return {\n keyArgs,\n merge(existing, incoming) {\n return existing ? [...existing, ...incoming] : incoming;\n },\n };\n}\n\n// A basic field policy that uses options.args.{offset,limit} to splice\n// the incoming data into the existing array. If your arguments are called\n// something different (like args.{start,count}), feel free to copy/paste\n// this implementation and make the appropriate changes.\nexport function offsetLimitPagination<T = Reference>(\n keyArgs: KeyArgs = false\n): FieldPolicy<T[]> {\n return {\n keyArgs,\n merge(existing, incoming, { args }) {\n const merged = existing ? existing.slice(0) : [];\n\n if (incoming) {\n if (args) {\n // Assume an offset of 0 if args.offset omitted.\n const { offset = 0 } = args;\n for (let i = 0; i < incoming.length; ++i) {\n merged[offset + i] = incoming[i];\n }\n } else {\n // It's unusual (probably a mistake) for a paginated field not\n // to receive any arguments, so you might prefer to throw an\n // exception here, instead of recovering by appending incoming\n // onto the existing array.\n merged.push(...incoming);\n }\n }\n\n return merged;\n },\n };\n}\n\n// Whether TRelayEdge<TNode> is a normalized Reference or a non-normalized\n// object, it needs a .cursor property where the relayStylePagination\n// merge function can store cursor strings taken from pageInfo. Storing an\n// extra reference.cursor property should be safe, and is easier than\n// attempting to update the cursor field of the normalized StoreObject\n// that the reference refers to, or managing edge wrapper objects\n// (something I attempted in #7023, but abandoned because of #7088).\nexport type TRelayEdge<TNode> =\n | {\n cursor?: string;\n node: TNode;\n }\n | (Reference & { cursor?: string });\n\nexport type TRelayPageInfo = {\n hasPreviousPage: boolean;\n hasNextPage: boolean;\n startCursor: string;\n endCursor: string;\n};\n\nexport type TExistingRelay<TNode> = Readonly<{\n edges: TRelayEdge<TNode>[];\n pageInfo: TRelayPageInfo;\n}>;\n\nexport type TIncomingRelay<TNode> = {\n edges?: TRelayEdge<TNode>[];\n pageInfo?: TRelayPageInfo;\n};\n\nexport type RelayFieldPolicy<TNode> = FieldPolicy<\n TExistingRelay<TNode> | null,\n TIncomingRelay<TNode> | null,\n TIncomingRelay<TNode> | null\n>;\n\n// As proof of the flexibility of field policies, this function generates\n// one that handles Relay-style pagination, without Apollo Client knowing\n// anything about connections, edges, cursors, or pageInfo objects.\nexport function relayStylePagination<TNode extends Reference = Reference>(\n keyArgs: KeyArgs = false\n): RelayFieldPolicy<TNode> {\n return {\n keyArgs,\n\n read(existing, { canRead, readField }) {\n if (!existing) return existing;\n\n const edges: TRelayEdge<TNode>[] = [];\n let firstEdgeCursor = \"\";\n let lastEdgeCursor = \"\";\n existing.edges.forEach((edge) => {\n // Edges themselves could be Reference objects, so it's important\n // to use readField to access the edge.edge.node property.\n if (canRead(readField(\"node\", edge))) {\n edges.push(edge);\n if (edge.cursor) {\n firstEdgeCursor = firstEdgeCursor || edge.cursor || \"\";\n lastEdgeCursor = edge.cursor || lastEdgeCursor;\n }\n }\n });\n\n if (edges.length > 1 && firstEdgeCursor === lastEdgeCursor) {\n firstEdgeCursor = \"\";\n }\n\n const { startCursor, endCursor } = existing.pageInfo || {};\n\n return {\n // Some implementations return additional Connection fields, such\n // as existing.totalCount. These fields are saved by the merge\n // function, so the read function should also preserve them.\n ...getExtras(existing),\n edges,\n pageInfo: {\n ...existing.pageInfo,\n // If existing.pageInfo.{start,end}Cursor are undefined or \"\", default\n // to firstEdgeCursor and/or lastEdgeCursor.\n startCursor: startCursor || firstEdgeCursor,\n endCursor: endCursor || lastEdgeCursor,\n },\n };\n },\n\n merge(existing, incoming, { args, isReference, readField }) {\n if (!existing) {\n existing = makeEmptyData();\n }\n\n if (!incoming) {\n return existing;\n }\n\n const incomingEdges =\n incoming.edges ?\n incoming.edges.map((edge) => {\n if (isReference((edge = { ...edge }))) {\n // In case edge is a Reference, we read out its cursor field and\n // store it as an extra property of the Reference object.\n edge.cursor = readField<string>(\"cursor\", edge);\n }\n return edge;\n })\n : [];\n\n if (incoming.pageInfo) {\n const { pageInfo } = incoming;\n const { startCursor, endCursor } = pageInfo;\n const firstEdge = incomingEdges[0];\n const lastEdge = incomingEdges[incomingEdges.length - 1];\n // In case we did not request the cursor field for edges in this\n // query, we can still infer cursors from pageInfo.\n if (firstEdge && startCursor) {\n firstEdge.cursor = startCursor;\n }\n if (lastEdge && endCursor) {\n lastEdge.cursor = endCursor;\n }\n // Cursors can also come from edges, so we default\n // pageInfo.{start,end}Cursor to {first,last}Edge.cursor.\n const firstCursor = firstEdge && firstEdge.cursor;\n if (firstCursor && !startCursor) {\n incoming = mergeDeep(incoming, {\n pageInfo: {\n startCursor: firstCursor,\n },\n });\n }\n const lastCursor = lastEdge && lastEdge.cursor;\n if (lastCursor && !endCursor) {\n incoming = mergeDeep(incoming, {\n pageInfo: {\n endCursor: lastCursor,\n },\n });\n }\n }\n\n let prefix = existing.edges;\n let suffix: typeof prefix = [];\n\n if (args && args.after) {\n // This comparison does not need to use readField(\"cursor\", edge),\n // because we stored the cursor field of any Reference edges as an\n // extra property of the Reference object.\n const index = prefix.findIndex((edge) => edge.cursor === args.after);\n if (index >= 0) {\n prefix = prefix.slice(0, index + 1);\n // suffix = []; // already true\n }\n } else if (args && args.before) {\n const index = prefix.findIndex((edge) => edge.cursor === args.before);\n suffix = index < 0 ? prefix : prefix.slice(index);\n prefix = [];\n } else if (incoming.edges) {\n // If we have neither args.after nor args.before, the incoming\n // edges cannot be spliced into the existing edges, so they must\n // replace the existing edges. See #6592 for a motivating example.\n prefix = [];\n }\n\n const edges = [...prefix, ...incomingEdges, ...suffix];\n\n const pageInfo: TRelayPageInfo = {\n // The ordering of these two ...spreads may be surprising, but it\n // makes sense because we want to combine PageInfo properties with a\n // preference for existing values, *unless* the existing values are\n // overridden by the logic below, which is permitted only when the\n // incoming page falls at the beginning or end of the data.\n ...incoming.pageInfo,\n ...existing.pageInfo,\n };\n\n if (incoming.pageInfo) {\n const {\n hasPreviousPage,\n hasNextPage,\n startCursor,\n endCursor,\n ...extras\n } = incoming.pageInfo;\n\n // If incoming.pageInfo had any extra non-standard properties,\n // assume they should take precedence over any existing properties\n // of the same name, regardless of where this page falls with\n // respect to the existing data.\n Object.assign(pageInfo, extras);\n\n // Keep existing.pageInfo.has{Previous,Next}Page unless the\n // placement of the incoming edges means incoming.hasPreviousPage\n // or incoming.hasNextPage should become the new values for those\n // properties in existing.pageInfo. Note that these updates are\n // only permitted when the beginning or end of the incoming page\n // coincides with the beginning or end of the existing data, as\n // determined using prefix.length and suffix.length.\n if (!prefix.length) {\n if (void 0 !== hasPreviousPage)\n pageInfo.hasPreviousPage = hasPreviousPage;\n if (void 0 !== startCursor) pageInfo.startCursor = startCursor;\n }\n if (!suffix.length) {\n if (void 0 !== hasNextPage) pageInfo.hasNextPage = hasNextPage;\n if (void 0 !== endCursor) pageInfo.endCursor = endCursor;\n }\n }\n\n return {\n ...getExtras(existing),\n ...getExtras(incoming),\n edges,\n pageInfo,\n };\n },\n };\n}\n\n// Returns any unrecognized properties of the given object.\nconst getExtras = (obj: Record<string, any>) => __rest(obj, notExtras);\nconst notExtras = [\"edges\", \"pageInfo\"];\n\nfunction makeEmptyData(): TExistingRelay<any> {\n return {\n edges: [],\n pageInfo: {\n hasPreviousPage: false,\n hasNextPage: true,\n startCursor: \"\",\n endCursor: \"\",\n },\n };\n}\n"]}
@@ -6,6 +6,7 @@ export function createFulfilledPromise(value) {
6
6
  }
7
7
  export function createRejectedPromise(reason) {
8
8
  var promise = Promise.reject(reason);
9
+ // prevent potential edge cases leaking unhandled error rejections
9
10
  promise.catch(function () { });
10
11
  promise.status = "rejected";
11
12
  promise.reason = reason;
@@ -1 +1 @@
1
- {"version":3,"file":"decoration.js","sourceRoot":"","sources":["../../../src/utilities/promises/decoration.ts"],"names":[],"mappings":"AAmBA,MAAM,UAAU,sBAAsB,CAAS,KAAa;IAC1D,IAAM,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,KAAK,CAA6B,CAAC;IAEnE,OAAO,CAAC,MAAM,GAAG,WAAW,CAAC;IAC7B,OAAO,CAAC,KAAK,GAAG,KAAK,CAAC;IAEtB,OAAO,OAAO,CAAC;AACjB,CAAC;AAED,MAAM,UAAU,qBAAqB,CAAmB,MAAe;IACrE,IAAM,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,CAA4B,CAAC;IAGlE,OAAO,CAAC,KAAK,CAAC,cAAO,CAAC,CAAC,CAAC;IAExB,OAAO,CAAC,MAAM,GAAG,UAAU,CAAC;IAC5B,OAAO,CAAC,MAAM,GAAG,MAAM,CAAC;IAExB,OAAO,OAAO,CAAC;AACjB,CAAC;AAED,MAAM,UAAU,iBAAiB,CAC/B,OAAwB;IAExB,OAAO,QAAQ,IAAI,OAAO,CAAC;AAC7B,CAAC;AAED,MAAM,UAAU,oBAAoB,CAClC,OAAwB;IAExB,IAAI,iBAAiB,CAAC,OAAO,CAAC,EAAE;QAC9B,OAAO,OAAO,CAAC;KAChB;IAED,IAAM,cAAc,GAAG,OAAiC,CAAC;IACzD,cAAc,CAAC,MAAM,GAAG,SAAS,CAAC;IAElC,cAAc,CAAC,IAAI,CACjB,UAAC,KAAK;QACJ,IAAI,cAAc,CAAC,MAAM,KAAK,SAAS,EAAE;YACvC,IAAM,gBAAgB,GACpB,cAAqD,CAAC;YAExD,gBAAgB,CAAC,MAAM,GAAG,WAAW,CAAC;YACtC,gBAAgB,CAAC,KAAK,GAAG,KAAK,CAAC;SAChC;IACH,CAAC,EACD,UAAC,MAAe;QACd,IAAI,cAAc,CAAC,MAAM,KAAK,SAAS,EAAE;YACvC,IAAM,eAAe,GACnB,cAAoD,CAAC;YAEvD,eAAe,CAAC,MAAM,GAAG,UAAU,CAAC;YACpC,eAAe,CAAC,MAAM,GAAG,MAAM,CAAC;SACjC;IACH,CAAC,CACF,CAAC;IAEF,OAAO,OAAmC,CAAC;AAC7C,CAAC","sourcesContent":["export interface PendingPromise<TValue> extends Promise<TValue> {\n status: \"pending\";\n}\n\nexport interface FulfilledPromise<TValue> extends Promise<TValue> {\n status: \"fulfilled\";\n value: TValue;\n}\n\nexport interface RejectedPromise<TValue> extends Promise<TValue> {\n status: \"rejected\";\n reason: unknown;\n}\n\nexport type PromiseWithState<TValue> =\n | PendingPromise<TValue>\n | FulfilledPromise<TValue>\n | RejectedPromise<TValue>;\n\nexport function createFulfilledPromise<TValue>(value: TValue) {\n const promise = Promise.resolve(value) as FulfilledPromise<TValue>;\n\n promise.status = \"fulfilled\";\n promise.value = value;\n\n return promise;\n}\n\nexport function createRejectedPromise<TValue = unknown>(reason: unknown) {\n const promise = Promise.reject(reason) as RejectedPromise<TValue>;\n\n // prevent potential edge cases leaking unhandled error rejections\n promise.catch(() => {});\n\n promise.status = \"rejected\";\n promise.reason = reason;\n\n return promise;\n}\n\nexport function isStatefulPromise<TValue>(\n promise: Promise<TValue>\n): promise is PromiseWithState<TValue> {\n return \"status\" in promise;\n}\n\nexport function wrapPromiseWithState<TValue>(\n promise: Promise<TValue>\n): PromiseWithState<TValue> {\n if (isStatefulPromise(promise)) {\n return promise;\n }\n\n const pendingPromise = promise as PendingPromise<TValue>;\n pendingPromise.status = \"pending\";\n\n pendingPromise.then(\n (value) => {\n if (pendingPromise.status === \"pending\") {\n const fulfilledPromise =\n pendingPromise as unknown as FulfilledPromise<TValue>;\n\n fulfilledPromise.status = \"fulfilled\";\n fulfilledPromise.value = value;\n }\n },\n (reason: unknown) => {\n if (pendingPromise.status === \"pending\") {\n const rejectedPromise =\n pendingPromise as unknown as RejectedPromise<TValue>;\n\n rejectedPromise.status = \"rejected\";\n rejectedPromise.reason = reason;\n }\n }\n );\n\n return promise as PromiseWithState<TValue>;\n}\n"]}
1
+ {"version":3,"file":"decoration.js","sourceRoot":"","sources":["../../../src/utilities/promises/decoration.ts"],"names":[],"mappings":"AAmBA,MAAM,UAAU,sBAAsB,CAAS,KAAa;IAC1D,IAAM,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,KAAK,CAA6B,CAAC;IAEnE,OAAO,CAAC,MAAM,GAAG,WAAW,CAAC;IAC7B,OAAO,CAAC,KAAK,GAAG,KAAK,CAAC;IAEtB,OAAO,OAAO,CAAC;AACjB,CAAC;AAED,MAAM,UAAU,qBAAqB,CAAmB,MAAe;IACrE,IAAM,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,CAA4B,CAAC;IAElE,kEAAkE;IAClE,OAAO,CAAC,KAAK,CAAC,cAAO,CAAC,CAAC,CAAC;IAExB,OAAO,CAAC,MAAM,GAAG,UAAU,CAAC;IAC5B,OAAO,CAAC,MAAM,GAAG,MAAM,CAAC;IAExB,OAAO,OAAO,CAAC;AACjB,CAAC;AAED,MAAM,UAAU,iBAAiB,CAC/B,OAAwB;IAExB,OAAO,QAAQ,IAAI,OAAO,CAAC;AAC7B,CAAC;AAED,MAAM,UAAU,oBAAoB,CAClC,OAAwB;IAExB,IAAI,iBAAiB,CAAC,OAAO,CAAC,EAAE,CAAC;QAC/B,OAAO,OAAO,CAAC;IACjB,CAAC;IAED,IAAM,cAAc,GAAG,OAAiC,CAAC;IACzD,cAAc,CAAC,MAAM,GAAG,SAAS,CAAC;IAElC,cAAc,CAAC,IAAI,CACjB,UAAC,KAAK;QACJ,IAAI,cAAc,CAAC,MAAM,KAAK,SAAS,EAAE,CAAC;YACxC,IAAM,gBAAgB,GACpB,cAAqD,CAAC;YAExD,gBAAgB,CAAC,MAAM,GAAG,WAAW,CAAC;YACtC,gBAAgB,CAAC,KAAK,GAAG,KAAK,CAAC;QACjC,CAAC;IACH,CAAC,EACD,UAAC,MAAe;QACd,IAAI,cAAc,CAAC,MAAM,KAAK,SAAS,EAAE,CAAC;YACxC,IAAM,eAAe,GACnB,cAAoD,CAAC;YAEvD,eAAe,CAAC,MAAM,GAAG,UAAU,CAAC;YACpC,eAAe,CAAC,MAAM,GAAG,MAAM,CAAC;QAClC,CAAC;IACH,CAAC,CACF,CAAC;IAEF,OAAO,OAAmC,CAAC;AAC7C,CAAC","sourcesContent":["export interface PendingPromise<TValue> extends Promise<TValue> {\n status: \"pending\";\n}\n\nexport interface FulfilledPromise<TValue> extends Promise<TValue> {\n status: \"fulfilled\";\n value: TValue;\n}\n\nexport interface RejectedPromise<TValue> extends Promise<TValue> {\n status: \"rejected\";\n reason: unknown;\n}\n\nexport type PromiseWithState<TValue> =\n | PendingPromise<TValue>\n | FulfilledPromise<TValue>\n | RejectedPromise<TValue>;\n\nexport function createFulfilledPromise<TValue>(value: TValue) {\n const promise = Promise.resolve(value) as FulfilledPromise<TValue>;\n\n promise.status = \"fulfilled\";\n promise.value = value;\n\n return promise;\n}\n\nexport function createRejectedPromise<TValue = unknown>(reason: unknown) {\n const promise = Promise.reject(reason) as RejectedPromise<TValue>;\n\n // prevent potential edge cases leaking unhandled error rejections\n promise.catch(() => {});\n\n promise.status = \"rejected\";\n promise.reason = reason;\n\n return promise;\n}\n\nexport function isStatefulPromise<TValue>(\n promise: Promise<TValue>\n): promise is PromiseWithState<TValue> {\n return \"status\" in promise;\n}\n\nexport function wrapPromiseWithState<TValue>(\n promise: Promise<TValue>\n): PromiseWithState<TValue> {\n if (isStatefulPromise(promise)) {\n return promise;\n }\n\n const pendingPromise = promise as PendingPromise<TValue>;\n pendingPromise.status = \"pending\";\n\n pendingPromise.then(\n (value) => {\n if (pendingPromise.status === \"pending\") {\n const fulfilledPromise =\n pendingPromise as unknown as FulfilledPromise<TValue>;\n\n fulfilledPromise.status = \"fulfilled\";\n fulfilledPromise.value = value;\n }\n },\n (reason: unknown) => {\n if (pendingPromise.status === \"pending\") {\n const rejectedPromise =\n pendingPromise as unknown as RejectedPromise<TValue>;\n\n rejectedPromise.status = \"rejected\";\n rejectedPromise.reason = reason;\n }\n }\n );\n\n return promise as PromiseWithState<TValue>;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"DeepOmit.js","sourceRoot":"","sources":["../../../src/utilities/types/DeepOmit.ts"],"names":[],"mappings":"","sourcesContent":["import type { Primitive } from \"./Primitive.js\";\n\n// DeepOmit primitives include functions since these are unmodified.\ntype DeepOmitPrimitive = Primitive | Function;\n\nexport type DeepOmitArray<T extends any[], K> = {\n [P in keyof T]: DeepOmit<T[P], K>;\n};\n\n// Unfortunately there is one major flaw in this type: This will omit properties\n// from class instances in the return type even though our omitDeep helper\n// ignores class instances, therefore resulting in a type mismatch between\n// the return value and the runtime value.\n//\n// It is not currently possible with TypeScript to distinguish between plain\n// objects and class instances.\n// https://github.com/microsoft/TypeScript/issues/29063\n//\n// This should be fine as of the time of this writing until omitDeep gets\n// broader use since this utility is only used to strip __typename from\n// `variables`; a case in which class instances are invalid anyways.\nexport type DeepOmit<T, K> = T extends DeepOmitPrimitive\n ? T\n : {\n [P in Exclude<keyof T, K>]: T[P] extends infer TP\n ? TP extends DeepOmitPrimitive\n ? TP\n : TP extends any[]\n ? DeepOmitArray<TP, K>\n : DeepOmit<TP, K>\n : never;\n };\n"]}
1
+ {"version":3,"file":"DeepOmit.js","sourceRoot":"","sources":["../../../src/utilities/types/DeepOmit.ts"],"names":[],"mappings":"","sourcesContent":["import type { Primitive } from \"./Primitive.js\";\n\n// DeepOmit primitives include functions since these are unmodified.\ntype DeepOmitPrimitive = Primitive | Function;\n\nexport type DeepOmitArray<T extends any[], K> = {\n [P in keyof T]: DeepOmit<T[P], K>;\n};\n\n// Unfortunately there is one major flaw in this type: This will omit properties\n// from class instances in the return type even though our omitDeep helper\n// ignores class instances, therefore resulting in a type mismatch between\n// the return value and the runtime value.\n//\n// It is not currently possible with TypeScript to distinguish between plain\n// objects and class instances.\n// https://github.com/microsoft/TypeScript/issues/29063\n//\n// This should be fine as of the time of this writing until omitDeep gets\n// broader use since this utility is only used to strip __typename from\n// `variables`; a case in which class instances are invalid anyways.\nexport type DeepOmit<T, K> =\n T extends DeepOmitPrimitive ? T\n : {\n [P in Exclude<keyof T, K>]: T[P] extends infer TP ?\n TP extends DeepOmitPrimitive ? TP\n : TP extends any[] ? DeepOmitArray<TP, K>\n : DeepOmit<TP, K>\n : never;\n };\n"]}
@@ -1,6 +1,6 @@
1
1
  import type { Primitive } from "./Primitive.js";
2
2
  type DeepPartialPrimitive = Primitive | Date | RegExp;
3
- export type DeepPartial<T> = T extends DeepPartialPrimitive ? T : T extends Map<infer TKey, infer TValue> ? DeepPartialMap<TKey, TValue> : T extends ReadonlyMap<infer TKey, infer TValue> ? DeepPartialReadonlyMap<TKey, TValue> : T extends Set<infer TItem> ? DeepPartialSet<TItem> : T extends ReadonlySet<infer TItem> ? DeepPartialReadonlySet<TItem> : T extends (...args: any[]) => unknown ? T | undefined : T extends object ? T extends ReadonlyArray<infer TItem> ? TItem[] extends T ? readonly TItem[] extends T ? ReadonlyArray<DeepPartial<TItem | undefined>> : Array<DeepPartial<TItem | undefined>> : DeepPartialObject<T> : DeepPartialObject<T> : unknown;
3
+ export type DeepPartial<T> = T extends DeepPartialPrimitive ? T : T extends Map<infer TKey, infer TValue> ? DeepPartialMap<TKey, TValue> : T extends ReadonlyMap<infer TKey, infer TValue> ? DeepPartialReadonlyMap<TKey, TValue> : T extends Set<infer TItem> ? DeepPartialSet<TItem> : T extends ReadonlySet<infer TItem> ? DeepPartialReadonlySet<TItem> : T extends (...args: any[]) => unknown ? T | undefined : T extends object ? T extends (ReadonlyArray<infer TItem>) ? TItem[] extends (T) ? readonly TItem[] extends T ? ReadonlyArray<DeepPartial<TItem | undefined>> : Array<DeepPartial<TItem | undefined>> : DeepPartialObject<T> : DeepPartialObject<T> : unknown;
4
4
  type DeepPartialMap<TKey, TValue> = {} & Map<DeepPartial<TKey>, DeepPartial<TValue>>;
5
5
  type DeepPartialReadonlyMap<TKey, TValue> = {} & ReadonlyMap<DeepPartial<TKey>, DeepPartial<TValue>>;
6
6
  type DeepPartialSet<T> = {} & Set<DeepPartial<T>>;
@@ -1,2 +1,6 @@
1
+ // Inspired by type-fest PartialDeep: https://github.com/sindresorhus/type-fest/blob/9feb8c89be9a0f2f688bf2f497230298a8e2472e/source/partial-deep.d.ts
2
+ //
3
+ // We're including the license to give credit to the original implementation.
4
+ // https://github.com/sindresorhus/type-fest/blob/main/license-mit
1
5
  export {};
2
6
  //# sourceMappingURL=DeepPartial.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"DeepPartial.js","sourceRoot":"","sources":["../../../src/utilities/types/DeepPartial.ts"],"names":[],"mappings":"","sourcesContent":["// Inspired by type-fest PartialDeep: https://github.com/sindresorhus/type-fest/blob/9feb8c89be9a0f2f688bf2f497230298a8e2472e/source/partial-deep.d.ts\n//\n// We're including the license to give credit to the original implementation.\n// https://github.com/sindresorhus/type-fest/blob/main/license-mit\n\n/*\n * MIT License\n *\n * Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n */\nimport type { Primitive } from \"./Primitive.js\";\n\ntype DeepPartialPrimitive = Primitive | Date | RegExp;\n\nexport type DeepPartial<T> = T extends DeepPartialPrimitive\n ? T\n : T extends Map<infer TKey, infer TValue>\n ? DeepPartialMap<TKey, TValue>\n : T extends ReadonlyMap<infer TKey, infer TValue>\n ? DeepPartialReadonlyMap<TKey, TValue>\n : T extends Set<infer TItem>\n ? DeepPartialSet<TItem>\n : T extends ReadonlySet<infer TItem>\n ? DeepPartialReadonlySet<TItem>\n : T extends (...args: any[]) => unknown\n ? T | undefined\n : T extends object\n ? T extends ReadonlyArray<infer TItem> // Test for arrays/tuples\n ? TItem[] extends T // Test for non-tuples\n ? readonly TItem[] extends T\n ? ReadonlyArray<DeepPartial<TItem | undefined>>\n : Array<DeepPartial<TItem | undefined>>\n : DeepPartialObject<T>\n : DeepPartialObject<T>\n : unknown;\n\ntype DeepPartialMap<TKey, TValue> = {} & Map<\n DeepPartial<TKey>,\n DeepPartial<TValue>\n>;\n\ntype DeepPartialReadonlyMap<TKey, TValue> = {} & ReadonlyMap<\n DeepPartial<TKey>,\n DeepPartial<TValue>\n>;\n\ntype DeepPartialSet<T> = {} & Set<DeepPartial<T>>;\ntype DeepPartialReadonlySet<T> = {} & ReadonlySet<DeepPartial<T>>;\n\ntype DeepPartialObject<T extends object> = {\n [K in keyof T]?: DeepPartial<T[K]>;\n};\n"]}
1
+ {"version":3,"file":"DeepPartial.js","sourceRoot":"","sources":["../../../src/utilities/types/DeepPartial.ts"],"names":[],"mappings":"AAAA,sJAAsJ;AACtJ,EAAE;AACF,6EAA6E;AAC7E,kEAAkE","sourcesContent":["// Inspired by type-fest PartialDeep: https://github.com/sindresorhus/type-fest/blob/9feb8c89be9a0f2f688bf2f497230298a8e2472e/source/partial-deep.d.ts\n//\n// We're including the license to give credit to the original implementation.\n// https://github.com/sindresorhus/type-fest/blob/main/license-mit\n\n/*\n * MIT License\n *\n * Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n */\nimport type { Primitive } from \"./Primitive.js\";\n\ntype DeepPartialPrimitive = Primitive | Date | RegExp;\n\nexport type DeepPartial<T> =\n T extends DeepPartialPrimitive ? T\n : T extends Map<infer TKey, infer TValue> ? DeepPartialMap<TKey, TValue>\n : T extends ReadonlyMap<infer TKey, infer TValue> ?\n DeepPartialReadonlyMap<TKey, TValue>\n : T extends Set<infer TItem> ? DeepPartialSet<TItem>\n : T extends ReadonlySet<infer TItem> ? DeepPartialReadonlySet<TItem>\n : T extends (...args: any[]) => unknown ? T | undefined\n : T extends object ?\n T extends (\n ReadonlyArray<infer TItem> // Test for arrays/tuples\n ) ?\n TItem[] extends (\n T // Test for non-tuples\n ) ?\n readonly TItem[] extends T ?\n ReadonlyArray<DeepPartial<TItem | undefined>>\n : Array<DeepPartial<TItem | undefined>>\n : DeepPartialObject<T>\n : DeepPartialObject<T>\n : unknown;\n\ntype DeepPartialMap<TKey, TValue> = {} & Map<\n DeepPartial<TKey>,\n DeepPartial<TValue>\n>;\n\ntype DeepPartialReadonlyMap<TKey, TValue> = {} & ReadonlyMap<\n DeepPartial<TKey>,\n DeepPartial<TValue>\n>;\n\ntype DeepPartialSet<T> = {} & Set<DeepPartial<T>>;\ntype DeepPartialReadonlySet<T> = {} & ReadonlySet<DeepPartial<T>>;\n\ntype DeepPartialObject<T extends object> = {\n [K in keyof T]?: DeepPartial<T[K]>;\n};\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"IsStrictlyAny.js","sourceRoot":"","sources":["../../../src/utilities/types/IsStrictlyAny.ts"],"names":[],"mappings":"","sourcesContent":["// Returns true if T is any, or false for any other type.\n// Inspired by https://stackoverflow.com/a/61625296/128454.\nexport type IsStrictlyAny<T> = UnionToIntersection<UnionForAny<T>> extends never\n ? true\n : false;\n\n// If (and only if) T is any, the union 'a' | 1 is returned here, representing\n// both branches of this conditional type. Only UnionForAny<any> produces this\n// union type; all other inputs produce the 1 literal type.\ntype UnionForAny<T> = T extends never ? \"a\" : 1;\n\n// If that 'a' | 1 union is then passed to UnionToIntersection, the result\n// should be 'a' & 1, which TypeScript simplifies to the never type, since the\n// literal type 'a' and the literal type 1 are incompatible. More explanation of\n// this helper type: https://stackoverflow.com/a/50375286/62076.\ntype UnionToIntersection<U> = (U extends any ? (k: U) => void : never) extends (\n k: infer I\n) => void\n ? I\n : never;\n"]}
1
+ {"version":3,"file":"IsStrictlyAny.js","sourceRoot":"","sources":["../../../src/utilities/types/IsStrictlyAny.ts"],"names":[],"mappings":"","sourcesContent":["// Returns true if T is any, or false for any other type.\n// Inspired by https://stackoverflow.com/a/61625296/128454.\nexport type IsStrictlyAny<T> =\n UnionToIntersection<UnionForAny<T>> extends never ? true : false;\n\n// If (and only if) T is any, the union 'a' | 1 is returned here, representing\n// both branches of this conditional type. Only UnionForAny<any> produces this\n// union type; all other inputs produce the 1 literal type.\ntype UnionForAny<T> = T extends never ? \"a\" : 1;\n\n// If that 'a' | 1 union is then passed to UnionToIntersection, the result\n// should be 'a' & 1, which TypeScript simplifies to the never type, since the\n// literal type 'a' and the literal type 1 are incompatible. More explanation of\n// this helper type: https://stackoverflow.com/a/50375286/62076.\ntype UnionToIntersection<U> =\n (U extends any ? (k: U) => void : never) extends (k: infer I) => void ? I\n : never;\n"]}
@@ -0,0 +1,3 @@
1
+ /** @internal */
2
+ export type TODO = any;
3
+ //# sourceMappingURL=TODO.d.ts.map
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=TODO.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TODO.js","sourceRoot":"","sources":["../../../src/utilities/types/TODO.ts"],"names":[],"mappings":"","sourcesContent":["/** @internal */\nexport type TODO = any;\n"]}
@@ -88,7 +88,8 @@ var canUseWeakSet = typeof WeakSet === "function";
88
88
  var canUseSymbol = typeof Symbol === "function" && typeof Symbol.for === "function";
89
89
  var canUseAsyncIteratorSymbol = canUseSymbol && Symbol.asyncIterator;
90
90
  var canUseDOM = typeof globals.maybe(function () { return window.document.createElement; }) === "function";
91
- var usingJSDOM = globals.maybe(function () { return navigator.userAgent.indexOf("jsdom") >= 0; }) || false;
91
+ var usingJSDOM =
92
+ globals.maybe(function () { return navigator.userAgent.indexOf("jsdom") >= 0; }) || false;
92
93
  var canUseLayoutEffect = canUseDOM && !usingJSDOM;
93
94
 
94
95
  function isNonNullObject(obj) {
@@ -279,8 +280,8 @@ var getStoreKeyName = Object.assign(function (fieldName, args, directives) {
279
280
  directives["connection"]["key"]) {
280
281
  if (directives["connection"]["filter"] &&
281
282
  directives["connection"]["filter"].length > 0) {
282
- var filterKeys = directives["connection"]["filter"]
283
- ? directives["connection"]["filter"]
283
+ var filterKeys = directives["connection"]["filter"] ?
284
+ directives["connection"]["filter"]
284
285
  : [];
285
286
  filterKeys.sort();
286
287
  var filteredArgs_1 = {};
@@ -463,12 +464,10 @@ function getDefaultValues(definition) {
463
464
  function identity(document) {
464
465
  return document;
465
466
  }
466
- var DocumentTransform = (function () {
467
+ var DocumentTransform = (function () {
467
468
  function DocumentTransform(transform, options) {
468
469
  if (options === void 0) { options = Object.create(null); }
469
- this.resultCache = canUseWeakSet
470
- ? new WeakSet()
471
- : new Set();
470
+ this.resultCache = canUseWeakSet ? new WeakSet() : new Set();
472
471
  this.transform = transform;
473
472
  if (options.getCacheKey) {
474
473
  this.getCacheKey = options.getCacheKey;
@@ -488,7 +487,8 @@ var DocumentTransform = (function () {
488
487
  return new DocumentTransform(function (document) {
489
488
  var documentTransform = predicate(document) ? left : right;
490
489
  return documentTransform.transformDocument(document);
491
- }, { cache: false });
490
+ },
491
+ { cache: false });
492
492
  };
493
493
  DocumentTransform.prototype.transformDocument = function (document) {
494
494
  if (this.resultCache.has(document)) {
@@ -510,7 +510,8 @@ var DocumentTransform = (function () {
510
510
  var _this = this;
511
511
  return new DocumentTransform(function (document) {
512
512
  return otherTransform.transformDocument(_this.transformDocument(document));
513
- }, { cache: false });
513
+ },
514
+ { cache: false });
514
515
  };
515
516
  DocumentTransform.prototype.getStableCacheEntry = function (document) {
516
517
  if (!this.stableCacheKeys)
@@ -555,8 +556,8 @@ function isEmpty(op, fragmentMap) {
555
556
  }));
556
557
  }
557
558
  function nullIfDocIsEmpty(doc) {
558
- return isEmpty(getOperationDefinition(doc) || getFragmentDefinition(doc), createFragmentMap(getFragmentDefinitions(doc)))
559
- ? null
559
+ return (isEmpty(getOperationDefinition(doc) || getFragmentDefinition(doc), createFragmentMap(getFragmentDefinitions(doc)))) ?
560
+ null
560
561
  : doc;
561
562
  }
562
563
  function getDirectiveMatcher(configs) {
@@ -676,7 +677,8 @@ function removeDirectivesFromDocument(directives, doc) {
676
677
  if (node === originalNode) {
677
678
  return node;
678
679
  }
679
- if (operationCount > 0 &&
680
+ if (
681
+ operationCount > 0 &&
680
682
  node.selectionSet.selections.every(function (selection) {
681
683
  return selection.kind === graphql.Kind.FIELD &&
682
684
  selection.name.value === "__typename";
@@ -731,7 +733,8 @@ function removeDirectivesFromDocument(directives, doc) {
731
733
  });
732
734
  });
733
735
  var fragmentWillBeRemoved = function (fragmentName) {
734
- return !!((!allFragmentNamesUsed.has(fragmentName) ||
736
+ return !!(
737
+ (!allFragmentNamesUsed.has(fragmentName) ||
735
738
  getInUseByFragmentName(fragmentName).removed));
736
739
  };
737
740
  var enterVisitor = {
@@ -747,7 +750,8 @@ function removeDirectivesFromDocument(directives, doc) {
747
750
  OperationDefinition: {
748
751
  leave: function (node) {
749
752
  if (node.variableDefinitions) {
750
- var usedVariableNames_1 = populateTransitiveVars(getInUseByOperationName(node.name && node.name.value)).transitiveVars;
753
+ var usedVariableNames_1 = populateTransitiveVars(
754
+ getInUseByOperationName(node.name && node.name.value)).transitiveVars;
751
755
  if (usedVariableNames_1.size < node.variableDefinitions.length) {
752
756
  return tslib.__assign(tslib.__assign({}, node), { variableDefinitions: node.variableDefinitions.filter(function (varDef) {
753
757
  return usedVariableNames_1.has(varDef.variable.name.value);
@@ -825,8 +829,9 @@ function removeArgumentsFromDocument(config, doc) {
825
829
  return nullIfDocIsEmpty(graphql.visit(doc, {
826
830
  OperationDefinition: {
827
831
  enter: function (node) {
828
- return tslib.__assign(tslib.__assign({}, node), { variableDefinitions: node.variableDefinitions
829
- ? node.variableDefinitions.filter(function (varDef) {
832
+ return tslib.__assign(tslib.__assign({}, node), {
833
+ variableDefinitions: node.variableDefinitions ?
834
+ node.variableDefinitions.filter(function (varDef) {
830
835
  return !config.some(function (arg) { return arg.name === varDef.variable.name.value; });
831
836
  })
832
837
  : [] });
@@ -932,7 +937,7 @@ function mergeDeepArray(sources) {
932
937
  var defaultReconciler = function (target, source, property) {
933
938
  return this.merge(target[property], source[property]);
934
939
  };
935
- var DeepMerger = (function () {
940
+ var DeepMerger = (function () {
936
941
  function DeepMerger(reconciler) {
937
942
  if (reconciler === void 0) { reconciler = defaultReconciler; }
938
943
  this.reconciler = reconciler;
@@ -1040,7 +1045,8 @@ function relayStylePagination(keyArgs) {
1040
1045
  firstEdgeCursor = "";
1041
1046
  }
1042
1047
  var _b = existing.pageInfo || {}, startCursor = _b.startCursor, endCursor = _b.endCursor;
1043
- return tslib.__assign(tslib.__assign({}, getExtras(existing)), { edges: edges, pageInfo: tslib.__assign(tslib.__assign({}, existing.pageInfo), { startCursor: startCursor || firstEdgeCursor, endCursor: endCursor || lastEdgeCursor }) });
1048
+ return tslib.__assign(tslib.__assign({}, getExtras(existing)), { edges: edges, pageInfo: tslib.__assign(tslib.__assign({}, existing.pageInfo), {
1049
+ startCursor: startCursor || firstEdgeCursor, endCursor: endCursor || lastEdgeCursor }) });
1044
1050
  },
1045
1051
  merge: function (existing, incoming, _a) {
1046
1052
  var args = _a.args, isReference = _a.isReference, readField = _a.readField;
@@ -1050,8 +1056,8 @@ function relayStylePagination(keyArgs) {
1050
1056
  if (!incoming) {
1051
1057
  return existing;
1052
1058
  }
1053
- var incomingEdges = incoming.edges
1054
- ? incoming.edges.map(function (edge) {
1059
+ var incomingEdges = incoming.edges ?
1060
+ incoming.edges.map(function (edge) {
1055
1061
  if (isReference((edge = tslib.__assign({}, edge)))) {
1056
1062
  edge.cursor = readField("cursor", edge);
1057
1063
  }
@@ -1258,8 +1264,8 @@ function asyncMap(observable, mapFn, catchFn) {
1258
1264
  return function (arg) {
1259
1265
  if (examiner) {
1260
1266
  var both = function () {
1261
- return observer.closed
1262
- ? 0
1267
+ return observer.closed ?
1268
+ 0
1263
1269
  : examiner(arg);
1264
1270
  };
1265
1271
  promiseQueue = promiseQueue.then(both, both).then(function (result) { return observer.next(result); }, function (error) { return observer.error(error); });
@@ -1273,7 +1279,7 @@ function asyncMap(observable, mapFn, catchFn) {
1273
1279
  next: makeCallback(mapFn, "next"),
1274
1280
  error: makeCallback(catchFn, "error"),
1275
1281
  complete: function () {
1276
- promiseQueue.then(function () { return observer.complete(); });
1282
+ promiseQueue.then(function () { return observer.complete(); });
1277
1283
  },
1278
1284
  };
1279
1285
  var sub = observable.subscribe(handler);
@@ -1295,7 +1301,7 @@ function fixObservableSubclass(subclass) {
1295
1301
  function isPromiseLike(value) {
1296
1302
  return value && typeof value.then === "function";
1297
1303
  }
1298
- var Concast = (function (_super) {
1304
+ var Concast = (function (_super) {
1299
1305
  tslib.__extends(Concast, _super);
1300
1306
  function Concast(sources) {
1301
1307
  var _this = _super.call(this, function (observer) {
@@ -1458,9 +1464,7 @@ function graphQLResultHasError(result) {
1458
1464
  return isNonEmptyArray(errors);
1459
1465
  }
1460
1466
  function getGraphQLErrorsFromResult(result) {
1461
- var graphQLErrors = isNonEmptyArray(result.errors)
1462
- ? result.errors.slice(0)
1463
- : [];
1467
+ var graphQLErrors = isNonEmptyArray(result.errors) ? result.errors.slice(0) : [];
1464
1468
  if (isExecutionPatchIncrementalResult(result) &&
1465
1469
  isNonEmptyArray(result.incremental)) {
1466
1470
  result.incremental.forEach(function (incrementalResult) {