@apollo/client 3.8.0-alpha.1 → 3.8.0-alpha.11

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 (373) hide show
  1. package/README.md +3 -1
  2. package/apollo-client.cjs +661 -468
  3. package/apollo-client.cjs.map +1 -1
  4. package/apollo-client.min.cjs +1 -1
  5. package/cache/cache.cjs +56 -44
  6. package/cache/cache.cjs.map +1 -1
  7. package/cache/cache.cjs.native.js +56 -44
  8. package/cache/core/cache.d.ts +2 -1
  9. package/cache/core/cache.d.ts.map +1 -1
  10. package/cache/core/cache.js +1 -0
  11. package/cache/core/cache.js.map +1 -1
  12. package/cache/core/types/DataProxy.d.ts +3 -2
  13. package/cache/core/types/DataProxy.d.ts.map +1 -1
  14. package/cache/core/types/DataProxy.js.map +1 -1
  15. package/cache/core/types/common.d.ts +7 -7
  16. package/cache/core/types/common.d.ts.map +1 -1
  17. package/cache/inmemory/entityStore.d.ts +1 -1
  18. package/cache/inmemory/entityStore.d.ts.map +1 -1
  19. package/cache/inmemory/entityStore.js +1 -1
  20. package/cache/inmemory/helpers.d.ts +2 -2
  21. package/cache/inmemory/helpers.d.ts.map +1 -1
  22. package/cache/inmemory/helpers.js +2 -2
  23. package/cache/inmemory/helpers.js.map +1 -1
  24. package/cache/inmemory/inMemoryCache.d.ts +4 -2
  25. package/cache/inmemory/inMemoryCache.d.ts.map +1 -1
  26. package/cache/inmemory/inMemoryCache.js +2 -1
  27. package/cache/inmemory/inMemoryCache.js.map +1 -1
  28. package/cache/inmemory/key-extractor.js +1 -1
  29. package/cache/inmemory/object-canon.d.ts +0 -1
  30. package/cache/inmemory/object-canon.d.ts.map +1 -1
  31. package/cache/inmemory/object-canon.js +1 -1
  32. package/cache/inmemory/object-canon.js.map +1 -1
  33. package/cache/inmemory/policies.d.ts +12 -12
  34. package/cache/inmemory/policies.d.ts.map +1 -1
  35. package/cache/inmemory/policies.js +15 -4
  36. package/cache/inmemory/policies.js.map +1 -1
  37. package/cache/inmemory/reactiveVars.d.ts +1 -1
  38. package/cache/inmemory/reactiveVars.d.ts.map +1 -1
  39. package/cache/inmemory/readFromStore.d.ts +2 -2
  40. package/cache/inmemory/readFromStore.d.ts.map +1 -1
  41. package/cache/inmemory/readFromStore.js +1 -1
  42. package/cache/inmemory/readFromStore.js.map +1 -1
  43. package/cache/inmemory/types.d.ts +4 -4
  44. package/cache/inmemory/types.d.ts.map +1 -1
  45. package/cache/inmemory/writeToStore.d.ts +1 -1
  46. package/cache/inmemory/writeToStore.d.ts.map +1 -1
  47. package/cache/inmemory/writeToStore.js +1 -1
  48. package/cache/inmemory/writeToStore.js.map +1 -1
  49. package/core/ApolloClient.d.ts +10 -9
  50. package/core/ApolloClient.d.ts.map +1 -1
  51. package/core/ApolloClient.js +17 -11
  52. package/core/ApolloClient.js.map +1 -1
  53. package/core/LocalState.d.ts +12 -7
  54. package/core/LocalState.d.ts.map +1 -1
  55. package/core/LocalState.js +71 -17
  56. package/core/LocalState.js.map +1 -1
  57. package/core/ObservableQuery.d.ts +6 -7
  58. package/core/ObservableQuery.d.ts.map +1 -1
  59. package/core/ObservableQuery.js +6 -10
  60. package/core/ObservableQuery.js.map +1 -1
  61. package/core/QueryInfo.d.ts +1 -1
  62. package/core/QueryInfo.d.ts.map +1 -1
  63. package/core/QueryInfo.js +1 -1
  64. package/core/QueryInfo.js.map +1 -1
  65. package/core/QueryManager.d.ts +7 -7
  66. package/core/QueryManager.d.ts.map +1 -1
  67. package/core/QueryManager.js +24 -14
  68. package/core/QueryManager.js.map +1 -1
  69. package/core/core.cjs +142 -83
  70. package/core/core.cjs.map +1 -1
  71. package/core/core.cjs.native.js +142 -83
  72. package/core/index.js +2 -2
  73. package/core/index.js.map +1 -1
  74. package/core/networkStatus.d.ts +1 -0
  75. package/core/networkStatus.d.ts.map +1 -1
  76. package/core/networkStatus.js +3 -0
  77. package/core/networkStatus.js.map +1 -1
  78. package/core/types.d.ts +24 -17
  79. package/core/types.d.ts.map +1 -1
  80. package/core/types.js +1 -0
  81. package/core/types.js.map +1 -1
  82. package/core/watchQueryOptions.d.ts +11 -12
  83. package/core/watchQueryOptions.d.ts.map +1 -1
  84. package/core/watchQueryOptions.js.map +1 -1
  85. package/errors/index.d.ts +2 -2
  86. package/errors/index.d.ts.map +1 -1
  87. package/invariantErrorCodes.js +58 -52
  88. package/link/batch/batch.cjs +5 -3
  89. package/link/batch/batch.cjs.map +1 -1
  90. package/link/batch/batch.cjs.native.js +5 -3
  91. package/link/batch/batching.d.ts +2 -2
  92. package/link/batch/batching.d.ts.map +1 -1
  93. package/link/batch/batching.js +5 -3
  94. package/link/batch/batching.js.map +1 -1
  95. package/link/batch-http/batch-http.cjs +12 -2
  96. package/link/batch-http/batch-http.cjs.map +1 -1
  97. package/link/batch-http/batch-http.cjs.native.js +12 -2
  98. package/link/batch-http/batchHttpLink.d.ts.map +1 -1
  99. package/link/batch-http/batchHttpLink.js +13 -3
  100. package/link/batch-http/batchHttpLink.js.map +1 -1
  101. package/link/context/index.d.ts +2 -1
  102. package/link/context/index.d.ts.map +1 -1
  103. package/link/context/index.js.map +1 -1
  104. package/link/core/ApolloLink.js +2 -2
  105. package/link/core/core.cjs +2 -2
  106. package/link/core/core.cjs.map +1 -1
  107. package/link/core/core.cjs.native.js +2 -2
  108. package/link/core/types.d.ts +15 -15
  109. package/link/core/types.d.ts.map +1 -1
  110. package/link/core/types.js.map +1 -1
  111. package/link/http/checkFetcher.js +2 -2
  112. package/link/http/createHttpLink.d.ts +0 -1
  113. package/link/http/createHttpLink.d.ts.map +1 -1
  114. package/link/http/createHttpLink.js +10 -2
  115. package/link/http/createHttpLink.js.map +1 -1
  116. package/link/http/http.cjs +20 -38
  117. package/link/http/http.cjs.map +1 -1
  118. package/link/http/http.cjs.native.js +20 -38
  119. package/link/http/iterators/async.js.map +1 -1
  120. package/link/http/iterators/nodeStream.js.map +1 -1
  121. package/link/http/iterators/promise.js.map +1 -1
  122. package/link/http/iterators/reader.js.map +1 -1
  123. package/link/http/parseAndCheckHttpResponse.d.ts +2 -2
  124. package/link/http/parseAndCheckHttpResponse.d.ts.map +1 -1
  125. package/link/http/parseAndCheckHttpResponse.js.map +1 -1
  126. package/link/http/responseIterator.js +1 -1
  127. package/link/http/responseIterator.js.map +1 -1
  128. package/link/http/selectHttpOptionsAndBody.d.ts +2 -2
  129. package/link/http/selectHttpOptionsAndBody.d.ts.map +1 -1
  130. package/link/http/selectHttpOptionsAndBody.js +3 -1
  131. package/link/http/selectHttpOptionsAndBody.js.map +1 -1
  132. package/link/http/serializeFetchParameter.d.ts +1 -1
  133. package/link/http/serializeFetchParameter.d.ts.map +1 -1
  134. package/link/http/serializeFetchParameter.js +2 -2
  135. package/link/persisted-queries/index.d.ts +2 -2
  136. package/link/persisted-queries/index.d.ts.map +1 -1
  137. package/link/persisted-queries/index.js +3 -3
  138. package/link/persisted-queries/persisted-queries.cjs +3 -3
  139. package/link/persisted-queries/persisted-queries.cjs.map +1 -1
  140. package/link/persisted-queries/persisted-queries.cjs.native.js +3 -3
  141. package/link/utils/throwServerError.d.ts +1 -1
  142. package/link/utils/throwServerError.d.ts.map +1 -1
  143. package/link/utils/toPromise.js +1 -1
  144. package/link/utils/utils.cjs +2 -2
  145. package/link/utils/utils.cjs.map +1 -1
  146. package/link/utils/utils.cjs.native.js +2 -2
  147. package/link/utils/validateOperation.js +2 -2
  148. package/package.json +26 -24
  149. package/react/cache/QuerySubscription.d.ts +26 -0
  150. package/react/cache/QuerySubscription.d.ts.map +1 -0
  151. package/react/cache/QuerySubscription.js +88 -0
  152. package/react/cache/QuerySubscription.js.map +1 -0
  153. package/react/cache/SuspenseCache.d.ts +9 -13
  154. package/react/cache/SuspenseCache.d.ts.map +1 -1
  155. package/react/cache/SuspenseCache.js +17 -40
  156. package/react/cache/SuspenseCache.js.map +1 -1
  157. package/react/components/Query.d.ts +2 -2
  158. package/react/components/Query.d.ts.map +1 -1
  159. package/react/components/Query.js.map +1 -1
  160. package/react/components/Subscription.d.ts +2 -2
  161. package/react/components/Subscription.d.ts.map +1 -1
  162. package/react/components/Subscription.js.map +1 -1
  163. package/react/components/types.d.ts +2 -2
  164. package/react/components/types.d.ts.map +1 -1
  165. package/react/components/types.js.map +1 -1
  166. package/react/context/ApolloConsumer.js +2 -2
  167. package/react/context/ApolloProvider.js +2 -2
  168. package/react/context/context.cjs +4 -4
  169. package/react/context/context.cjs.map +1 -1
  170. package/react/context/context.cjs.native.js +4 -4
  171. package/react/hoc/graphql.d.ts +2 -1
  172. package/react/hoc/graphql.d.ts.map +1 -1
  173. package/react/hoc/graphql.js.map +1 -1
  174. package/react/hoc/hoc-utils.d.ts +1 -1
  175. package/react/hoc/hoc-utils.d.ts.map +1 -1
  176. package/react/hoc/hoc-utils.js +2 -2
  177. package/react/hoc/hoc.cjs +4 -4
  178. package/react/hoc/hoc.cjs.map +1 -1
  179. package/react/hoc/hoc.cjs.native.js +4 -4
  180. package/react/hoc/mutation-hoc.d.ts +2 -2
  181. package/react/hoc/mutation-hoc.d.ts.map +1 -1
  182. package/react/hoc/mutation-hoc.js.map +1 -1
  183. package/react/hoc/query-hoc.d.ts +1 -1
  184. package/react/hoc/query-hoc.d.ts.map +1 -1
  185. package/react/hoc/query-hoc.js.map +1 -1
  186. package/react/hoc/subscription-hoc.d.ts +1 -1
  187. package/react/hoc/subscription-hoc.d.ts.map +1 -1
  188. package/react/hoc/subscription-hoc.js.map +1 -1
  189. package/react/hoc/types.d.ts +6 -6
  190. package/react/hoc/types.d.ts.map +1 -1
  191. package/react/hoc/types.js.map +1 -1
  192. package/react/hoc/withApollo.js +2 -2
  193. package/react/hooks/hooks.cjs +190 -174
  194. package/react/hooks/hooks.cjs.map +1 -1
  195. package/react/hooks/hooks.cjs.native.js +190 -174
  196. package/react/hooks/internal/__use.d.ts +2 -0
  197. package/react/hooks/internal/__use.d.ts.map +1 -0
  198. package/react/hooks/internal/__use.js +13 -0
  199. package/react/hooks/internal/__use.js.map +1 -0
  200. package/react/hooks/internal/index.d.ts +3 -0
  201. package/react/hooks/internal/index.d.ts.map +1 -1
  202. package/react/hooks/internal/index.js +3 -0
  203. package/react/hooks/internal/index.js.map +1 -1
  204. package/react/hooks/internal/useIsomorphicLayoutEffect.d.ts +3 -0
  205. package/react/hooks/internal/useIsomorphicLayoutEffect.d.ts.map +1 -0
  206. package/react/hooks/internal/useIsomorphicLayoutEffect.js +6 -0
  207. package/react/hooks/internal/useIsomorphicLayoutEffect.js.map +1 -0
  208. package/react/hooks/internal/useStrictModeSafeCleanupEffect.d.ts +2 -0
  209. package/react/hooks/internal/useStrictModeSafeCleanupEffect.d.ts.map +1 -0
  210. package/react/hooks/internal/useStrictModeSafeCleanupEffect.js +11 -0
  211. package/react/hooks/internal/useStrictModeSafeCleanupEffect.js.map +1 -0
  212. package/react/hooks/useApolloClient.js +2 -2
  213. package/react/hooks/useFragment.d.ts +4 -2
  214. package/react/hooks/useFragment.d.ts.map +1 -1
  215. package/react/hooks/useFragment.js +9 -8
  216. package/react/hooks/useFragment.js.map +1 -1
  217. package/react/hooks/useLazyQuery.d.ts +2 -2
  218. package/react/hooks/useLazyQuery.d.ts.map +1 -1
  219. package/react/hooks/useLazyQuery.js +22 -8
  220. package/react/hooks/useLazyQuery.js.map +1 -1
  221. package/react/hooks/useMutation.d.ts +2 -2
  222. package/react/hooks/useMutation.d.ts.map +1 -1
  223. package/react/hooks/useMutation.js +9 -8
  224. package/react/hooks/useMutation.js.map +1 -1
  225. package/react/hooks/useQuery.d.ts +6 -5
  226. package/react/hooks/useQuery.d.ts.map +1 -1
  227. package/react/hooks/useQuery.js +21 -7
  228. package/react/hooks/useQuery.js.map +1 -1
  229. package/react/hooks/useSubscription.d.ts +2 -3
  230. package/react/hooks/useSubscription.d.ts.map +1 -1
  231. package/react/hooks/useSubscription.js +1 -2
  232. package/react/hooks/useSubscription.js.map +1 -1
  233. package/react/hooks/useSuspenseCache.d.ts +2 -1
  234. package/react/hooks/useSuspenseCache.d.ts.map +1 -1
  235. package/react/hooks/useSuspenseCache.js +7 -5
  236. package/react/hooks/useSuspenseCache.js.map +1 -1
  237. package/react/hooks/useSuspenseQuery.d.ts +16 -4
  238. package/react/hooks/useSuspenseQuery.d.ts.map +1 -1
  239. package/react/hooks/useSuspenseQuery.js +73 -136
  240. package/react/hooks/useSuspenseQuery.js.map +1 -1
  241. package/react/hooks/useSyncExternalStore.d.ts +1 -1
  242. package/react/hooks/useSyncExternalStore.d.ts.map +1 -1
  243. package/react/hooks/useSyncExternalStore.js +1 -1
  244. package/react/hooks/useSyncExternalStore.js.map +1 -1
  245. package/react/parser/index.js +6 -6
  246. package/react/parser/parser.cjs +10 -10
  247. package/react/parser/parser.cjs.map +1 -1
  248. package/react/parser/parser.cjs.native.js +10 -10
  249. package/react/react.cjs +112 -38
  250. package/react/react.cjs.map +1 -1
  251. package/react/react.cjs.native.js +112 -38
  252. package/react/ssr/RenderPromises.d.ts +4 -4
  253. package/react/ssr/RenderPromises.d.ts.map +1 -1
  254. package/react/ssr/RenderPromises.js.map +1 -1
  255. package/react/ssr/getDataFromTree.d.ts +1 -1
  256. package/react/ssr/getDataFromTree.d.ts.map +1 -1
  257. package/react/types/types.d.ts +26 -25
  258. package/react/types/types.d.ts.map +1 -1
  259. package/react/types/types.js.map +1 -1
  260. package/testing/core/core.cjs +30 -3
  261. package/testing/core/core.cjs.map +1 -1
  262. package/testing/core/core.cjs.native.js +30 -3
  263. package/testing/core/index.d.ts +2 -1
  264. package/testing/core/index.d.ts.map +1 -1
  265. package/testing/core/index.js +1 -0
  266. package/testing/core/index.js.map +1 -1
  267. package/testing/core/itAsync.js.map +1 -1
  268. package/testing/core/mocking/mockFetch.js.map +1 -1
  269. package/testing/core/mocking/mockLink.d.ts +8 -4
  270. package/testing/core/mocking/mockLink.d.ts.map +1 -1
  271. package/testing/core/mocking/mockLink.js +14 -4
  272. package/testing/core/mocking/mockLink.js.map +1 -1
  273. package/testing/core/mocking/mockQueryManager.d.ts +1 -1
  274. package/testing/core/mocking/mockQueryManager.d.ts.map +1 -1
  275. package/testing/core/mocking/mockQueryManager.js +3 -3
  276. package/testing/core/mocking/mockQueryManager.js.map +1 -1
  277. package/testing/core/mocking/mockWatchQuery.d.ts +1 -1
  278. package/testing/core/mocking/mockWatchQuery.d.ts.map +1 -1
  279. package/testing/core/mocking/mockWatchQuery.js +4 -5
  280. package/testing/core/mocking/mockWatchQuery.js.map +1 -1
  281. package/testing/core/observableToPromise.d.ts +2 -2
  282. package/testing/core/observableToPromise.d.ts.map +1 -1
  283. package/testing/core/observableToPromise.js.map +1 -1
  284. package/testing/core/wait.d.ts +3 -0
  285. package/testing/core/wait.d.ts.map +1 -0
  286. package/testing/core/wait.js +16 -0
  287. package/testing/core/wait.js.map +1 -0
  288. package/testing/react/MockedProvider.d.ts +1 -0
  289. package/testing/react/MockedProvider.d.ts.map +1 -1
  290. package/testing/react/MockedProvider.js +2 -2
  291. package/testing/react/MockedProvider.js.map +1 -1
  292. package/testing/testing.cjs +112 -40
  293. package/testing/testing.cjs.map +1 -1
  294. package/testing/testing.cjs.native.js +112 -40
  295. package/utilities/common/arrays.d.ts +1 -0
  296. package/utilities/common/arrays.d.ts.map +1 -1
  297. package/utilities/common/arrays.js +1 -0
  298. package/utilities/common/arrays.js.map +1 -1
  299. package/utilities/common/cloneDeep.js.map +1 -1
  300. package/utilities/common/errorHandling.d.ts +2 -2
  301. package/utilities/common/errorHandling.d.ts.map +1 -1
  302. package/utilities/common/errorHandling.js.map +1 -1
  303. package/utilities/common/incrementalResult.d.ts +4 -4
  304. package/utilities/common/incrementalResult.d.ts.map +1 -1
  305. package/utilities/common/incrementalResult.js.map +1 -1
  306. package/utilities/common/maybeDeepFreeze.d.ts +0 -1
  307. package/utilities/common/maybeDeepFreeze.d.ts.map +1 -1
  308. package/utilities/common/maybeDeepFreeze.js +1 -1
  309. package/utilities/common/maybeDeepFreeze.js.map +1 -1
  310. package/utilities/common/mergeDeep.d.ts +2 -2
  311. package/utilities/common/mergeDeep.d.ts.map +1 -1
  312. package/utilities/common/mergeOptions.d.ts +3 -3
  313. package/utilities/common/mergeOptions.d.ts.map +1 -1
  314. package/utilities/common/mergeOptions.js +1 -1
  315. package/utilities/common/mergeOptions.js.map +1 -1
  316. package/utilities/globals/DEV.d.ts +1 -1
  317. package/utilities/globals/DEV.d.ts.map +1 -1
  318. package/utilities/globals/DEV.js +1 -17
  319. package/utilities/globals/DEV.js.map +1 -1
  320. package/utilities/globals/global.d.ts +5 -2
  321. package/utilities/globals/global.d.ts.map +1 -1
  322. package/utilities/globals/global.js.map +1 -1
  323. package/utilities/globals/globals.cjs +5 -22
  324. package/utilities/globals/globals.cjs.map +1 -1
  325. package/utilities/globals/globals.cjs.native.js +5 -22
  326. package/utilities/globals/index.d.ts +1 -1
  327. package/utilities/globals/index.d.ts.map +1 -1
  328. package/utilities/globals/index.js +1 -4
  329. package/utilities/globals/index.js.map +1 -1
  330. package/utilities/graphql/directives.d.ts +2 -2
  331. package/utilities/graphql/directives.d.ts.map +1 -1
  332. package/utilities/graphql/directives.js +5 -5
  333. package/utilities/graphql/directives.js.map +1 -1
  334. package/utilities/graphql/fragments.d.ts +1 -1
  335. package/utilities/graphql/fragments.d.ts.map +1 -1
  336. package/utilities/graphql/fragments.js +4 -4
  337. package/utilities/graphql/getFromAST.d.ts.map +1 -1
  338. package/utilities/graphql/getFromAST.js +16 -12
  339. package/utilities/graphql/getFromAST.js.map +1 -1
  340. package/utilities/graphql/storeUtils.d.ts +3 -3
  341. package/utilities/graphql/storeUtils.d.ts.map +1 -1
  342. package/utilities/graphql/storeUtils.js +2 -2
  343. package/utilities/graphql/storeUtils.js.map +1 -1
  344. package/utilities/graphql/transform.d.ts +9 -9
  345. package/utilities/graphql/transform.d.ts.map +1 -1
  346. package/utilities/graphql/transform.js +168 -91
  347. package/utilities/graphql/transform.js.map +1 -1
  348. package/utilities/index.d.ts +2 -0
  349. package/utilities/index.d.ts.map +1 -1
  350. package/utilities/index.js +2 -0
  351. package/utilities/index.js.map +1 -1
  352. package/utilities/observables/Concast.d.ts +5 -5
  353. package/utilities/observables/Concast.d.ts.map +1 -1
  354. package/utilities/observables/Concast.js +2 -2
  355. package/utilities/observables/Concast.js.map +1 -1
  356. package/utilities/observables/asyncMap.js.map +1 -1
  357. package/utilities/policies/pagination.d.ts +7 -7
  358. package/utilities/policies/pagination.d.ts.map +1 -1
  359. package/utilities/policies/pagination.js.map +1 -1
  360. package/utilities/promises/decoration.d.ts +15 -0
  361. package/utilities/promises/decoration.d.ts.map +1 -0
  362. package/utilities/promises/decoration.js +25 -0
  363. package/utilities/promises/decoration.js.map +1 -0
  364. package/utilities/types/IsStrictlyAny.d.ts +3 -3
  365. package/utilities/types/IsStrictlyAny.d.ts.map +1 -1
  366. package/utilities/utilities.cjs +256 -128
  367. package/utilities/utilities.cjs.map +1 -1
  368. package/utilities/utilities.cjs.native.js +256 -128
  369. package/version.js +1 -1
  370. package/cache/inmemory/__mocks__/optimism.d.ts +0 -2
  371. package/cache/inmemory/__mocks__/optimism.d.ts.map +0 -1
  372. package/cache/inmemory/__mocks__/optimism.js +0 -14
  373. package/cache/inmemory/__mocks__/optimism.js.map +0 -1
@@ -2,13 +2,16 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- require('../utilities/globals');
5
+ var globals = require('../utilities/globals');
6
6
  var tslib = require('tslib');
7
7
  var React = require('react');
8
8
  var core$1 = require('../core');
9
9
  var cache = require('../cache');
10
10
  var context = require('../react/context');
11
11
  var core = require('./core');
12
+ var trie = require('@wry/trie');
13
+ var utilities = require('../utilities');
14
+ var optimism = require('optimism');
12
15
 
13
16
  function _interopNamespace(e) {
14
17
  if (e && e.__esModule) return e;
@@ -24,49 +27,118 @@ function _interopNamespace(e) {
24
27
 
25
28
  var React__namespace = /*#__PURE__*/_interopNamespace(React);
26
29
 
27
- var SuspenseCache = (function () {
28
- function SuspenseCache() {
29
- this.queries = new Map();
30
+ var NetworkStatus;
31
+ (function (NetworkStatus) {
32
+ NetworkStatus[NetworkStatus["loading"] = 1] = "loading";
33
+ NetworkStatus[NetworkStatus["setVariables"] = 2] = "setVariables";
34
+ NetworkStatus[NetworkStatus["fetchMore"] = 3] = "fetchMore";
35
+ NetworkStatus[NetworkStatus["refetch"] = 4] = "refetch";
36
+ NetworkStatus[NetworkStatus["poll"] = 6] = "poll";
37
+ NetworkStatus[NetworkStatus["ready"] = 7] = "ready";
38
+ NetworkStatus[NetworkStatus["error"] = 8] = "error";
39
+ })(NetworkStatus || (NetworkStatus = {}));
40
+ function isNetworkRequestSettled(networkStatus) {
41
+ return networkStatus === 7 || networkStatus === 8;
42
+ }
43
+
44
+ function wrapWithCustomPromise(concast) {
45
+ return new Promise(function (resolve, reject) {
46
+ var subscription = concast.subscribe({
47
+ next: function (value) {
48
+ resolve(value);
49
+ subscription.unsubscribe();
50
+ },
51
+ error: reject,
52
+ });
53
+ });
54
+ }
55
+ var isMultipartQuery = optimism.wrap(function (query) {
56
+ return utilities.hasAnyDirectives(['defer', 'stream'], query);
57
+ });
58
+ var QuerySubscription = (function () {
59
+ function QuerySubscription(observable, options) {
60
+ if (options === void 0) { options = Object.create(null); }
61
+ var _a;
62
+ this.listeners = new Set();
63
+ this.listen = this.listen.bind(this);
64
+ this.handleNext = this.handleNext.bind(this);
65
+ this.handleError = this.handleError.bind(this);
66
+ this.dispose = this.dispose.bind(this);
67
+ this.observable = observable;
68
+ this.result = observable.getCurrentResult();
69
+ if (options.onDispose) {
70
+ this.onDispose = options.onDispose;
71
+ }
72
+ this.subscription = observable.subscribe({
73
+ next: this.handleNext,
74
+ error: this.handleError,
75
+ });
76
+ globals.__DEV__ ? globals.invariant(observable['concast'], 'Unexpected error: A concast was not found on the observable.') : globals.invariant(observable['concast'], 28);
77
+ var concast = observable['concast'];
78
+ this.promise = isMultipartQuery(observable.query)
79
+ ? wrapWithCustomPromise(concast)
80
+ : concast.promise;
81
+ this.autoDisposeTimeoutId = setTimeout(this.dispose, (_a = options.autoDisposeTimeoutMs) !== null && _a !== void 0 ? _a : 30000);
30
82
  }
31
- SuspenseCache.prototype.add = function (query, variables, _a) {
32
- var promise = _a.promise, observable = _a.observable;
33
- var variablesKey = this.getVariablesKey(variables);
34
- var map = this.queries.get(query) || new Map();
35
- var entry = {
36
- observable: observable,
37
- fulfilled: false,
38
- promise: promise
39
- .catch(function () {
40
- })
41
- .finally(function () {
42
- entry.fulfilled = true;
43
- }),
83
+ QuerySubscription.prototype.listen = function (listener) {
84
+ var _this = this;
85
+ clearTimeout(this.autoDisposeTimeoutId);
86
+ this.listeners.add(listener);
87
+ return function () {
88
+ _this.listeners.delete(listener);
44
89
  };
45
- map.set(variablesKey, entry);
46
- this.queries.set(query, map);
47
- return entry;
48
90
  };
49
- SuspenseCache.prototype.lookup = function (query, variables) {
50
- var _a;
51
- return (_a = this.queries
52
- .get(query)) === null || _a === void 0 ? void 0 : _a.get(this.getVariablesKey(variables));
91
+ QuerySubscription.prototype.refetch = function (variables) {
92
+ this.promise = this.observable.refetch(variables);
93
+ return this.promise;
53
94
  };
54
- SuspenseCache.prototype.remove = function (query, variables) {
55
- var map = this.queries.get(query);
56
- if (!map) {
57
- return;
58
- }
59
- var key = this.getVariablesKey(variables);
60
- var entry = map.get(key);
61
- if (entry && !entry.observable.hasObservers()) {
62
- map.delete(key);
63
- }
64
- if (map.size === 0) {
65
- this.queries.delete(query);
95
+ QuerySubscription.prototype.fetchMore = function (options) {
96
+ this.promise = this.observable.fetchMore(options);
97
+ return this.promise;
98
+ };
99
+ QuerySubscription.prototype.dispose = function () {
100
+ this.subscription.unsubscribe();
101
+ this.onDispose();
102
+ };
103
+ QuerySubscription.prototype.onDispose = function () {
104
+ };
105
+ QuerySubscription.prototype.handleNext = function (result) {
106
+ if (isNetworkRequestSettled(result.networkStatus) &&
107
+ this.result.data &&
108
+ result.data === void 0) {
109
+ result.data = this.result.data;
66
110
  }
111
+ this.result = result;
112
+ this.deliver(result);
113
+ };
114
+ QuerySubscription.prototype.handleError = function (error) {
115
+ var result = tslib.__assign(tslib.__assign({}, this.result), { error: error, networkStatus: core$1.NetworkStatus.error });
116
+ this.result = result;
117
+ this.deliver(result);
118
+ };
119
+ QuerySubscription.prototype.deliver = function (result) {
120
+ this.listeners.forEach(function (listener) { return listener(result); });
67
121
  };
68
- SuspenseCache.prototype.getVariablesKey = function (variables) {
69
- return cache.canonicalStringify(variables || Object.create(null));
122
+ return QuerySubscription;
123
+ }());
124
+
125
+ var SuspenseCache = (function () {
126
+ function SuspenseCache(options) {
127
+ if (options === void 0) { options = Object.create(null); }
128
+ this.cacheKeys = new trie.Trie(utilities.canUseWeakMap, function (cacheKey) { return cacheKey; });
129
+ this.subscriptions = new Map();
130
+ this.options = options;
131
+ }
132
+ SuspenseCache.prototype.getSubscription = function (client, query, variables, createObservable) {
133
+ var _this = this;
134
+ var cacheKey = this.cacheKeys.lookup(client, query, cache.canonicalStringify(variables));
135
+ if (!this.subscriptions.has(cacheKey)) {
136
+ this.subscriptions.set(cacheKey, new QuerySubscription(createObservable(), {
137
+ autoDisposeTimeoutMs: this.options.autoDisposeTimeoutMs,
138
+ onDispose: function () { return _this.subscriptions.delete(cacheKey); },
139
+ }));
140
+ }
141
+ return this.subscriptions.get(cacheKey);
70
142
  };
71
143
  return SuspenseCache;
72
144
  }());
@@ -75,11 +147,11 @@ var MockedProvider = (function (_super) {
75
147
  tslib.__extends(MockedProvider, _super);
76
148
  function MockedProvider(props) {
77
149
  var _this = _super.call(this, props) || this;
78
- var _a = _this.props, mocks = _a.mocks, addTypename = _a.addTypename, defaultOptions = _a.defaultOptions, cache$1 = _a.cache, resolvers = _a.resolvers, link = _a.link, suspenseCache = _a.suspenseCache;
150
+ var _a = _this.props, mocks = _a.mocks, addTypename = _a.addTypename, defaultOptions = _a.defaultOptions, cache$1 = _a.cache, resolvers = _a.resolvers, link = _a.link, suspenseCache = _a.suspenseCache, showWarnings = _a.showWarnings;
79
151
  var client = new core$1.ApolloClient({
80
152
  cache: cache$1 || new cache.InMemoryCache({ addTypename: addTypename }),
81
153
  defaultOptions: defaultOptions,
82
- link: link || new core.MockLink(mocks || [], addTypename),
154
+ link: link || new core.MockLink(mocks || [], addTypename, { showWarnings: showWarnings }),
83
155
  resolvers: resolvers,
84
156
  });
85
157
  _this.state = {
@@ -1,2 +1,3 @@
1
+ export declare const isArray: (a: any) => a is any[] | readonly any[];
1
2
  export declare function isNonEmptyArray<T>(value?: ArrayLike<T>): value is Array<T>;
2
3
  //# sourceMappingURL=arrays.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"arrays.d.ts","sourceRoot":"","sources":["../../../src/utilities/common/arrays.ts"],"names":[],"mappings":"AAAA,wBAAgB,eAAe,CAAC,CAAC,EAAE,KAAK,CAAC,EAAE,SAAS,CAAC,CAAC,CAAC,GAAG,KAAK,IAAI,KAAK,CAAC,CAAC,CAAC,CAE1E"}
1
+ {"version":3,"file":"arrays.d.ts","sourceRoot":"","sources":["../../../src/utilities/common/arrays.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,OAAO,EAAE,CAAC,CAAC,EAAE,GAAG,KAAK,CAAC,IAAI,GAAG,EAAE,GAAG,SAAS,GAAG,EAAkB,CAAC;AAE9E,wBAAgB,eAAe,CAAC,CAAC,EAAE,KAAK,CAAC,EAAE,SAAS,CAAC,CAAC,CAAC,GAAG,KAAK,IAAI,KAAK,CAAC,CAAC,CAAC,CAE1E"}
@@ -1,3 +1,4 @@
1
+ export var isArray = Array.isArray;
1
2
  export function isNonEmptyArray(value) {
2
3
  return Array.isArray(value) && value.length > 0;
3
4
  }
@@ -1 +1 @@
1
- {"version":3,"file":"arrays.js","sourceRoot":"","sources":["../../../src/utilities/common/arrays.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,eAAe,CAAI,KAAoB;IACrD,OAAO,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC;AAClD,CAAC","sourcesContent":["export function isNonEmptyArray<T>(value?: ArrayLike<T>): value is Array<T> {\n return Array.isArray(value) && value.length > 0;\n}\n"]}
1
+ {"version":3,"file":"arrays.js","sourceRoot":"","sources":["../../../src/utilities/common/arrays.ts"],"names":[],"mappings":"AACA,MAAM,CAAC,IAAM,OAAO,GAA4C,KAAK,CAAC,OAAO,CAAC;AAE9E,MAAM,UAAU,eAAe,CAAI,KAAoB;IACrD,OAAO,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC;AAClD,CAAC","sourcesContent":["// A version of Array.isArray that works better with readonly arrays.\nexport const isArray: (a: any) => a is any[] | readonly any[] = Array.isArray;\n\nexport function isNonEmptyArray<T>(value?: ArrayLike<T>): value is Array<T> {\n return Array.isArray(value) && value.length > 0;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"cloneDeep.js","sourceRoot":"","sources":["../../../src/utilities/common/cloneDeep.ts"],"names":[],"mappings":"AAAQ,IAAA,QAAQ,GAAK,MAAM,CAAC,SAAS,SAArB,CAAsB;AAKtC,MAAM,UAAU,SAAS,CAAI,KAAQ;IACnC,OAAO,eAAe,CAAC,KAAK,CAAC,CAAC;AAChC,CAAC;AAED,SAAS,eAAe,CAAI,GAAM,EAAE,IAAoB;IACtD,QAAQ,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE;QAC5B,KAAK,gBAAgB,CAAC,CAAC;YACrB,IAAI,GAAG,IAAI,IAAI,IAAI,GAAG,CAAC;YACvB,IAAI,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC;gBAAE,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;YACxC,IAAM,MAAI,GAAe,GAAW,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;YAC9C,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,MAAI,CAAC,CAAC;YACpB,MAAI,CAAC,OAAO,CAAC,UAAU,KAAK,EAAE,CAAC;gBAC7B,MAAI,CAAC,CAAC,CAAC,GAAG,eAAe,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;YACzC,CAAC,CAAC,CAAC;YACH,OAAO,MAAI,CAAC;SACb;QAED,KAAK,iBAAiB,CAAC,CAAC;YACtB,IAAI,GAAG,IAAI,IAAI,IAAI,GAAG,CAAC;YACvB,IAAI,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC;gBAAE,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;YAGxC,IAAM,MAAI,GAAG,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC,CAAC;YACvD,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,MAAI,CAAC,CAAC;YACpB,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,UAAA,GAAG;gBAC1B,MAAI,CAAC,GAAG,CAAC,GAAG,eAAe,CAAE,GAAW,CAAC,GAAG,CAAC,EAAE,IAAI,CAAC,CAAC;YACvD,CAAC,CAAC,CAAC;YACH,OAAO,MAAI,CAAC;SACb;QAED;YACE,OAAO,GAAG,CAAC;KACZ;AACH,CAAC","sourcesContent":["const { toString } = Object.prototype;\n\n/**\n * Deeply clones a value to create a new instance.\n */\nexport function cloneDeep<T>(value: T): T {\n return cloneDeepHelper(value);\n}\n\nfunction cloneDeepHelper<T>(val: T, seen?: Map<any, any>): T {\n switch (toString.call(val)) {\n case \"[object Array]\": {\n seen = seen || new Map;\n if (seen.has(val)) return seen.get(val);\n const copy: T & any[] = (val as any).slice(0);\n seen.set(val, copy);\n copy.forEach(function (child, i) {\n copy[i] = cloneDeepHelper(child, seen);\n });\n return copy;\n }\n\n case \"[object Object]\": {\n seen = seen || new Map;\n if (seen.has(val)) return seen.get(val);\n // High fidelity polyfills of Object.create and Object.getPrototypeOf are\n // possible in all JS environments, so we will assume they exist/work.\n const copy = Object.create(Object.getPrototypeOf(val));\n seen.set(val, copy);\n Object.keys(val).forEach(key => {\n copy[key] = cloneDeepHelper((val as any)[key], seen);\n });\n return copy;\n }\n\n default:\n return val;\n }\n}\n"]}
1
+ {"version":3,"file":"cloneDeep.js","sourceRoot":"","sources":["../../../src/utilities/common/cloneDeep.ts"],"names":[],"mappings":"AAAQ,IAAA,QAAQ,GAAK,MAAM,CAAC,SAAS,SAArB,CAAsB;AAKtC,MAAM,UAAU,SAAS,CAAI,KAAQ;IACnC,OAAO,eAAe,CAAC,KAAK,CAAC,CAAC;AAChC,CAAC;AAED,SAAS,eAAe,CAAI,GAAM,EAAE,IAAoB;IACtD,QAAQ,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE;QAC5B,KAAK,gBAAgB,CAAC,CAAC;YACrB,IAAI,GAAG,IAAI,IAAI,IAAI,GAAG,CAAC;YACvB,IAAI,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC;gBAAE,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;YACxC,IAAM,MAAI,GAAe,GAAW,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;YAC9C,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,MAAI,CAAC,CAAC;YACpB,MAAI,CAAC,OAAO,CAAC,UAAU,KAAK,EAAE,CAAC;gBAC7B,MAAI,CAAC,CAAC,CAAC,GAAG,eAAe,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;YACzC,CAAC,CAAC,CAAC;YACH,OAAO,MAAI,CAAC;SACb;QAED,KAAK,iBAAiB,CAAC,CAAC;YACtB,IAAI,GAAG,IAAI,IAAI,IAAI,GAAG,CAAC;YACvB,IAAI,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC;gBAAE,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;YAGxC,IAAM,MAAI,GAAG,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC,CAAC;YACvD,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,MAAI,CAAC,CAAC;YACpB,MAAM,CAAC,IAAI,CAAC,GAA8B,CAAC,CAAC,OAAO,CAAC,UAAA,GAAG;gBACrD,MAAI,CAAC,GAAG,CAAC,GAAG,eAAe,CAAE,GAAW,CAAC,GAAG,CAAC,EAAE,IAAI,CAAC,CAAC;YACvD,CAAC,CAAC,CAAC;YACH,OAAO,MAAI,CAAC;SACb;QAED;YACE,OAAO,GAAG,CAAC;KACZ;AACH,CAAC","sourcesContent":["const { toString } = Object.prototype;\n\n/**\n * Deeply clones a value to create a new instance.\n */\nexport function cloneDeep<T>(value: T): T {\n return cloneDeepHelper(value);\n}\n\nfunction cloneDeepHelper<T>(val: T, seen?: Map<any, any>): T {\n switch (toString.call(val)) {\n case \"[object Array]\": {\n seen = seen || new Map;\n if (seen.has(val)) return seen.get(val);\n const copy: T & any[] = (val as any).slice(0);\n seen.set(val, copy);\n copy.forEach(function (child, i) {\n copy[i] = cloneDeepHelper(child, seen);\n });\n return copy;\n }\n\n case \"[object Object]\": {\n seen = seen || new Map;\n if (seen.has(val)) return seen.get(val);\n // High fidelity polyfills of Object.create and Object.getPrototypeOf are\n // possible in all JS environments, so we will assume they exist/work.\n const copy = Object.create(Object.getPrototypeOf(val));\n seen.set(val, copy);\n Object.keys(val as T & Record<string, any>).forEach(key => {\n copy[key] = cloneDeepHelper((val as any)[key], seen);\n });\n return copy;\n }\n\n default:\n return val;\n }\n}\n"]}
@@ -1,4 +1,4 @@
1
1
  import { FetchResult } from "../../link/core";
2
- export declare function graphQLResultHasError(result: FetchResult): boolean;
3
- export declare function getGraphQLErrorsFromResult(result: FetchResult): import("graphql").GraphQLError[];
2
+ export declare function graphQLResultHasError<T>(result: FetchResult<T>): boolean;
3
+ export declare function getGraphQLErrorsFromResult<T>(result: FetchResult<T>): import("graphql").GraphQLError[];
4
4
  //# sourceMappingURL=errorHandling.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"errorHandling.d.ts","sourceRoot":"","sources":["../../../src/utilities/common/errorHandling.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAI9C,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,WAAW,GAAG,OAAO,CAGlE;AAED,wBAAgB,0BAA0B,CAAC,MAAM,EAAE,WAAW,oCAgB7D"}
1
+ {"version":3,"file":"errorHandling.d.ts","sourceRoot":"","sources":["../../../src/utilities/common/errorHandling.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAI9C,wBAAgB,qBAAqB,CAAC,CAAC,EAAE,MAAM,EAAE,WAAW,CAAC,CAAC,CAAC,GAAG,OAAO,CAGxE;AAED,wBAAgB,0BAA0B,CAAC,CAAC,EAAE,MAAM,EAAE,WAAW,CAAC,CAAC,CAAC,oCAgBnE"}
@@ -1 +1 @@
1
- {"version":3,"file":"errorHandling.js","sourceRoot":"","sources":["../../../src/utilities/common/errorHandling.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAChE,OAAO,EAAE,iCAAiC,EAAE,MAAM,0CAA0C,CAAC;AAE7F,MAAM,UAAU,qBAAqB,CAAC,MAAmB;IACvD,IAAM,MAAM,GAAG,0BAA0B,CAAC,MAAM,CAAC,CAAC;IAClD,OAAO,eAAe,CAAC,MAAM,CAAC,CAAC;AACjC,CAAC;AAED,MAAM,UAAU,0BAA0B,CAAC,MAAmB;IAC5D,IAAM,aAAa,GAAG,eAAe,CAAC,MAAM,CAAC,MAAM,CAAC;QAClD,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;QACxB,CAAC,CAAC,EAAE,CAAC;IAEP,IACE,iCAAiC,CAAC,MAAM,CAAC;QACzC,eAAe,CAAC,MAAM,CAAC,WAAW,CAAC,EACnC;QACA,MAAM,CAAC,WAAW,CAAC,OAAO,CAAC,UAAC,iBAAiB;YAC3C,IAAI,iBAAiB,CAAC,MAAM,EAAE;gBAC5B,aAAa,CAAC,IAAI,OAAlB,aAAa,EAAS,iBAAiB,CAAC,MAAM,EAAE;aACjD;QACH,CAAC,CAAC,CAAC;KACJ;IACD,OAAO,aAAa,CAAC;AACvB,CAAC","sourcesContent":["import { FetchResult } from \"../../link/core\";\nimport { isNonEmptyArray } from \"../../utilities/common/arrays\";\nimport { isExecutionPatchIncrementalResult } from \"../../utilities/common/incrementalResult\";\n\nexport function graphQLResultHasError(result: FetchResult): boolean {\n const errors = getGraphQLErrorsFromResult(result);\n return isNonEmptyArray(errors);\n}\n\nexport function getGraphQLErrorsFromResult(result: FetchResult) {\n const graphQLErrors = isNonEmptyArray(result.errors)\n ? result.errors.slice(0)\n : [];\n\n if (\n isExecutionPatchIncrementalResult(result) &&\n isNonEmptyArray(result.incremental)\n ) {\n result.incremental.forEach((incrementalResult) => {\n if (incrementalResult.errors) {\n graphQLErrors.push(...incrementalResult.errors);\n }\n });\n }\n return graphQLErrors;\n}\n"]}
1
+ {"version":3,"file":"errorHandling.js","sourceRoot":"","sources":["../../../src/utilities/common/errorHandling.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAChE,OAAO,EAAE,iCAAiC,EAAE,MAAM,0CAA0C,CAAC;AAE7F,MAAM,UAAU,qBAAqB,CAAI,MAAsB;IAC7D,IAAM,MAAM,GAAG,0BAA0B,CAAC,MAAM,CAAC,CAAC;IAClD,OAAO,eAAe,CAAC,MAAM,CAAC,CAAC;AACjC,CAAC;AAED,MAAM,UAAU,0BAA0B,CAAI,MAAsB;IAClE,IAAM,aAAa,GAAG,eAAe,CAAC,MAAM,CAAC,MAAM,CAAC;QAClD,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;QACxB,CAAC,CAAC,EAAE,CAAC;IAEP,IACE,iCAAiC,CAAC,MAAM,CAAC;QACzC,eAAe,CAAC,MAAM,CAAC,WAAW,CAAC,EACnC;QACA,MAAM,CAAC,WAAW,CAAC,OAAO,CAAC,UAAC,iBAAiB;YAC3C,IAAI,iBAAiB,CAAC,MAAM,EAAE;gBAC5B,aAAa,CAAC,IAAI,OAAlB,aAAa,EAAS,iBAAiB,CAAC,MAAM,EAAE;aACjD;QACH,CAAC,CAAC,CAAC;KACJ;IACD,OAAO,aAAa,CAAC;AACvB,CAAC","sourcesContent":["import { FetchResult } from \"../../link/core\";\nimport { isNonEmptyArray } from \"../../utilities/common/arrays\";\nimport { isExecutionPatchIncrementalResult } from \"../../utilities/common/incrementalResult\";\n\nexport function graphQLResultHasError<T>(result: FetchResult<T>): boolean {\n const errors = getGraphQLErrorsFromResult(result);\n return isNonEmptyArray(errors);\n}\n\nexport function getGraphQLErrorsFromResult<T>(result: FetchResult<T>) {\n const graphQLErrors = isNonEmptyArray(result.errors)\n ? result.errors.slice(0)\n : [];\n\n if (\n isExecutionPatchIncrementalResult(result) &&\n isNonEmptyArray(result.incremental)\n ) {\n result.incremental.forEach((incrementalResult) => {\n if (incrementalResult.errors) {\n graphQLErrors.push(...incrementalResult.errors);\n }\n });\n }\n return graphQLErrors;\n}\n"]}
@@ -1,6 +1,6 @@
1
1
  import { ExecutionPatchIncrementalResult, ExecutionPatchInitialResult, ExecutionPatchResult, FetchResult } from "../../link/core";
2
- export declare function isExecutionPatchIncrementalResult(value: FetchResult): value is ExecutionPatchIncrementalResult;
3
- export declare function isExecutionPatchInitialResult(value: FetchResult): value is ExecutionPatchInitialResult;
4
- export declare function isExecutionPatchResult(value: FetchResult): value is ExecutionPatchResult;
5
- export declare function mergeIncrementalData<TData>(prevResult: TData, result: ExecutionPatchResult<TData>): TData;
2
+ export declare function isExecutionPatchIncrementalResult<T>(value: FetchResult<T>): value is ExecutionPatchIncrementalResult;
3
+ export declare function isExecutionPatchInitialResult<T>(value: FetchResult<T>): value is ExecutionPatchInitialResult<T>;
4
+ export declare function isExecutionPatchResult<T>(value: FetchResult<T>): value is ExecutionPatchResult<T>;
5
+ export declare function mergeIncrementalData<TData extends object>(prevResult: TData, result: ExecutionPatchResult<TData>): TData;
6
6
  //# sourceMappingURL=incrementalResult.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"incrementalResult.d.ts","sourceRoot":"","sources":["../../../src/utilities/common/incrementalResult.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,+BAA+B,EAC/B,2BAA2B,EAC3B,oBAAoB,EACpB,WAAW,EACZ,MAAM,iBAAiB,CAAC;AAIzB,wBAAgB,iCAAiC,CAC/C,KAAK,EAAE,WAAW,GACjB,KAAK,IAAI,+BAA+B,CAE1C;AAED,wBAAgB,6BAA6B,CAC3C,KAAK,EAAE,WAAW,GACjB,KAAK,IAAI,2BAA2B,CAEtC;AAED,wBAAgB,sBAAsB,CACpC,KAAK,EAAE,WAAW,GACjB,KAAK,IAAI,oBAAoB,CAK/B;AAED,wBAAgB,oBAAoB,CAAC,KAAK,EACxC,UAAU,EAAE,KAAK,EACjB,MAAM,EAAE,oBAAoB,CAAC,KAAK,CAAC,SAoBpC"}
1
+ {"version":3,"file":"incrementalResult.d.ts","sourceRoot":"","sources":["../../../src/utilities/common/incrementalResult.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,+BAA+B,EAC/B,2BAA2B,EAC3B,oBAAoB,EACpB,WAAW,EACZ,MAAM,iBAAiB,CAAC;AAIzB,wBAAgB,iCAAiC,CAAC,CAAC,EACjD,KAAK,EAAE,WAAW,CAAC,CAAC,CAAC,GACpB,KAAK,IAAI,+BAA+B,CAE1C;AAED,wBAAgB,6BAA6B,CAAC,CAAC,EAC7C,KAAK,EAAE,WAAW,CAAC,CAAC,CAAC,GACpB,KAAK,IAAI,2BAA2B,CAAC,CAAC,CAAC,CAEzC;AAED,wBAAgB,sBAAsB,CAAC,CAAC,EACtC,KAAK,EAAE,WAAW,CAAC,CAAC,CAAC,GACpB,KAAK,IAAI,oBAAoB,CAAC,CAAC,CAAC,CAKlC;AAED,wBAAgB,oBAAoB,CAAC,KAAK,SAAS,MAAM,EACvD,UAAU,EAAE,KAAK,EACjB,MAAM,EAAE,oBAAoB,CAAC,KAAK,CAAC,SAoBpC"}
@@ -1 +1 @@
1
- {"version":3,"file":"incrementalResult.js","sourceRoot":"","sources":["../../../src/utilities/common/incrementalResult.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAC3C,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzC,MAAM,UAAU,iCAAiC,CAC/C,KAAkB;IAElB,OAAO,aAAa,IAAI,KAAK,CAAC;AAChC,CAAC;AAED,MAAM,UAAU,6BAA6B,CAC3C,KAAkB;IAElB,OAAO,SAAS,IAAI,KAAK,IAAI,MAAM,IAAI,KAAK,CAAC;AAC/C,CAAC;AAED,MAAM,UAAU,sBAAsB,CACpC,KAAkB;IAElB,OAAO,CACL,iCAAiC,CAAC,KAAK,CAAC;QACxC,6BAA6B,CAAC,KAAK,CAAC,CACrC,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,oBAAoB,CAClC,UAAiB,EACjB,MAAmC;IAEnC,IAAI,UAAU,GAAG,UAAU,CAAC;IAC5B,IAAM,MAAM,GAAG,IAAI,UAAU,EAAE,CAAC;IAChC,IACE,iCAAiC,CAAC,MAAM,CAAC;QACzC,eAAe,CAAC,MAAM,CAAC,WAAW,CAAC,EACnC;QACA,MAAM,CAAC,WAAW,CAAC,OAAO,CAAC,UAAC,EAAc;gBAAZ,IAAI,UAAA,EAAE,IAAI,UAAA;YACtC,KAAK,IAAI,CAAC,GAAG,IAAI,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,EAAE,CAAC,EAAE;gBACzC,IAAM,GAAG,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;gBACpB,IAAM,YAAY,GAAG,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC;gBAClC,IAAM,QAAM,GAAiC,YAAY,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;gBACpE,QAAM,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC;gBACnB,IAAI,GAAG,QAAqB,CAAC;aAC9B;YACD,UAAU,GAAG,MAAM,CAAC,KAAK,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC;QAC9C,CAAC,CAAC,CAAC;KACJ;IACD,OAAO,UAAmB,CAAC;AAC7B,CAAC","sourcesContent":["import {\n ExecutionPatchIncrementalResult,\n ExecutionPatchInitialResult,\n ExecutionPatchResult,\n FetchResult,\n} from \"../../link/core\";\nimport { isNonEmptyArray } from \"./arrays\";\nimport { DeepMerger } from \"./mergeDeep\";\n\nexport function isExecutionPatchIncrementalResult(\n value: FetchResult\n): value is ExecutionPatchIncrementalResult {\n return \"incremental\" in value;\n}\n\nexport function isExecutionPatchInitialResult(\n value: FetchResult\n): value is ExecutionPatchInitialResult {\n return \"hasNext\" in value && \"data\" in value;\n}\n\nexport function isExecutionPatchResult(\n value: FetchResult\n): value is ExecutionPatchResult {\n return (\n isExecutionPatchIncrementalResult(value) ||\n isExecutionPatchInitialResult(value)\n );\n}\n\nexport function mergeIncrementalData<TData>(\n prevResult: TData,\n result: ExecutionPatchResult<TData>\n) {\n let mergedData = prevResult;\n const merger = new DeepMerger();\n if (\n isExecutionPatchIncrementalResult(result) &&\n isNonEmptyArray(result.incremental)\n ) {\n result.incremental.forEach(({ data, path }) => {\n for (let i = path.length - 1; i >= 0; --i) {\n const key = path[i];\n const isNumericKey = !isNaN(+key);\n const parent: Record<string | number, any> = isNumericKey ? [] : {};\n parent[key] = data;\n data = parent as typeof data;\n }\n mergedData = merger.merge(mergedData, data);\n });\n }\n return mergedData as TData;\n}\n"]}
1
+ {"version":3,"file":"incrementalResult.js","sourceRoot":"","sources":["../../../src/utilities/common/incrementalResult.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAC3C,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzC,MAAM,UAAU,iCAAiC,CAC/C,KAAqB;IAErB,OAAO,aAAa,IAAI,KAAK,CAAC;AAChC,CAAC;AAED,MAAM,UAAU,6BAA6B,CAC3C,KAAqB;IAErB,OAAO,SAAS,IAAI,KAAK,IAAI,MAAM,IAAI,KAAK,CAAC;AAC/C,CAAC;AAED,MAAM,UAAU,sBAAsB,CACpC,KAAqB;IAErB,OAAO,CACL,iCAAiC,CAAC,KAAK,CAAC;QACxC,6BAA6B,CAAC,KAAK,CAAC,CACrC,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,oBAAoB,CAClC,UAAiB,EACjB,MAAmC;IAEnC,IAAI,UAAU,GAAG,UAAU,CAAC;IAC5B,IAAM,MAAM,GAAG,IAAI,UAAU,EAAE,CAAC;IAChC,IACE,iCAAiC,CAAC,MAAM,CAAC;QACzC,eAAe,CAAC,MAAM,CAAC,WAAW,CAAC,EACnC;QACA,MAAM,CAAC,WAAW,CAAC,OAAO,CAAC,UAAC,EAAc;gBAAZ,IAAI,UAAA,EAAE,IAAI,UAAA;YACtC,KAAK,IAAI,CAAC,GAAG,IAAI,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,EAAE,CAAC,EAAE;gBACzC,IAAM,GAAG,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;gBACpB,IAAM,YAAY,GAAG,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC;gBAClC,IAAM,QAAM,GAAiC,YAAY,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;gBACpE,QAAM,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC;gBACnB,IAAI,GAAG,QAAqB,CAAC;aAC9B;YACD,UAAU,GAAG,MAAM,CAAC,KAAK,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC;QAC9C,CAAC,CAAC,CAAC;KACJ;IACD,OAAO,UAAmB,CAAC;AAC7B,CAAC","sourcesContent":["import {\n ExecutionPatchIncrementalResult,\n ExecutionPatchInitialResult,\n ExecutionPatchResult,\n FetchResult,\n} from \"../../link/core\";\nimport { isNonEmptyArray } from \"./arrays\";\nimport { DeepMerger } from \"./mergeDeep\";\n\nexport function isExecutionPatchIncrementalResult<T>(\n value: FetchResult<T>\n): value is ExecutionPatchIncrementalResult {\n return \"incremental\" in value;\n}\n\nexport function isExecutionPatchInitialResult<T>(\n value: FetchResult<T>\n): value is ExecutionPatchInitialResult<T> {\n return \"hasNext\" in value && \"data\" in value;\n}\n\nexport function isExecutionPatchResult<T>(\n value: FetchResult<T>\n): value is ExecutionPatchResult<T> {\n return (\n isExecutionPatchIncrementalResult(value) ||\n isExecutionPatchInitialResult(value)\n );\n}\n\nexport function mergeIncrementalData<TData extends object>(\n prevResult: TData,\n result: ExecutionPatchResult<TData>\n) {\n let mergedData = prevResult;\n const merger = new DeepMerger();\n if (\n isExecutionPatchIncrementalResult(result) &&\n isNonEmptyArray(result.incremental)\n ) {\n result.incremental.forEach(({ data, path }) => {\n for (let i = path.length - 1; i >= 0; --i) {\n const key = path[i];\n const isNumericKey = !isNaN(+key);\n const parent: Record<string | number, any> = isNumericKey ? [] : {};\n parent[key] = data;\n data = parent as typeof data;\n }\n mergedData = merger.merge(mergedData, data);\n });\n }\n return mergedData as TData;\n}\n"]}
@@ -1,3 +1,2 @@
1
- import '../globals';
2
1
  export declare function maybeDeepFreeze<T>(obj: T): T;
3
2
  //# sourceMappingURL=maybeDeepFreeze.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"maybeDeepFreeze.d.ts","sourceRoot":"","sources":["../../../src/utilities/common/maybeDeepFreeze.ts"],"names":[],"mappings":"AAAA,OAAO,YAAY,CAAC;AA8BpB,wBAAgB,eAAe,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,CAK5C"}
1
+ {"version":3,"file":"maybeDeepFreeze.d.ts","sourceRoot":"","sources":["../../../src/utilities/common/maybeDeepFreeze.ts"],"names":[],"mappings":"AA8BA,wBAAgB,eAAe,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,CAK5C"}
@@ -1,4 +1,4 @@
1
- import "../globals/index.js";
1
+ import { __DEV__ } from "../globals/index.js";
2
2
  import { isNonNullObject } from "./objects.js";
3
3
  function deepFreeze(value) {
4
4
  var workSet = new Set([value]);
@@ -1 +1 @@
1
- {"version":3,"file":"maybeDeepFreeze.js","sourceRoot":"","sources":["../../../src/utilities/common/maybeDeepFreeze.ts"],"names":[],"mappings":"AAAA,OAAO,YAAY,CAAC;AACpB,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAE5C,SAAS,UAAU,CAAC,KAAU;IAC5B,IAAM,OAAO,GAAG,IAAI,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC;IACjC,OAAO,CAAC,OAAO,CAAC,UAAA,GAAG;QACjB,IAAI,eAAe,CAAC,GAAG,CAAC,IAAI,aAAa,CAAC,GAAG,CAAC,KAAK,GAAG,EAAE;YACtD,MAAM,CAAC,mBAAmB,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,UAAA,IAAI;gBAC1C,IAAI,eAAe,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;oBAAE,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC;YACzD,CAAC,CAAC,CAAC;SACJ;IACH,CAAC,CAAC,CAAC;IACH,OAAO,KAAK,CAAC;AACf,CAAC;AAED,SAAS,aAAa,CAAmB,GAAM;IAC7C,IAAI,OAAO,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE;QACpC,IAAI;YACF,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;SACpB;QAAC,OAAO,CAAC,EAAE;YAIV,IAAI,CAAC,YAAY,SAAS;gBAAE,OAAO,IAAI,CAAC;YACxC,MAAM,CAAC,CAAC;SACT;KACF;IACD,OAAO,GAAG,CAAC;AACb,CAAC;AAED,MAAM,UAAU,eAAe,CAAI,GAAM;IACvC,IAAI,OAAO,EAAE;QACX,UAAU,CAAC,GAAG,CAAC,CAAC;KACjB;IACD,OAAO,GAAG,CAAC;AACb,CAAC","sourcesContent":["import '../globals'; // For __DEV__\nimport { isNonNullObject } from './objects';\n\nfunction deepFreeze(value: any) {\n const workSet = new Set([value]);\n workSet.forEach(obj => {\n if (isNonNullObject(obj) && shallowFreeze(obj) === obj) {\n Object.getOwnPropertyNames(obj).forEach(name => {\n if (isNonNullObject(obj[name])) workSet.add(obj[name]);\n });\n }\n });\n return value;\n}\n\nfunction shallowFreeze<T extends object>(obj: T): T | null {\n if (__DEV__ && !Object.isFrozen(obj)) {\n try {\n Object.freeze(obj);\n } catch (e) {\n // Some types like Uint8Array and Node.js's Buffer cannot be frozen, but\n // they all throw a TypeError when you try, so we re-throw any exceptions\n // that are not TypeErrors, since that would be unexpected.\n if (e instanceof TypeError) return null;\n throw e;\n }\n }\n return obj;\n}\n\nexport function maybeDeepFreeze<T>(obj: T): T {\n if (__DEV__) {\n deepFreeze(obj);\n }\n return obj;\n}\n"]}
1
+ {"version":3,"file":"maybeDeepFreeze.js","sourceRoot":"","sources":["../../../src/utilities/common/maybeDeepFreeze.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACrC,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAE5C,SAAS,UAAU,CAAC,KAAU;IAC5B,IAAM,OAAO,GAAG,IAAI,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC;IACjC,OAAO,CAAC,OAAO,CAAC,UAAA,GAAG;QACjB,IAAI,eAAe,CAAC,GAAG,CAAC,IAAI,aAAa,CAAC,GAAG,CAAC,KAAK,GAAG,EAAE;YACtD,MAAM,CAAC,mBAAmB,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,UAAA,IAAI;gBAC1C,IAAI,eAAe,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;oBAAE,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC;YACzD,CAAC,CAAC,CAAC;SACJ;IACH,CAAC,CAAC,CAAC;IACH,OAAO,KAAK,CAAC;AACf,CAAC;AAED,SAAS,aAAa,CAAmB,GAAM;IAC7C,IAAI,OAAO,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE;QACpC,IAAI;YACF,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;SACpB;QAAC,OAAO,CAAC,EAAE;YAIV,IAAI,CAAC,YAAY,SAAS;gBAAE,OAAO,IAAI,CAAC;YACxC,MAAM,CAAC,CAAC;SACT;KACF;IACD,OAAO,GAAG,CAAC;AACb,CAAC;AAED,MAAM,UAAU,eAAe,CAAI,GAAM;IACvC,IAAI,OAAO,EAAE;QACX,UAAU,CAAC,GAAG,CAAC,CAAC;KACjB;IACD,OAAO,GAAG,CAAC;AACb,CAAC","sourcesContent":["import { __DEV__ } from '../globals';\nimport { isNonNullObject } from './objects';\n\nfunction deepFreeze(value: any) {\n const workSet = new Set([value]);\n workSet.forEach(obj => {\n if (isNonNullObject(obj) && shallowFreeze(obj) === obj) {\n Object.getOwnPropertyNames(obj).forEach(name => {\n if (isNonNullObject(obj[name])) workSet.add(obj[name]);\n });\n }\n });\n return value;\n}\n\nfunction shallowFreeze<T extends object>(obj: T): T | null {\n if (__DEV__ && !Object.isFrozen(obj)) {\n try {\n Object.freeze(obj);\n } catch (e) {\n // Some types like Uint8Array and Node.js's Buffer cannot be frozen, but\n // they all throw a TypeError when you try, so we re-throw any exceptions\n // that are not TypeErrors, since that would be unexpected.\n if (e instanceof TypeError) return null;\n throw e;\n }\n }\n return obj;\n}\n\nexport function maybeDeepFreeze<T>(obj: T): T {\n if (__DEV__) {\n deepFreeze(obj);\n }\n return obj;\n}\n"]}
@@ -1,8 +1,8 @@
1
1
  import { isNonNullObject } from "./objects";
2
- export declare type TupleToIntersection<T extends any[]> = T extends [infer A] ? A : T extends [infer A, infer B] ? A & B : T extends [infer A, infer B, infer C] ? A & B & C : T extends [infer A, infer B, infer C, infer D] ? A & B & C & D : T extends [infer A, infer B, infer C, infer D, infer E] ? A & B & C & D & E : T extends (infer U)[] ? U : any;
2
+ export type TupleToIntersection<T extends any[]> = T extends [infer A] ? A : T extends [infer A, infer B] ? A & B : T extends [infer A, infer B, infer C] ? A & B & C : T extends [infer A, infer B, infer C, infer D] ? A & B & C & D : T extends [infer A, infer B, infer C, infer D, infer E] ? A & B & C & D & E : T extends (infer U)[] ? U : any;
3
3
  export declare function mergeDeep<T extends any[]>(...sources: T): TupleToIntersection<T>;
4
4
  export declare function mergeDeepArray<T>(sources: T[]): T;
5
- export declare type ReconcilerFunction<TContextArgs extends any[]> = (this: DeepMerger<TContextArgs>, target: Record<string | number, any>, source: Record<string | number, any>, property: string | number, ...context: TContextArgs) => any;
5
+ export type ReconcilerFunction<TContextArgs extends any[]> = (this: DeepMerger<TContextArgs>, target: Record<string | number, any>, source: Record<string | number, any>, property: string | number, ...context: TContextArgs) => any;
6
6
  export declare class DeepMerger<TContextArgs extends any[]> {
7
7
  private reconciler;
8
8
  constructor(reconciler?: ReconcilerFunction<TContextArgs>);
@@ -1 +1 @@
1
- {"version":3,"file":"mergeDeep.d.ts","sourceRoot":"","sources":["../../../src/utilities/common/mergeDeep.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAkB5C,oBAAY,mBAAmB,CAAC,CAAC,SAAS,GAAG,EAAE,IAC7C,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,GACvB,CAAC,SAAS,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,GACpC,CAAC,SAAS,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,EAAE,MAAM,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GACjD,CAAC,SAAS,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,EAAE,MAAM,CAAC,EAAE,MAAM,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAC9D,CAAC,SAAS,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,EAAE,MAAM,CAAC,EAAE,MAAM,CAAC,EAAE,MAAM,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAC3E,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,EAAE,GAAG,CAAC,GAAG,GAAG,CAAC;AAElC,wBAAgB,SAAS,CAAC,CAAC,SAAS,GAAG,EAAE,EACvC,GAAG,OAAO,EAAE,CAAC,GACZ,mBAAmB,CAAC,CAAC,CAAC,CAExB;AAQD,wBAAgB,cAAc,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,GAAG,CAAC,CAUjD;AAED,oBAAY,kBAAkB,CAAC,YAAY,SAAS,GAAG,EAAE,IAAI,CAC3D,IAAI,EAAE,UAAU,CAAC,YAAY,CAAC,EAC9B,MAAM,EAAE,MAAM,CAAC,MAAM,GAAG,MAAM,EAAE,GAAG,CAAC,EACpC,MAAM,EAAE,MAAM,CAAC,MAAM,GAAG,MAAM,EAAE,GAAG,CAAC,EACpC,QAAQ,EAAE,MAAM,GAAG,MAAM,EACzB,GAAG,OAAO,EAAE,YAAY,KACrB,GAAG,CAAC;AAOT,qBAAa,UAAU,CAAC,YAAY,SAAS,GAAG,EAAE;IAE9C,OAAO,CAAC,UAAU;gBAAV,UAAU,GAAE,kBAAkB,CAAC,YAAY,CAAqB;IAGnE,KAAK,CAAC,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,GAAG,OAAO,EAAE,YAAY,GAAG,GAAG;IA6B9D,QAAQ,yBAAmB;IAElC,OAAO,CAAC,UAAU,CAAkB;IAE7B,mBAAmB,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,CAAC;CAgB3C"}
1
+ {"version":3,"file":"mergeDeep.d.ts","sourceRoot":"","sources":["../../../src/utilities/common/mergeDeep.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAkB5C,MAAM,MAAM,mBAAmB,CAAC,CAAC,SAAS,GAAG,EAAE,IAC7C,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,GACvB,CAAC,SAAS,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,GACpC,CAAC,SAAS,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,EAAE,MAAM,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GACjD,CAAC,SAAS,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,EAAE,MAAM,CAAC,EAAE,MAAM,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAC9D,CAAC,SAAS,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,EAAE,MAAM,CAAC,EAAE,MAAM,CAAC,EAAE,MAAM,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAC3E,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,EAAE,GAAG,CAAC,GAAG,GAAG,CAAC;AAElC,wBAAgB,SAAS,CAAC,CAAC,SAAS,GAAG,EAAE,EACvC,GAAG,OAAO,EAAE,CAAC,GACZ,mBAAmB,CAAC,CAAC,CAAC,CAExB;AAQD,wBAAgB,cAAc,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,GAAG,CAAC,CAUjD;AAED,MAAM,MAAM,kBAAkB,CAAC,YAAY,SAAS,GAAG,EAAE,IAAI,CAC3D,IAAI,EAAE,UAAU,CAAC,YAAY,CAAC,EAC9B,MAAM,EAAE,MAAM,CAAC,MAAM,GAAG,MAAM,EAAE,GAAG,CAAC,EACpC,MAAM,EAAE,MAAM,CAAC,MAAM,GAAG,MAAM,EAAE,GAAG,CAAC,EACpC,QAAQ,EAAE,MAAM,GAAG,MAAM,EACzB,GAAG,OAAO,EAAE,YAAY,KACrB,GAAG,CAAC;AAOT,qBAAa,UAAU,CAAC,YAAY,SAAS,GAAG,EAAE;IAE9C,OAAO,CAAC,UAAU;gBAAV,UAAU,GAAE,kBAAkB,CAAC,YAAY,CAAqB;IAGnE,KAAK,CAAC,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,GAAG,OAAO,EAAE,YAAY,GAAG,GAAG;IA6B9D,QAAQ,yBAAmB;IAElC,OAAO,CAAC,UAAU,CAAkB;IAE7B,mBAAmB,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,CAAC;CAgB3C"}
@@ -1,5 +1,5 @@
1
- import type { QueryOptions, WatchQueryOptions, MutationOptions } from "../../core";
2
- declare type OptionsUnion<TData, TVariables, TContext> = WatchQueryOptions<TVariables, TData> | QueryOptions<TVariables, TData> | MutationOptions<TData, TVariables, TContext>;
3
- export declare function mergeOptions<TOptions extends OptionsUnion<any, any, any>>(defaults: TOptions | Partial<TOptions> | undefined, options: TOptions | Partial<TOptions>): TOptions;
1
+ import type { QueryOptions, WatchQueryOptions, MutationOptions, OperationVariables } from "../../core";
2
+ type OptionsUnion<TData, TVariables extends OperationVariables, TContext> = WatchQueryOptions<TVariables, TData> | QueryOptions<TVariables, TData> | MutationOptions<TData, TVariables, TContext>;
3
+ export declare function mergeOptions<TOptions extends Partial<OptionsUnion<any, any, any>>>(defaults: TOptions | Partial<TOptions> | undefined, options: TOptions | Partial<TOptions>): TOptions;
4
4
  export {};
5
5
  //# sourceMappingURL=mergeOptions.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"mergeOptions.d.ts","sourceRoot":"","sources":["../../../src/utilities/common/mergeOptions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,YAAY,EACZ,iBAAiB,EACjB,eAAe,EAChB,MAAM,YAAY,CAAC;AAIpB,aAAK,YAAY,CAAC,KAAK,EAAE,UAAU,EAAE,QAAQ,IACzC,iBAAiB,CAAC,UAAU,EAAE,KAAK,CAAC,GACpC,YAAY,CAAC,UAAU,EAAE,KAAK,CAAC,GAC/B,eAAe,CAAC,KAAK,EAAE,UAAU,EAAE,QAAQ,CAAC,CAAC;AAEjD,wBAAgB,YAAY,CAC1B,QAAQ,SAAS,YAAY,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,EAE5C,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAC,GAAG,SAAS,EAClD,OAAO,EAAE,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAC,GACpC,QAAQ,CAOV"}
1
+ {"version":3,"file":"mergeOptions.d.ts","sourceRoot":"","sources":["../../../src/utilities/common/mergeOptions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,YAAY,EACZ,iBAAiB,EACjB,eAAe,EACf,kBAAkB,EACnB,MAAM,YAAY,CAAC;AAIpB,KAAK,YAAY,CAAC,KAAK,EAAE,UAAU,SAAS,kBAAkB,EAAE,QAAQ,IACpE,iBAAiB,CAAC,UAAU,EAAE,KAAK,CAAC,GACpC,YAAY,CAAC,UAAU,EAAE,KAAK,CAAC,GAC/B,eAAe,CAAC,KAAK,EAAE,UAAU,EAAE,QAAQ,CAAC,CAAC;AAEjD,wBAAgB,YAAY,CAC1B,QAAQ,SAAS,OAAO,CAAC,YAAY,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC,EAErD,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAC,GAAG,SAAS,EAClD,OAAO,EAAE,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAC,GACpC,QAAQ,CAOV"}
@@ -2,7 +2,7 @@ import { __assign } from "tslib";
2
2
  import { compact } from "./compact.js";
3
3
  export function mergeOptions(defaults, options) {
4
4
  return compact(defaults, options, options.variables && {
5
- variables: __assign(__assign({}, (defaults && defaults.variables)), options.variables),
5
+ variables: compact(__assign(__assign({}, (defaults && defaults.variables)), options.variables)),
6
6
  });
7
7
  }
8
8
  //# sourceMappingURL=mergeOptions.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"mergeOptions.js","sourceRoot":"","sources":["../../../src/utilities/common/mergeOptions.ts"],"names":[],"mappings":";AAMA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAOpC,MAAM,UAAU,YAAY,CAG1B,QAAkD,EAClD,OAAqC;IAErC,OAAO,OAAO,CAAC,QAAQ,EAAE,OAAO,EAAE,OAAO,CAAC,SAAS,IAAI;QACrD,SAAS,wBACJ,CAAC,QAAQ,IAAI,QAAQ,CAAC,SAAS,CAAC,GAChC,OAAO,CAAC,SAAS,CACrB;KACF,CAAC,CAAC;AACL,CAAC","sourcesContent":["import type {\n QueryOptions,\n WatchQueryOptions,\n MutationOptions,\n} from \"../../core\";\n\nimport { compact } from \"./compact\";\n\ntype OptionsUnion<TData, TVariables, TContext> =\n | WatchQueryOptions<TVariables, TData>\n | QueryOptions<TVariables, TData>\n | MutationOptions<TData, TVariables, TContext>;\n\nexport function mergeOptions<\n TOptions extends OptionsUnion<any, any, any>\n>(\n defaults: TOptions | Partial<TOptions> | undefined,\n options: TOptions | Partial<TOptions>,\n): TOptions {\n return compact(defaults, options, options.variables && {\n variables: {\n ...(defaults && defaults.variables),\n ...options.variables,\n },\n });\n}\n"]}
1
+ {"version":3,"file":"mergeOptions.js","sourceRoot":"","sources":["../../../src/utilities/common/mergeOptions.ts"],"names":[],"mappings":";AAOA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAOpC,MAAM,UAAU,YAAY,CAG1B,QAAkD,EAClD,OAAqC;IAErC,OAAO,OAAO,CAAC,QAAQ,EAAE,OAAO,EAAE,OAAO,CAAC,SAAS,IAAI;QACrD,SAAS,EAAE,OAAO,uBACb,CAAC,QAAQ,IAAI,QAAQ,CAAC,SAAS,CAAC,GAChC,OAAO,CAAC,SAAS,EACpB;KACH,CAAC,CAAC;AACL,CAAC","sourcesContent":["import type {\n QueryOptions,\n WatchQueryOptions,\n MutationOptions,\n OperationVariables,\n} from \"../../core\";\n\nimport { compact } from \"./compact\";\n\ntype OptionsUnion<TData, TVariables extends OperationVariables, TContext> =\n | WatchQueryOptions<TVariables, TData>\n | QueryOptions<TVariables, TData>\n | MutationOptions<TData, TVariables, TContext>;\n\nexport function mergeOptions<\n TOptions extends Partial<OptionsUnion<any, any, any>>\n>(\n defaults: TOptions | Partial<TOptions> | undefined,\n options: TOptions | Partial<TOptions>,\n): TOptions {\n return compact(defaults, options, options.variables && {\n variables: compact({\n ...(defaults && defaults.variables),\n ...options.variables,\n }),\n });\n}\n"]}
@@ -1,3 +1,3 @@
1
- declare const _default: any;
1
+ declare const _default: boolean;
2
2
  export default _default;
3
3
  //# sourceMappingURL=DEV.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"DEV.d.ts","sourceRoot":"","sources":["../../../src/utilities/globals/DEV.ts"],"names":[],"mappings":";AA4BA,wBAAwB"}
1
+ {"version":3,"file":"DEV.d.ts","sourceRoot":"","sources":["../../../src/utilities/globals/DEV.ts"],"names":[],"mappings":";AAGA,wBAgBE"}
@@ -1,20 +1,4 @@
1
1
  import global from "./global.js";
2
2
  import { maybe } from "./maybe.js";
3
- var __ = "__";
4
- var GLOBAL_KEY = [__, __].join("DEV");
5
- function getDEV() {
6
- try {
7
- return Boolean(__DEV__);
8
- }
9
- catch (_a) {
10
- Object.defineProperty(global, GLOBAL_KEY, {
11
- value: maybe(function () { return process.env.NODE_ENV; }) !== "production",
12
- enumerable: false,
13
- configurable: true,
14
- writable: true,
15
- });
16
- return global[GLOBAL_KEY];
17
- }
18
- }
19
- export default getDEV();
3
+ export default ("__DEV__" in global ? Boolean(global.__DEV__) : maybe(function () { return process.env.NODE_ENV; }) !== "production");
20
4
  //# sourceMappingURL=DEV.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"DEV.js","sourceRoot":"","sources":["../../../src/utilities/globals/DEV.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,UAAU,CAAC;AAC9B,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAKhC,IAAM,EAAE,GAAG,IAAI,CAAC;AAChB,IAAM,UAAU,GAAG,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AAExC,SAAS,MAAM;IACb,IAAI;QACF,OAAO,OAAO,CAAC,OAAO,CAAC,CAAC;KACzB;IAAC,WAAM;QACN,MAAM,CAAC,cAAc,CAAC,MAAM,EAAE,UAAU,EAAE;YAIxC,KAAK,EAAE,KAAK,CAAC,cAAM,OAAA,OAAO,CAAC,GAAG,CAAC,QAAQ,EAApB,CAAoB,CAAC,KAAK,YAAY;YACzD,UAAU,EAAE,KAAK;YACjB,YAAY,EAAE,IAAI;YAClB,QAAQ,EAAE,IAAI;SACf,CAAC,CAAC;QAGH,OAAQ,MAAc,CAAC,UAAU,CAAC,CAAC;KACpC;AACH,CAAC;AAED,eAAe,MAAM,EAAE,CAAC","sourcesContent":["import global from \"./global\";\nimport { maybe } from \"./maybe\";\n\n// To keep string-based find/replace minifiers from messing with __DEV__ inside\n// string literals or properties like global.__DEV__, we construct the \"__DEV__\"\n// string in a roundabout way that won't be altered by find/replace strategies.\nconst __ = \"__\";\nconst GLOBAL_KEY = [__, __].join(\"DEV\");\n\nfunction getDEV() {\n try {\n return Boolean(__DEV__);\n } catch {\n Object.defineProperty(global, GLOBAL_KEY, {\n // In a buildless browser environment, maybe(() => process.env.NODE_ENV)\n // evaluates as undefined, so __DEV__ becomes true by default, but can be\n // initialized to false instead by a script/module that runs earlier.\n value: maybe(() => process.env.NODE_ENV) !== \"production\",\n enumerable: false,\n configurable: true,\n writable: true,\n });\n // Using computed property access rather than global.__DEV__ here prevents\n // string-based find/replace strategies from munging this to global.false:\n return (global as any)[GLOBAL_KEY];\n }\n}\n\nexport default getDEV();\n"]}
1
+ {"version":3,"file":"DEV.js","sourceRoot":"","sources":["../../../src/utilities/globals/DEV.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,UAAU,CAAC;AAC9B,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAEhC,eAAe,CACb,SAAS,IAAI,MAAM;IAKjB,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC;IASzB,CAAC,CAAC,KAAK,CAAC,cAAM,OAAA,OAAO,CAAC,GAAG,CAAC,QAAQ,EAApB,CAAoB,CAAC,KAAK,YAAY,CACvD,CAAC","sourcesContent":["import global from \"./global\";\nimport { maybe } from \"./maybe\";\n\nexport default (\n \"__DEV__\" in global\n // We want it to be possible to set __DEV__ globally to control the result\n // of this code, so it's important to check global.__DEV__ instead of\n // assuming a naked reference like __DEV__ refers to global scope, since\n // those references could be replaced with true or false by minifiers.\n ? Boolean(global.__DEV__)\n\n // In a buildless browser environment, maybe(() => process.env.NODE_ENV)\n // evaluates to undefined, so __DEV__ becomes true by default, but can be\n // initialized to false instead by a script/module that runs earlier.\n //\n // If you use tooling to replace process.env.NODE_ENV with a string like\n // \"development\", this code will become something like maybe(() =>\n // \"development\") !== \"production\", which also works as expected.\n : maybe(() => process.env.NODE_ENV) !== \"production\"\n);\n"]}
@@ -1,2 +1,5 @@
1
- declare const _default: typeof globalThis;
2
- export default _default;
1
+ declare const _default: typeof globalThis & {
2
+ __DEV__?: boolean | undefined;
3
+ };
4
+ export default _default;
5
+ //# sourceMappingURL=global.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"global.d.ts","sourceRoot":"","sources":["../../../src/utilities/globals/global.ts"],"names":[],"mappings":"AAEA,OAAO,CAAC,MAAM,CAAC;IAiBb,MAAM,OAAO,EAAE,OAAO,GAAG,SAAS,CAAC;CACpC;;aAeU,cAAc;;AAbzB,wBAcE"}
1
+ {"version":3,"file":"global.d.ts","sourceRoot":"","sources":["../../../src/utilities/globals/global.ts"],"names":[],"mappings":";;;AAEA,wBAcE"}
@@ -1 +1 @@
1
- {"version":3,"file":"global.js","sourceRoot":"","sources":["../../../src/utilities/globals/global.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAsBhC,eAAe,CACb,KAAK,CAAC,cAAM,OAAA,UAAU,EAAV,CAAU,CAAC;IACvB,KAAK,CAAC,cAAM,OAAA,MAAM,EAAN,CAAM,CAAC;IACnB,KAAK,CAAC,cAAM,OAAA,IAAI,EAAJ,CAAI,CAAC;IACjB,KAAK,CAAC,cAAM,OAAA,MAAM,EAAN,CAAM,CAAC;IAOnB,KAAK,CAAC,cAAa,OAAO,KAAK,CAAC,WAAW,CAAC,aAAa,CAAC,EAAE,CAAA,CAAC,CAAC,CAAC,CAGhE,CAAC","sourcesContent":["import { maybe } from \"./maybe\";\n\ndeclare global {\n // Despite our attempts to reuse the React Native __DEV__ constant instead of\n // inventing something new and Apollo-specific, declaring a useful type for\n // __DEV__ unfortunately conflicts (TS2451) with the global declaration in\n // @types/react-native/index.d.ts.\n //\n // To hide that harmless conflict, we @ts-ignore this line, which should\n // continue to provide a type for __DEV__ elsewhere in the Apollo Client\n // codebase, even when @types/react-native is not in use.\n //\n // However, because TypeScript drops @ts-ignore comments when generating .d.ts\n // files (https://github.com/microsoft/TypeScript/issues/38628), we also\n // sanitize the dist/utilities/globals/global.d.ts file to avoid declaring\n // __DEV__ globally altogether when @apollo/client is installed in the\n // node_modules directory of an application.\n //\n // @ts-ignore\n const __DEV__: boolean | undefined;\n}\n\nexport default (\n maybe(() => globalThis) ||\n maybe(() => window) ||\n maybe(() => self) ||\n maybe(() => global) ||\n // We don't expect the Function constructor ever to be invoked at runtime, as\n // long as at least one of globalThis, window, self, or global is defined, so\n // we are under no obligation to make it easy for static analysis tools to\n // detect syntactic usage of the Function constructor. If you think you can\n // improve your static analysis to detect this obfuscation, think again. This\n // is an arms race you cannot win, at least not in JavaScript.\n maybe(function() { return maybe.constructor(\"return this\")() })\n) as typeof globalThis & {\n __DEV__: typeof __DEV__;\n};\n"]}
1
+ {"version":3,"file":"global.js","sourceRoot":"","sources":["../../../src/utilities/globals/global.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAEhC,eAAe,CACb,KAAK,CAAC,cAAM,OAAA,UAAU,EAAV,CAAU,CAAC;IACvB,KAAK,CAAC,cAAM,OAAA,MAAM,EAAN,CAAM,CAAC;IACnB,KAAK,CAAC,cAAM,OAAA,IAAI,EAAJ,CAAI,CAAC;IACjB,KAAK,CAAC,cAAM,OAAA,MAAM,EAAN,CAAM,CAAC;IAOnB,KAAK,CAAC,cAAa,OAAO,KAAK,CAAC,WAAW,CAAC,aAAa,CAAC,EAAE,CAAA,CAAC,CAAC,CAAC,CAGhE,CAAC","sourcesContent":["import { maybe } from \"./maybe\";\n\nexport default (\n maybe(() => globalThis) ||\n maybe(() => window) ||\n maybe(() => self) ||\n maybe(() => global) ||\n // We don't expect the Function constructor ever to be invoked at runtime, as\n // long as at least one of globalThis, window, self, or global is defined, so\n // we are under no obligation to make it easy for static analysis tools to\n // detect syntactic usage of the Function constructor. If you think you can\n // improve your static analysis to detect this obfuscation, think again. This\n // is an arms race you cannot win, at least not in JavaScript.\n maybe(function() { return maybe.constructor(\"return this\")() })\n) as typeof globalThis & {\n __DEV__?: boolean;\n};\n"]}
@@ -19,38 +19,21 @@ var global$1 = (maybe(function () { return globalThis; }) ||
19
19
  maybe(function () { return global; }) ||
20
20
  maybe(function () { return maybe.constructor("return this")(); }));
21
21
 
22
- var __ = "__";
23
- var GLOBAL_KEY = [__, __].join("DEV");
24
- function getDEV() {
25
- try {
26
- return Boolean(__DEV__);
27
- }
28
- catch (_a) {
29
- Object.defineProperty(global$1, GLOBAL_KEY, {
30
- value: maybe(function () { return process.env.NODE_ENV; }) !== "production",
31
- enumerable: false,
32
- configurable: true,
33
- writable: true,
34
- });
35
- return global$1[GLOBAL_KEY];
36
- }
37
- }
38
- var DEV = getDEV();
22
+ var DEV = ("__DEV__" in global$1
23
+ ? Boolean(global$1.__DEV__)
24
+ : maybe(function () { return process.env.NODE_ENV; }) !== "production");
39
25
 
40
26
  function removeTemporaryGlobals() {
41
27
  return typeof graphql.Source === "function" ? process$1.remove() : process$1.remove();
42
28
  }
43
29
 
44
- function checkDEV() {
45
- __DEV__ ? tsInvariant.invariant("boolean" === typeof DEV, DEV) : tsInvariant.invariant("boolean" === typeof DEV, 40);
46
- }
30
+ var __DEV__ = DEV;
47
31
  removeTemporaryGlobals();
48
- checkDEV();
49
32
 
50
33
  exports.InvariantError = tsInvariant.InvariantError;
51
34
  exports.invariant = tsInvariant.invariant;
52
35
  exports.DEV = DEV;
53
- exports.checkDEV = checkDEV;
36
+ exports.__DEV__ = __DEV__;
54
37
  exports.global = global$1;
55
38
  exports.maybe = maybe;
56
39
  //# sourceMappingURL=globals.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"globals.cjs","sources":["maybe.js","global.js","DEV.js","fix-graphql.js","index.js"],"sourcesContent":["export function maybe(thunk) {\n try {\n return thunk();\n }\n catch (_a) { }\n}\n//# sourceMappingURL=maybe.js.map","import { maybe } from \"./maybe\";\nexport default (maybe(function () { return globalThis; }) ||\n maybe(function () { return window; }) ||\n maybe(function () { return self; }) ||\n maybe(function () { return global; }) ||\n maybe(function () { return maybe.constructor(\"return this\")(); }));\n//# sourceMappingURL=global.js.map","import global from \"./global\";\nimport { maybe } from \"./maybe\";\nvar __ = \"__\";\nvar GLOBAL_KEY = [__, __].join(\"DEV\");\nfunction getDEV() {\n try {\n return Boolean(__DEV__);\n }\n catch (_a) {\n Object.defineProperty(global, GLOBAL_KEY, {\n value: maybe(function () { return process.env.NODE_ENV; }) !== \"production\",\n enumerable: false,\n configurable: true,\n writable: true,\n });\n return global[GLOBAL_KEY];\n }\n}\nexport default getDEV();\n//# sourceMappingURL=DEV.js.map","import { remove } from 'ts-invariant/process';\nimport { Source } from 'graphql';\nexport function removeTemporaryGlobals() {\n return typeof Source === \"function\" ? remove() : remove();\n}\n//# sourceMappingURL=fix-graphql.js.map","import { invariant, InvariantError } from \"ts-invariant\";\nimport DEV from \"./DEV\";\nexport { DEV };\nexport function checkDEV() {\n __DEV__ ? invariant(\"boolean\" === typeof DEV, DEV) : invariant(\"boolean\" === typeof DEV, 40);\n}\nimport { removeTemporaryGlobals } from \"./fix-graphql\";\nremoveTemporaryGlobals();\nexport { maybe } from \"./maybe\";\nexport { default as global } from \"./global\";\nexport { invariant, InvariantError };\ncheckDEV();\n//# sourceMappingURL=index.js.map"],"names":["global","Source","remove","invariant"],"mappings":";;;;;;;;AAAO,SAAS,KAAK,CAAC,KAAK,EAAE;AAC7B,IAAI,IAAI;AACR,QAAQ,OAAO,KAAK,EAAE,CAAC;AACvB,KAAK;AACL,IAAI,OAAO,EAAE,EAAE,GAAG;AAClB;;ACJA,eAAe,CAAC,KAAK,CAAC,YAAY,EAAE,OAAO,UAAU,CAAC,EAAE,CAAC;AACzD,IAAI,KAAK,CAAC,YAAY,EAAE,OAAO,MAAM,CAAC,EAAE,CAAC;AACzC,IAAI,KAAK,CAAC,YAAY,EAAE,OAAO,IAAI,CAAC,EAAE,CAAC;AACvC,IAAI,KAAK,CAAC,YAAY,EAAE,OAAO,MAAM,CAAC,EAAE,CAAC;AACzC,IAAI,KAAK,CAAC,YAAY,EAAE,OAAO,KAAK,CAAC,WAAW,CAAC,aAAa,CAAC,EAAE,CAAC,EAAE,CAAC;;ACHrE,IAAI,EAAE,GAAG,IAAI,CAAC;AACd,IAAI,UAAU,GAAG,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AACtC,SAAS,MAAM,GAAG;AAClB,IAAI,IAAI;AACR,QAAQ,OAAO,OAAO,CAAC,OAAO,CAAC,CAAC;AAChC,KAAK;AACL,IAAI,OAAO,EAAE,EAAE;AACf,QAAQ,MAAM,CAAC,cAAc,CAACA,QAAM,EAAE,UAAU,EAAE;AAClD,YAAY,KAAK,EAAE,KAAK,CAAC,YAAY,EAAE,OAAO,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE,CAAC,KAAK,YAAY;AACvF,YAAY,UAAU,EAAE,KAAK;AAC7B,YAAY,YAAY,EAAE,IAAI;AAC9B,YAAY,QAAQ,EAAE,IAAI;AAC1B,SAAS,CAAC,CAAC;AACX,QAAQ,OAAOA,QAAM,CAAC,UAAU,CAAC,CAAC;AAClC,KAAK;AACL,CAAC;AACD,UAAe,MAAM,EAAE;;AChBhB,SAAS,sBAAsB,GAAG;AACzC,IAAI,OAAO,OAAOC,cAAM,KAAK,UAAU,GAAGC,gBAAM,EAAE,GAAGA,gBAAM,EAAE,CAAC;AAC9D;;ACDO,SAAS,QAAQ,GAAG;AAC3B,IAAI,OAAO,GAAGC,qBAAS,CAAC,SAAS,KAAK,OAAO,GAAG,EAAE,GAAG,CAAC,GAAGA,qBAAS,CAAC,SAAS,KAAK,OAAO,GAAG,EAAE,EAAE,CAAC,CAAC;AACjG,CAAC;AAED,sBAAsB,EAAE,CAAC;AAIzB,QAAQ,EAAE;;;;;;;;;"}
1
+ {"version":3,"file":"globals.cjs","sources":["maybe.js","global.js","DEV.js","fix-graphql.js","index.js"],"sourcesContent":["export function maybe(thunk) {\n try {\n return thunk();\n }\n catch (_a) { }\n}\n//# sourceMappingURL=maybe.js.map","import { maybe } from \"./maybe\";\nexport default (maybe(function () { return globalThis; }) ||\n maybe(function () { return window; }) ||\n maybe(function () { return self; }) ||\n maybe(function () { return global; }) ||\n maybe(function () { return maybe.constructor(\"return this\")(); }));\n//# sourceMappingURL=global.js.map","import global from \"./global\";\nimport { maybe } from \"./maybe\";\nexport default (\"__DEV__\" in global\n ? Boolean(global.__DEV__)\n : maybe(function () { return process.env.NODE_ENV; }) !== \"production\");\n//# sourceMappingURL=DEV.js.map","import { remove } from 'ts-invariant/process';\nimport { Source } from 'graphql';\nexport function removeTemporaryGlobals() {\n return typeof Source === \"function\" ? remove() : remove();\n}\n//# sourceMappingURL=fix-graphql.js.map","import { invariant, InvariantError } from \"ts-invariant\";\nimport DEV from \"./DEV\";\nexport { DEV };\nexport var __DEV__ = DEV;\nimport { removeTemporaryGlobals } from \"./fix-graphql\";\nremoveTemporaryGlobals();\nexport { maybe } from \"./maybe\";\nexport { default as global } from \"./global\";\nexport { invariant, InvariantError };\n//# sourceMappingURL=index.js.map"],"names":["global","Source","remove"],"mappings":";;;;;;;;AAAO,SAAS,KAAK,CAAC,KAAK,EAAE;AAC7B,IAAI,IAAI;AACR,QAAQ,OAAO,KAAK,EAAE,CAAC;AACvB,KAAK;AACL,IAAI,OAAO,EAAE,EAAE,GAAG;AAClB;;ACJA,eAAe,CAAC,KAAK,CAAC,YAAY,EAAE,OAAO,UAAU,CAAC,EAAE,CAAC;AACzD,IAAI,KAAK,CAAC,YAAY,EAAE,OAAO,MAAM,CAAC,EAAE,CAAC;AACzC,IAAI,KAAK,CAAC,YAAY,EAAE,OAAO,IAAI,CAAC,EAAE,CAAC;AACvC,IAAI,KAAK,CAAC,YAAY,EAAE,OAAO,MAAM,CAAC,EAAE,CAAC;AACzC,IAAI,KAAK,CAAC,YAAY,EAAE,OAAO,KAAK,CAAC,WAAW,CAAC,aAAa,CAAC,EAAE,CAAC,EAAE,CAAC;;ACHrE,UAAe,CAAC,SAAS,IAAIA,QAAM;AACnC,MAAM,OAAO,CAACA,QAAM,CAAC,OAAO,CAAC;AAC7B,MAAM,KAAK,CAAC,YAAY,EAAE,OAAO,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE,CAAC,KAAK,YAAY;;ACFnE,SAAS,sBAAsB,GAAG;AACzC,IAAI,OAAO,OAAOC,cAAM,KAAK,UAAU,GAAGC,gBAAM,EAAE,GAAGA,gBAAM,EAAE,CAAC;AAC9D;;ACDU,IAAC,OAAO,GAAG,IAAI;AAEzB,sBAAsB,EAAE;;;;;;;;;"}
@@ -19,38 +19,21 @@ var global$1 = (maybe(function () { return globalThis; }) ||
19
19
  maybe(function () { return global; }) ||
20
20
  maybe(function () { return maybe.constructor("return this")(); }));
21
21
 
22
- var __ = "__";
23
- var GLOBAL_KEY = [__, __].join("DEV");
24
- function getDEV() {
25
- try {
26
- return Boolean(__DEV__);
27
- }
28
- catch (_a) {
29
- Object.defineProperty(global$1, GLOBAL_KEY, {
30
- value: maybe(function () { return process.env.NODE_ENV; }) !== "production",
31
- enumerable: false,
32
- configurable: true,
33
- writable: true,
34
- });
35
- return global$1[GLOBAL_KEY];
36
- }
37
- }
38
- var DEV = getDEV();
22
+ var DEV = ("__DEV__" in global$1
23
+ ? Boolean(global$1.__DEV__)
24
+ : maybe(function () { return process.env.NODE_ENV; }) !== "production");
39
25
 
40
26
  function removeTemporaryGlobals() {
41
27
  return typeof graphql.Source === "function" ? process$1.remove() : process$1.remove();
42
28
  }
43
29
 
44
- function checkDEV() {
45
- __DEV__ ? tsInvariant.invariant("boolean" === typeof DEV, DEV) : tsInvariant.invariant("boolean" === typeof DEV, 40);
46
- }
30
+ var __DEV__ = DEV;
47
31
  removeTemporaryGlobals();
48
- checkDEV();
49
32
 
50
33
  exports.InvariantError = tsInvariant.InvariantError;
51
34
  exports.invariant = tsInvariant.invariant;
52
35
  exports.DEV = DEV;
53
- exports.checkDEV = checkDEV;
36
+ exports.__DEV__ = __DEV__;
54
37
  exports.global = global$1;
55
38
  exports.maybe = maybe;
56
39
  //# sourceMappingURL=globals.cjs.map
@@ -1,7 +1,7 @@
1
1
  import { invariant, InvariantError } from "ts-invariant";
2
2
  import DEV from "./DEV";
3
3
  export { DEV };
4
- export declare function checkDEV(): void;
4
+ export declare const __DEV__: boolean;
5
5
  export { maybe } from "./maybe";
6
6
  export { default as global } from "./global";
7
7
  export { invariant, InvariantError };
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utilities/globals/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAIzD,OAAO,GAAG,MAAM,OAAO,CAAC;AACxB,OAAO,EAAE,GAAG,EAAE,CAAA;AACd,wBAAgB,QAAQ,SAEvB;AAUD,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,UAAU,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utilities/globals/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAIzD,OAAO,GAAG,MAAM,OAAO,CAAC;AACxB,OAAO,EAAE,GAAG,EAAE,CAAC;AACf,eAAO,MAAM,OAAO,SAAM,CAAC;AAU3B,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,UAAU,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,CAAA"}
@@ -1,13 +1,10 @@
1
1
  import { invariant, InvariantError } from "ts-invariant";
2
2
  import DEV from "./DEV.js";
3
3
  export { DEV };
4
- export function checkDEV() {
5
- __DEV__ ? invariant("boolean" === typeof DEV, DEV) : invariant("boolean" === typeof DEV, 40);
6
- }
4
+ export var __DEV__ = DEV;
7
5
  import { removeTemporaryGlobals } from "./fix-graphql.js";
8
6
  removeTemporaryGlobals();
9
7
  export { maybe } from "./maybe.js";
10
8
  export { default as global } from "./global.js";
11
9
  export { invariant, InvariantError };
12
- checkDEV();
13
10
  //# sourceMappingURL=index.js.map