@apollo/client 3.5.0-beta.9 → 3.5.0-rc.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (367) hide show
  1. package/README.md +10 -8
  2. package/apollo-client.cjs +875 -753
  3. package/apollo-client.cjs.map +1 -1
  4. package/apollo-client.min.cjs +1 -0
  5. package/cache/cache.cjs +715 -607
  6. package/cache/cache.cjs.map +1 -1
  7. package/cache/core/cache.d.ts +5 -5
  8. package/cache/core/cache.d.ts.map +1 -1
  9. package/cache/core/cache.js +24 -13
  10. package/cache/core/cache.js.map +1 -1
  11. package/cache/core/types/Cache.d.ts +13 -10
  12. package/cache/core/types/Cache.d.ts.map +1 -1
  13. package/cache/core/types/Cache.js.map +1 -1
  14. package/cache/core/types/DataProxy.js.map +1 -1
  15. package/cache/core/types/common.d.ts +8 -5
  16. package/cache/core/types/common.d.ts.map +1 -1
  17. package/cache/core/types/common.js +6 -11
  18. package/cache/core/types/common.js.map +1 -1
  19. package/cache/index.d.ts +4 -3
  20. package/cache/index.d.ts.map +1 -1
  21. package/cache/index.js +3 -4
  22. package/cache/index.js.map +1 -1
  23. package/cache/inmemory/entityStore.d.ts +1 -1
  24. package/cache/inmemory/entityStore.d.ts.map +1 -1
  25. package/cache/inmemory/entityStore.js +4 -4
  26. package/cache/inmemory/entityStore.js.map +1 -1
  27. package/cache/inmemory/helpers.d.ts +10 -1
  28. package/cache/inmemory/helpers.d.ts.map +1 -1
  29. package/cache/inmemory/helpers.js +31 -1
  30. package/cache/inmemory/helpers.js.map +1 -1
  31. package/cache/inmemory/inMemoryCache.d.ts +7 -13
  32. package/cache/inmemory/inMemoryCache.d.ts.map +1 -1
  33. package/cache/inmemory/inMemoryCache.js +20 -19
  34. package/cache/inmemory/inMemoryCache.js.map +1 -1
  35. package/cache/inmemory/key-extractor.d.ts +9 -0
  36. package/cache/inmemory/key-extractor.d.ts.map +1 -0
  37. package/cache/inmemory/key-extractor.js +118 -0
  38. package/cache/inmemory/key-extractor.js.map +1 -0
  39. package/cache/inmemory/object-canon.d.ts +1 -0
  40. package/cache/inmemory/object-canon.d.ts.map +1 -1
  41. package/cache/inmemory/object-canon.js +1 -0
  42. package/cache/inmemory/object-canon.js.map +1 -1
  43. package/cache/inmemory/policies.d.ts +13 -10
  44. package/cache/inmemory/policies.d.ts.map +1 -1
  45. package/cache/inmemory/policies.js +48 -175
  46. package/cache/inmemory/policies.js.map +1 -1
  47. package/cache/inmemory/readFromStore.d.ts +3 -2
  48. package/cache/inmemory/readFromStore.d.ts.map +1 -1
  49. package/cache/inmemory/readFromStore.js +60 -45
  50. package/cache/inmemory/readFromStore.js.map +1 -1
  51. package/cache/inmemory/types.d.ts +8 -1
  52. package/cache/inmemory/types.d.ts.map +1 -1
  53. package/cache/inmemory/types.js.map +1 -1
  54. package/cache/inmemory/writeToStore.d.ts +8 -3
  55. package/cache/inmemory/writeToStore.d.ts.map +1 -1
  56. package/cache/inmemory/writeToStore.js +164 -93
  57. package/cache/inmemory/writeToStore.js.map +1 -1
  58. package/core/ApolloClient.d.ts.map +1 -1
  59. package/core/ApolloClient.js +9 -5
  60. package/core/ApolloClient.js.map +1 -1
  61. package/core/LocalState.d.ts.map +1 -1
  62. package/core/LocalState.js +2 -2
  63. package/core/LocalState.js.map +1 -1
  64. package/core/ObservableQuery.d.ts +2 -1
  65. package/core/ObservableQuery.d.ts.map +1 -1
  66. package/core/ObservableQuery.js +15 -9
  67. package/core/ObservableQuery.js.map +1 -1
  68. package/core/QueryInfo.d.ts.map +1 -1
  69. package/core/QueryInfo.js +2 -2
  70. package/core/QueryInfo.js.map +1 -1
  71. package/core/QueryManager.d.ts +2 -3
  72. package/core/QueryManager.d.ts.map +1 -1
  73. package/core/QueryManager.js +17 -19
  74. package/core/QueryManager.js.map +1 -1
  75. package/core/core.cjs +60 -53
  76. package/core/core.cjs.map +1 -1
  77. package/core/index.d.ts.map +1 -1
  78. package/core/index.js +1 -2
  79. package/core/index.js.map +1 -1
  80. package/core/watchQueryOptions.js.map +1 -1
  81. package/errors/errors.cjs +1 -1
  82. package/errors/errors.cjs.map +1 -1
  83. package/errors/index.d.ts +4 -1
  84. package/errors/index.d.ts.map +1 -1
  85. package/errors/index.js +1 -2
  86. package/errors/index.js.map +1 -1
  87. package/invariantErrorCodes.js +56 -69
  88. package/link/batch-http/batch-http.cjs +2 -2
  89. package/link/batch-http/batch-http.cjs.map +1 -1
  90. package/link/batch-http/batchHttpLink.d.ts.map +1 -1
  91. package/link/batch-http/batchHttpLink.js +3 -3
  92. package/link/batch-http/batchHttpLink.js.map +1 -1
  93. package/link/core/ApolloLink.js +2 -2
  94. package/link/core/ApolloLink.js.map +1 -1
  95. package/link/core/core.cjs +4 -6
  96. package/link/core/core.cjs.map +1 -1
  97. package/link/core/index.d.ts +1 -0
  98. package/link/core/index.d.ts.map +1 -1
  99. package/link/core/index.js +1 -2
  100. package/link/core/index.js.map +1 -1
  101. package/link/error/error.cjs +1 -1
  102. package/link/error/error.cjs.map +1 -1
  103. package/link/error/index.d.ts +5 -6
  104. package/link/error/index.d.ts.map +1 -1
  105. package/link/error/index.js +1 -1
  106. package/link/error/index.js.map +1 -1
  107. package/link/http/checkFetcher.js +2 -2
  108. package/link/http/checkFetcher.js.map +1 -1
  109. package/link/http/createHttpLink.d.ts +1 -0
  110. package/link/http/createHttpLink.d.ts.map +1 -1
  111. package/link/http/createHttpLink.js +4 -3
  112. package/link/http/createHttpLink.js.map +1 -1
  113. package/link/http/http.cjs +12 -12
  114. package/link/http/http.cjs.map +1 -1
  115. package/link/http/index.d.ts +2 -1
  116. package/link/http/index.d.ts.map +1 -1
  117. package/link/http/index.js +2 -3
  118. package/link/http/index.js.map +1 -1
  119. package/link/http/selectHttpOptionsAndBody.d.ts +7 -1
  120. package/link/http/selectHttpOptionsAndBody.d.ts.map +1 -1
  121. package/link/http/selectHttpOptionsAndBody.js +6 -4
  122. package/link/http/selectHttpOptionsAndBody.js.map +1 -1
  123. package/link/http/serializeFetchParameter.d.ts +1 -1
  124. package/link/http/serializeFetchParameter.d.ts.map +1 -1
  125. package/link/http/serializeFetchParameter.js +2 -2
  126. package/link/http/serializeFetchParameter.js.map +1 -1
  127. package/link/persisted-queries/index.d.ts +1 -1
  128. package/link/persisted-queries/index.d.ts.map +1 -1
  129. package/link/persisted-queries/index.js +4 -6
  130. package/link/persisted-queries/index.js.map +1 -1
  131. package/link/persisted-queries/persisted-queries.cjs +9 -7
  132. package/link/persisted-queries/persisted-queries.cjs.map +1 -1
  133. package/link/utils/index.d.ts +1 -0
  134. package/link/utils/index.d.ts.map +1 -1
  135. package/link/utils/index.js +1 -2
  136. package/link/utils/index.js.map +1 -1
  137. package/link/utils/toPromise.d.ts.map +1 -1
  138. package/link/utils/toPromise.js +1 -1
  139. package/link/utils/toPromise.js.map +1 -1
  140. package/link/utils/utils.cjs +3 -5
  141. package/link/utils/utils.cjs.map +1 -1
  142. package/link/utils/validateOperation.d.ts.map +1 -1
  143. package/link/utils/validateOperation.js +2 -2
  144. package/link/utils/validateOperation.js.map +1 -1
  145. package/package.json +17 -18
  146. package/react/context/ApolloConsumer.d.ts.map +1 -1
  147. package/react/context/ApolloConsumer.js +2 -2
  148. package/react/context/ApolloConsumer.js.map +1 -1
  149. package/react/context/ApolloContext.d.ts.map +1 -1
  150. package/react/context/ApolloContext.js +11 -5
  151. package/react/context/ApolloContext.js.map +1 -1
  152. package/react/context/ApolloProvider.d.ts.map +1 -1
  153. package/react/context/ApolloProvider.js +2 -2
  154. package/react/context/ApolloProvider.js.map +1 -1
  155. package/react/context/context.cjs +16 -12
  156. package/react/context/context.cjs.map +1 -1
  157. package/react/context/index.d.ts +1 -0
  158. package/react/context/index.d.ts.map +1 -1
  159. package/react/context/index.js +1 -2
  160. package/react/context/index.js.map +1 -1
  161. package/react/hoc/hoc-utils.d.ts.map +1 -1
  162. package/react/hoc/hoc-utils.js +2 -2
  163. package/react/hoc/hoc-utils.js.map +1 -1
  164. package/react/hoc/hoc.cjs +13 -13
  165. package/react/hoc/hoc.cjs.map +1 -1
  166. package/react/hoc/index.d.ts +1 -0
  167. package/react/hoc/index.d.ts.map +1 -1
  168. package/react/hoc/index.js +1 -2
  169. package/react/hoc/index.js.map +1 -1
  170. package/react/hoc/subscription-hoc.d.ts.map +1 -1
  171. package/react/hoc/subscription-hoc.js +8 -5
  172. package/react/hoc/subscription-hoc.js.map +1 -1
  173. package/react/hoc/withApollo.d.ts.map +1 -1
  174. package/react/hoc/withApollo.js +2 -2
  175. package/react/hoc/withApollo.js.map +1 -1
  176. package/react/hooks/hooks.cjs +25 -10
  177. package/react/hooks/hooks.cjs.map +1 -1
  178. package/react/hooks/index.d.ts +1 -0
  179. package/react/hooks/index.d.ts.map +1 -1
  180. package/react/hooks/index.js +1 -2
  181. package/react/hooks/index.js.map +1 -1
  182. package/react/hooks/useApolloClient.js +2 -2
  183. package/react/hooks/useApolloClient.js.map +1 -1
  184. package/react/hooks/useLazyQuery.d.ts.map +1 -1
  185. package/react/hooks/useLazyQuery.js +19 -4
  186. package/react/hooks/useLazyQuery.js.map +1 -1
  187. package/react/hooks/useMutation.d.ts.map +1 -1
  188. package/react/hooks/useMutation.js +4 -1
  189. package/react/hooks/useMutation.js.map +1 -1
  190. package/react/hooks/useQuery.d.ts +1 -1
  191. package/react/hooks/useQuery.d.ts.map +1 -1
  192. package/react/hooks/useQuery.js +1 -1
  193. package/react/hooks/useQuery.js.map +1 -1
  194. package/react/hooks/useSubscription.d.ts +1 -0
  195. package/react/hooks/useSubscription.d.ts.map +1 -1
  196. package/react/hooks/useSubscription.js +1 -0
  197. package/react/hooks/useSubscription.js.map +1 -1
  198. package/react/index.d.ts +1 -0
  199. package/react/index.d.ts.map +1 -1
  200. package/react/index.js +1 -2
  201. package/react/index.js.map +1 -1
  202. package/react/parser/index.d.ts.map +1 -1
  203. package/react/parser/index.js +6 -8
  204. package/react/parser/index.js.map +1 -1
  205. package/react/parser/parser.cjs +12 -14
  206. package/react/parser/parser.cjs.map +1 -1
  207. package/react/react.cjs +2 -2
  208. package/react/react.cjs.map +1 -1
  209. package/react/types/types.d.ts +2 -1
  210. package/react/types/types.d.ts.map +1 -1
  211. package/react/types/types.js.map +1 -1
  212. package/testing/core/core.cjs +288 -0
  213. package/testing/core/core.cjs.map +1 -0
  214. package/{utilities/testing → testing/core}/index.d.ts +0 -1
  215. package/testing/core/index.d.ts.map +1 -0
  216. package/{utilities/testing → testing/core}/index.js +0 -1
  217. package/testing/core/index.js.map +1 -0
  218. package/{utilities/testing → testing/core}/itAsync.d.ts +0 -0
  219. package/testing/core/itAsync.d.ts.map +1 -0
  220. package/{utilities/testing → testing/core}/itAsync.js +0 -0
  221. package/testing/core/itAsync.js.map +1 -0
  222. package/{utilities/testing → testing/core}/mocking/mockClient.d.ts +0 -0
  223. package/testing/core/mocking/mockClient.d.ts.map +1 -0
  224. package/{utilities/testing → testing/core}/mocking/mockClient.js +0 -0
  225. package/testing/core/mocking/mockClient.js.map +1 -0
  226. package/{utilities/testing → testing/core}/mocking/mockFetch.d.ts +0 -0
  227. package/testing/core/mocking/mockFetch.d.ts.map +1 -0
  228. package/{utilities/testing → testing/core}/mocking/mockFetch.js +1 -1
  229. package/testing/core/mocking/mockFetch.js.map +1 -0
  230. package/{utilities/testing → testing/core}/mocking/mockLink.d.ts +0 -0
  231. package/testing/core/mocking/mockLink.d.ts.map +1 -0
  232. package/{utilities/testing → testing/core}/mocking/mockLink.js +3 -3
  233. package/testing/core/mocking/mockLink.js.map +1 -0
  234. package/{utilities/testing → testing/core}/mocking/mockQueryManager.d.ts +1 -1
  235. package/testing/core/mocking/mockQueryManager.d.ts.map +1 -0
  236. package/{utilities/testing → testing/core}/mocking/mockQueryManager.js +1 -1
  237. package/testing/core/mocking/mockQueryManager.js.map +1 -0
  238. package/{utilities/testing → testing/core}/mocking/mockSubscriptionLink.d.ts +0 -0
  239. package/testing/core/mocking/mockSubscriptionLink.d.ts.map +1 -0
  240. package/{utilities/testing → testing/core}/mocking/mockSubscriptionLink.js +1 -1
  241. package/testing/core/mocking/mockSubscriptionLink.js.map +1 -0
  242. package/{utilities/testing → testing/core}/mocking/mockWatchQuery.d.ts +1 -1
  243. package/testing/core/mocking/mockWatchQuery.d.ts.map +1 -0
  244. package/{utilities/testing → testing/core}/mocking/mockWatchQuery.js +1 -1
  245. package/testing/core/mocking/mockWatchQuery.js.map +1 -0
  246. package/{utilities/testing → testing/core}/observableToPromise.d.ts +2 -3
  247. package/testing/core/observableToPromise.d.ts.map +1 -0
  248. package/{utilities/testing → testing/core}/observableToPromise.js +1 -1
  249. package/testing/core/observableToPromise.js.map +1 -0
  250. package/testing/core/package.json +8 -0
  251. package/testing/core/subscribeAndCount.d.ts +4 -0
  252. package/testing/core/subscribeAndCount.d.ts.map +1 -0
  253. package/{utilities/testing → testing/core}/subscribeAndCount.js +1 -1
  254. package/testing/core/subscribeAndCount.js.map +1 -0
  255. package/{utilities/testing → testing/core}/withConsoleSpy.d.ts +0 -0
  256. package/testing/core/withConsoleSpy.d.ts.map +1 -0
  257. package/{utilities/testing → testing/core}/withConsoleSpy.js +0 -0
  258. package/testing/core/withConsoleSpy.js.map +1 -0
  259. package/{utilities/testing → testing/core}/wrap.d.ts +0 -0
  260. package/testing/core/wrap.d.ts.map +1 -0
  261. package/{utilities/testing → testing/core}/wrap.js +0 -0
  262. package/testing/core/wrap.js.map +1 -0
  263. package/testing/index.d.ts +3 -1
  264. package/testing/index.d.ts.map +1 -1
  265. package/testing/index.js +3 -3
  266. package/testing/index.js.map +1 -1
  267. package/{utilities/testing/mocking → testing/react}/MockedProvider.d.ts +5 -5
  268. package/testing/react/MockedProvider.d.ts.map +1 -0
  269. package/{utilities/testing/mocking → testing/react}/MockedProvider.js +4 -4
  270. package/testing/react/MockedProvider.js.map +1 -0
  271. package/testing/testing.cjs +6 -332
  272. package/testing/testing.cjs.map +1 -1
  273. package/utilities/common/canUse.d.ts +1 -0
  274. package/utilities/common/canUse.d.ts.map +1 -1
  275. package/utilities/common/canUse.js +2 -0
  276. package/utilities/common/canUse.js.map +1 -1
  277. package/utilities/common/maybeDeepFreeze.d.ts.map +1 -1
  278. package/utilities/common/maybeDeepFreeze.js +14 -3
  279. package/utilities/common/maybeDeepFreeze.js.map +1 -1
  280. package/utilities/common/mergeDeep.d.ts.map +1 -1
  281. package/utilities/common/mergeDeep.js +7 -2
  282. package/utilities/common/mergeDeep.js.map +1 -1
  283. package/utilities/globals/DEV.js +2 -2
  284. package/utilities/globals/DEV.js.map +1 -1
  285. package/utilities/globals/{graphql.d.ts → fix-graphql.d.ts} +1 -1
  286. package/utilities/globals/fix-graphql.d.ts.map +1 -0
  287. package/utilities/globals/fix-graphql.js +6 -0
  288. package/utilities/globals/fix-graphql.js.map +1 -0
  289. package/utilities/{common → globals}/global.d.ts +0 -0
  290. package/utilities/globals/global.d.ts.map +1 -0
  291. package/utilities/{common → globals}/global.js +0 -0
  292. package/utilities/globals/global.js.map +1 -0
  293. package/utilities/globals/globals.cjs +56 -0
  294. package/utilities/globals/globals.cjs.map +1 -0
  295. package/utilities/globals/index.d.ts +4 -2
  296. package/utilities/globals/index.d.ts.map +1 -1
  297. package/utilities/globals/index.js +7 -4
  298. package/utilities/globals/index.js.map +1 -1
  299. package/utilities/{common → globals}/maybe.d.ts +0 -0
  300. package/utilities/globals/maybe.d.ts.map +1 -0
  301. package/utilities/{common → globals}/maybe.js +0 -0
  302. package/utilities/globals/maybe.js.map +1 -0
  303. package/utilities/globals/package.json +8 -0
  304. package/utilities/graphql/directives.d.ts.map +1 -1
  305. package/utilities/graphql/directives.js +5 -5
  306. package/utilities/graphql/directives.js.map +1 -1
  307. package/utilities/graphql/fragments.d.ts.map +1 -1
  308. package/utilities/graphql/fragments.js +5 -5
  309. package/utilities/graphql/fragments.js.map +1 -1
  310. package/utilities/graphql/getFromAST.d.ts.map +1 -1
  311. package/utilities/graphql/getFromAST.js +9 -9
  312. package/utilities/graphql/getFromAST.js.map +1 -1
  313. package/utilities/graphql/storeUtils.d.ts.map +1 -1
  314. package/utilities/graphql/storeUtils.js +2 -2
  315. package/utilities/graphql/storeUtils.js.map +1 -1
  316. package/utilities/graphql/transform.d.ts.map +1 -1
  317. package/utilities/graphql/transform.js +2 -2
  318. package/utilities/graphql/transform.js.map +1 -1
  319. package/utilities/index.d.ts +1 -3
  320. package/utilities/index.d.ts.map +1 -1
  321. package/utilities/index.js +1 -4
  322. package/utilities/index.js.map +1 -1
  323. package/utilities/observables/subclassing.d.ts.map +1 -1
  324. package/utilities/observables/subclassing.js +2 -1
  325. package/utilities/observables/subclassing.js.map +1 -1
  326. package/utilities/package.json +1 -3
  327. package/utilities/policies/pagination.d.ts +1 -1
  328. package/utilities/policies/pagination.d.ts.map +1 -1
  329. package/utilities/policies/pagination.js +9 -4
  330. package/utilities/policies/pagination.js.map +1 -1
  331. package/utilities/utilities.cjs +64 -85
  332. package/utilities/utilities.cjs.map +1 -1
  333. package/version.js +1 -1
  334. package/utilities/common/global.d.ts.map +0 -1
  335. package/utilities/common/global.js.map +0 -1
  336. package/utilities/common/maybe.d.ts.map +0 -1
  337. package/utilities/common/maybe.js.map +0 -1
  338. package/utilities/globals/graphql.d.ts.map +0 -1
  339. package/utilities/globals/graphql.js +0 -7
  340. package/utilities/globals/graphql.js.map +0 -1
  341. package/utilities/testing/index.d.ts.map +0 -1
  342. package/utilities/testing/index.js.map +0 -1
  343. package/utilities/testing/itAsync.d.ts.map +0 -1
  344. package/utilities/testing/itAsync.js.map +0 -1
  345. package/utilities/testing/mocking/MockedProvider.d.ts.map +0 -1
  346. package/utilities/testing/mocking/MockedProvider.js.map +0 -1
  347. package/utilities/testing/mocking/mockClient.d.ts.map +0 -1
  348. package/utilities/testing/mocking/mockClient.js.map +0 -1
  349. package/utilities/testing/mocking/mockFetch.d.ts.map +0 -1
  350. package/utilities/testing/mocking/mockFetch.js.map +0 -1
  351. package/utilities/testing/mocking/mockLink.d.ts.map +0 -1
  352. package/utilities/testing/mocking/mockLink.js.map +0 -1
  353. package/utilities/testing/mocking/mockQueryManager.d.ts.map +0 -1
  354. package/utilities/testing/mocking/mockQueryManager.js.map +0 -1
  355. package/utilities/testing/mocking/mockSubscriptionLink.d.ts.map +0 -1
  356. package/utilities/testing/mocking/mockSubscriptionLink.js.map +0 -1
  357. package/utilities/testing/mocking/mockWatchQuery.d.ts.map +0 -1
  358. package/utilities/testing/mocking/mockWatchQuery.js.map +0 -1
  359. package/utilities/testing/observableToPromise.d.ts.map +0 -1
  360. package/utilities/testing/observableToPromise.js.map +0 -1
  361. package/utilities/testing/subscribeAndCount.d.ts +0 -5
  362. package/utilities/testing/subscribeAndCount.d.ts.map +0 -1
  363. package/utilities/testing/subscribeAndCount.js.map +0 -1
  364. package/utilities/testing/withConsoleSpy.d.ts.map +0 -1
  365. package/utilities/testing/withConsoleSpy.js.map +0 -1
  366. package/utilities/testing/wrap.d.ts.map +0 -1
  367. package/utilities/testing/wrap.js.map +0 -1
@@ -2,54 +2,12 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var tsInvariant = require('ts-invariant');
6
- var process$1 = require('ts-invariant/process');
5
+ var globals = require('./globals');
7
6
  var graphql = require('graphql');
8
7
  var tslib = require('tslib');
9
8
  var zenObservableTs = require('zen-observable-ts');
10
9
  require('symbol-observable');
11
10
 
12
- function maybe(thunk) {
13
- try {
14
- return thunk();
15
- }
16
- catch (_a) { }
17
- }
18
-
19
- var global$1 = (maybe(function () { return globalThis; }) ||
20
- maybe(function () { return window; }) ||
21
- maybe(function () { return self; }) ||
22
- maybe(function () { return global; }) ||
23
- maybe(function () { return Function("return this")(); }));
24
-
25
- var __ = "__";
26
- var GLOBAL_KEY = [__, __].join("DEV");
27
- function getDEV() {
28
- try {
29
- return Boolean(__DEV__);
30
- }
31
- catch (_a) {
32
- Object.defineProperty(global$1, GLOBAL_KEY, {
33
- value: maybe(function () { return process.env.NODE_ENV; }) !== "production",
34
- enumerable: false,
35
- configurable: true,
36
- writable: true,
37
- });
38
- return global$1[GLOBAL_KEY];
39
- }
40
- }
41
- var DEV = getDEV();
42
-
43
- function removeTemporaryGlobals() {
44
- graphql.isType(null);
45
- return process$1.remove();
46
- }
47
-
48
- function checkDEV() {
49
- __DEV__ ? tsInvariant.invariant("boolean" === typeof DEV, DEV) : tsInvariant.invariant("boolean" === typeof DEV, 37);
50
- }
51
- removeTemporaryGlobals();
52
-
53
11
  function shouldInclude(_a, variables) {
54
12
  var directives = _a.directives;
55
13
  if (!directives || !directives.length) {
@@ -60,7 +18,7 @@ function shouldInclude(_a, variables) {
60
18
  var evaledValue = false;
61
19
  if (ifArgument.value.kind === 'Variable') {
62
20
  evaledValue = variables && variables[ifArgument.value.name.value];
63
- __DEV__ ? tsInvariant.invariant(evaledValue !== void 0, "Invalid variable referenced in @" + directive.name.value + " directive.") : tsInvariant.invariant(evaledValue !== void 0, 38);
21
+ __DEV__ ? globals.invariant(evaledValue !== void 0, "Invalid variable referenced in @" + directive.name.value + " directive.") : globals.invariant(evaledValue !== void 0, 37);
64
22
  }
65
23
  else {
66
24
  evaledValue = ifArgument.value.value;
@@ -97,13 +55,13 @@ function getInclusionDirectives(directives) {
97
55
  return;
98
56
  var directiveArguments = directive.arguments;
99
57
  var directiveName = directive.name.value;
100
- __DEV__ ? tsInvariant.invariant(directiveArguments && directiveArguments.length === 1, "Incorrect number of arguments for the @" + directiveName + " directive.") : tsInvariant.invariant(directiveArguments && directiveArguments.length === 1, 39);
58
+ __DEV__ ? globals.invariant(directiveArguments && directiveArguments.length === 1, "Incorrect number of arguments for the @" + directiveName + " directive.") : globals.invariant(directiveArguments && directiveArguments.length === 1, 38);
101
59
  var ifArgument = directiveArguments[0];
102
- __DEV__ ? tsInvariant.invariant(ifArgument.name && ifArgument.name.value === 'if', "Invalid argument for the @" + directiveName + " directive.") : tsInvariant.invariant(ifArgument.name && ifArgument.name.value === 'if', 40);
60
+ __DEV__ ? globals.invariant(ifArgument.name && ifArgument.name.value === 'if', "Invalid argument for the @" + directiveName + " directive.") : globals.invariant(ifArgument.name && ifArgument.name.value === 'if', 39);
103
61
  var ifValue = ifArgument.value;
104
- __DEV__ ? tsInvariant.invariant(ifValue &&
105
- (ifValue.kind === 'Variable' || ifValue.kind === 'BooleanValue'), "Argument for the @" + directiveName + " directive must be a variable or a boolean value.") : tsInvariant.invariant(ifValue &&
106
- (ifValue.kind === 'Variable' || ifValue.kind === 'BooleanValue'), 41);
62
+ __DEV__ ? globals.invariant(ifValue &&
63
+ (ifValue.kind === 'Variable' || ifValue.kind === 'BooleanValue'), "Argument for the @" + directiveName + " directive must be a variable or a boolean value.") : globals.invariant(ifValue &&
64
+ (ifValue.kind === 'Variable' || ifValue.kind === 'BooleanValue'), 40);
107
65
  result.push({ directive: directive, ifArgument: ifArgument });
108
66
  });
109
67
  }
@@ -115,15 +73,15 @@ function getFragmentQueryDocument(document, fragmentName) {
115
73
  var fragments = [];
116
74
  document.definitions.forEach(function (definition) {
117
75
  if (definition.kind === 'OperationDefinition') {
118
- throw __DEV__ ? new tsInvariant.InvariantError("Found a " + definition.operation + " operation" + (definition.name ? " named '" + definition.name.value + "'" : '') + ". " +
119
- 'No operations are allowed when using a fragment as a query. Only fragments are allowed.') : new tsInvariant.InvariantError(42);
76
+ throw __DEV__ ? new globals.InvariantError("Found a " + definition.operation + " operation" + (definition.name ? " named '" + definition.name.value + "'" : '') + ". " +
77
+ 'No operations are allowed when using a fragment as a query. Only fragments are allowed.') : new globals.InvariantError(41);
120
78
  }
121
79
  if (definition.kind === 'FragmentDefinition') {
122
80
  fragments.push(definition);
123
81
  }
124
82
  });
125
83
  if (typeof actualFragmentName === 'undefined') {
126
- __DEV__ ? tsInvariant.invariant(fragments.length === 1, "Found " + fragments.length + " fragments. `fragmentName` must be provided when there is not exactly 1 fragment.") : tsInvariant.invariant(fragments.length === 1, 43);
84
+ __DEV__ ? globals.invariant(fragments.length === 1, "Found " + fragments.length + " fragments. `fragmentName` must be provided when there is not exactly 1 fragment.") : globals.invariant(fragments.length === 1, 42);
127
85
  actualFragmentName = fragments[0].name.value;
128
86
  }
129
87
  var query = tslib.__assign(tslib.__assign({}, document), { definitions: tslib.__spreadArray([
@@ -143,7 +101,7 @@ function getFragmentQueryDocument(document, fragmentName) {
143
101
  ],
144
102
  },
145
103
  }
146
- ], document.definitions) });
104
+ ], document.definitions, true) });
147
105
  return query;
148
106
  }
149
107
  function createFragmentMap(fragments) {
@@ -160,7 +118,7 @@ function getFragmentFromSelection(selection, fragmentMap) {
160
118
  return selection;
161
119
  case 'FragmentSpread': {
162
120
  var fragment = fragmentMap && fragmentMap[selection.name.value];
163
- __DEV__ ? tsInvariant.invariant(fragment, "No fragment named " + selection.name.value + ".") : tsInvariant.invariant(fragment, 44);
121
+ __DEV__ ? globals.invariant(fragment, "No fragment named " + selection.name.value + ".") : globals.invariant(fragment, 43);
164
122
  return fragment;
165
123
  }
166
124
  default:
@@ -242,9 +200,9 @@ function valueToObjectRepresentation(argObj, name, value, variables) {
242
200
  argObj[name.value] = null;
243
201
  }
244
202
  else {
245
- throw __DEV__ ? new tsInvariant.InvariantError("The inline argument \"" + name.value + "\" of kind \"" + value.kind + "\"" +
203
+ throw __DEV__ ? new globals.InvariantError("The inline argument \"" + name.value + "\" of kind \"" + value.kind + "\"" +
246
204
  'is not supported. Use variables instead of inline arguments to ' +
247
- 'overcome this limitation.') : new tsInvariant.InvariantError(53);
205
+ 'overcome this limitation.') : new globals.InvariantError(52);
248
206
  }
249
207
  }
250
208
  function storeKeyNameFromField(field, variables) {
@@ -378,16 +336,16 @@ function isInlineFragment(selection) {
378
336
  }
379
337
 
380
338
  function checkDocument(doc) {
381
- __DEV__ ? tsInvariant.invariant(doc && doc.kind === 'Document', "Expecting a parsed GraphQL document. Perhaps you need to wrap the query string in a \"gql\" tag? http://docs.apollostack.com/apollo-client/core.html#gql") : tsInvariant.invariant(doc && doc.kind === 'Document', 45);
339
+ __DEV__ ? globals.invariant(doc && doc.kind === 'Document', "Expecting a parsed GraphQL document. Perhaps you need to wrap the query string in a \"gql\" tag? http://docs.apollostack.com/apollo-client/core.html#gql") : globals.invariant(doc && doc.kind === 'Document', 44);
382
340
  var operations = doc.definitions
383
341
  .filter(function (d) { return d.kind !== 'FragmentDefinition'; })
384
342
  .map(function (definition) {
385
343
  if (definition.kind !== 'OperationDefinition') {
386
- throw __DEV__ ? new tsInvariant.InvariantError("Schema type definitions not allowed in queries. Found: \"" + definition.kind + "\"") : new tsInvariant.InvariantError(46);
344
+ throw __DEV__ ? new globals.InvariantError("Schema type definitions not allowed in queries. Found: \"" + definition.kind + "\"") : new globals.InvariantError(45);
387
345
  }
388
346
  return definition;
389
347
  });
390
- __DEV__ ? tsInvariant.invariant(operations.length <= 1, "Ambiguous GraphQL document: contains " + operations.length + " operations") : tsInvariant.invariant(operations.length <= 1, 47);
348
+ __DEV__ ? globals.invariant(operations.length <= 1, "Ambiguous GraphQL document: contains " + operations.length + " operations") : globals.invariant(operations.length <= 1, 46);
391
349
  return doc;
392
350
  }
393
351
  function getOperationDefinition(doc) {
@@ -406,14 +364,14 @@ function getFragmentDefinitions(doc) {
406
364
  }
407
365
  function getQueryDefinition(doc) {
408
366
  var queryDef = getOperationDefinition(doc);
409
- __DEV__ ? tsInvariant.invariant(queryDef && queryDef.operation === 'query', 'Must contain a query definition.') : tsInvariant.invariant(queryDef && queryDef.operation === 'query', 48);
367
+ __DEV__ ? globals.invariant(queryDef && queryDef.operation === 'query', 'Must contain a query definition.') : globals.invariant(queryDef && queryDef.operation === 'query', 47);
410
368
  return queryDef;
411
369
  }
412
370
  function getFragmentDefinition(doc) {
413
- __DEV__ ? tsInvariant.invariant(doc.kind === 'Document', "Expecting a parsed GraphQL document. Perhaps you need to wrap the query string in a \"gql\" tag? http://docs.apollostack.com/apollo-client/core.html#gql") : tsInvariant.invariant(doc.kind === 'Document', 49);
414
- __DEV__ ? tsInvariant.invariant(doc.definitions.length <= 1, 'Fragment must have exactly one definition.') : tsInvariant.invariant(doc.definitions.length <= 1, 50);
371
+ __DEV__ ? globals.invariant(doc.kind === 'Document', "Expecting a parsed GraphQL document. Perhaps you need to wrap the query string in a \"gql\" tag? http://docs.apollostack.com/apollo-client/core.html#gql") : globals.invariant(doc.kind === 'Document', 48);
372
+ __DEV__ ? globals.invariant(doc.definitions.length <= 1, 'Fragment must have exactly one definition.') : globals.invariant(doc.definitions.length <= 1, 49);
415
373
  var fragmentDef = doc.definitions[0];
416
- __DEV__ ? tsInvariant.invariant(fragmentDef.kind === 'FragmentDefinition', 'Must be a fragment definition.') : tsInvariant.invariant(fragmentDef.kind === 'FragmentDefinition', 51);
374
+ __DEV__ ? globals.invariant(fragmentDef.kind === 'FragmentDefinition', 'Must be a fragment definition.') : globals.invariant(fragmentDef.kind === 'FragmentDefinition', 50);
417
375
  return fragmentDef;
418
376
  }
419
377
  function getMainDefinition(queryDoc) {
@@ -436,7 +394,7 @@ function getMainDefinition(queryDoc) {
436
394
  if (fragmentDefinition) {
437
395
  return fragmentDefinition;
438
396
  }
439
- throw __DEV__ ? new tsInvariant.InvariantError('Expected a parsed GraphQL query with a query, mutation, subscription, or a fragment.') : new tsInvariant.InvariantError(52);
397
+ throw __DEV__ ? new globals.InvariantError('Expected a parsed GraphQL query with a query, mutation, subscription, or a fragment.') : new globals.InvariantError(51);
440
398
  }
441
399
  function getDefaultValues(definition) {
442
400
  var defaultValues = Object.create(null);
@@ -579,7 +537,7 @@ var addTypenameToDocument = Object.assign(function (doc) {
579
537
  field.directives.some(function (d) { return d.name.value === 'export'; })) {
580
538
  return;
581
539
  }
582
- return tslib.__assign(tslib.__assign({}, node), { selections: tslib.__spreadArray(tslib.__spreadArray([], selections), [TYPENAME_FIELD]) });
540
+ return tslib.__assign(tslib.__assign({}, node), { selections: tslib.__spreadArray(tslib.__spreadArray([], selections, true), [TYPENAME_FIELD], false) });
583
541
  },
584
542
  },
585
543
  });
@@ -594,7 +552,7 @@ var connectionRemoveConfig = {
594
552
  if (willRemove) {
595
553
  if (!directive.arguments ||
596
554
  !directive.arguments.some(function (arg) { return arg.name.value === 'key'; })) {
597
- __DEV__ && tsInvariant.invariant.warn('Removing an @connection directive even though it does not have a key. ' +
555
+ __DEV__ && globals.invariant.warn('Removing an @connection directive even though it does not have a key. ' +
598
556
  'You may want to use the key parameter to specify a store key.');
599
557
  }
600
558
  }
@@ -758,7 +716,7 @@ var DeepMerger = (function () {
758
716
  if (hasOwnProperty.call(target, sourceKey)) {
759
717
  var targetValue = target[sourceKey];
760
718
  if (source[sourceKey] !== targetValue) {
761
- var result = _this.reconciler.apply(_this, tslib.__spreadArray([target, source, sourceKey], context));
719
+ var result = _this.reconciler.apply(_this, tslib.__spreadArray([target, source, sourceKey], context, false));
762
720
  if (result !== targetValue) {
763
721
  target = _this.shallowCopyForMerge(target);
764
722
  target[sourceKey] = result;
@@ -775,7 +733,12 @@ var DeepMerger = (function () {
775
733
  return source;
776
734
  };
777
735
  DeepMerger.prototype.shallowCopyForMerge = function (value) {
778
- if (isNonNullObject(value) && !this.pastCopies.has(value)) {
736
+ if (isNonNullObject(value)) {
737
+ if (this.pastCopies.has(value)) {
738
+ if (!Object.isFrozen(value))
739
+ return value;
740
+ this.pastCopies.delete(value);
741
+ }
779
742
  if (Array.isArray(value)) {
780
743
  value = value.slice(0);
781
744
  }
@@ -794,7 +757,7 @@ function concatPagination(keyArgs) {
794
757
  return {
795
758
  keyArgs: keyArgs,
796
759
  merge: function (existing, incoming) {
797
- return existing ? tslib.__spreadArray(tslib.__spreadArray([], existing), incoming) : incoming;
760
+ return existing ? tslib.__spreadArray(tslib.__spreadArray([], existing, true), incoming, true) : incoming;
798
761
  },
799
762
  };
800
763
  }
@@ -825,7 +788,7 @@ function relayStylePagination(keyArgs) {
825
788
  read: function (existing, _a) {
826
789
  var canRead = _a.canRead, readField = _a.readField;
827
790
  if (!existing)
828
- return;
791
+ return existing;
829
792
  var edges = [];
830
793
  var firstEdgeCursor = "";
831
794
  var lastEdgeCursor = "";
@@ -842,8 +805,13 @@ function relayStylePagination(keyArgs) {
842
805
  return tslib.__assign(tslib.__assign({}, getExtras(existing)), { edges: edges, pageInfo: tslib.__assign(tslib.__assign({}, existing.pageInfo), { startCursor: startCursor || firstEdgeCursor, endCursor: endCursor || lastEdgeCursor }) });
843
806
  },
844
807
  merge: function (existing, incoming, _a) {
845
- if (existing === void 0) { existing = makeEmptyData(); }
846
808
  var args = _a.args, isReference = _a.isReference, readField = _a.readField;
809
+ if (!existing) {
810
+ existing = makeEmptyData();
811
+ }
812
+ if (!incoming) {
813
+ return existing;
814
+ }
847
815
  var incomingEdges = incoming.edges ? incoming.edges.map(function (edge) {
848
816
  if (isReference(edge = tslib.__assign({}, edge))) {
849
817
  edge.cursor = readField("cursor", edge);
@@ -894,7 +862,7 @@ function relayStylePagination(keyArgs) {
894
862
  else if (incoming.edges) {
895
863
  prefix = [];
896
864
  }
897
- var edges = tslib.__spreadArray(tslib.__spreadArray(tslib.__spreadArray([], prefix), incomingEdges), suffix);
865
+ var edges = tslib.__spreadArray(tslib.__spreadArray(tslib.__spreadArray([], prefix, true), incomingEdges, true), suffix, true);
898
866
  var pageInfo = tslib.__assign(tslib.__assign({}, incoming.pageInfo), existing.pageInfo);
899
867
  if (incoming.pageInfo) {
900
868
  var _b = incoming.pageInfo, hasPreviousPage = _b.hasPreviousPage, hasNextPage = _b.hasNextPage, startCursor = _b.startCursor, endCursor = _b.endCursor, extras = tslib.__rest(_b, ["hasPreviousPage", "hasNextPage", "startCursor", "endCursor"]);
@@ -966,9 +934,7 @@ function cloneDeepHelper(val, seen) {
966
934
  function deepFreeze(value) {
967
935
  var workSet = new Set([value]);
968
936
  workSet.forEach(function (obj) {
969
- if (isNonNullObject(obj)) {
970
- if (!Object.isFrozen(obj))
971
- Object.freeze(obj);
937
+ if (isNonNullObject(obj) && shallowFreeze(obj) === obj) {
972
938
  Object.getOwnPropertyNames(obj).forEach(function (name) {
973
939
  if (isNonNullObject(obj[name]))
974
940
  workSet.add(obj[name]);
@@ -977,6 +943,19 @@ function deepFreeze(value) {
977
943
  });
978
944
  return value;
979
945
  }
946
+ function shallowFreeze(obj) {
947
+ if (__DEV__ && !Object.isFrozen(obj)) {
948
+ try {
949
+ Object.freeze(obj);
950
+ }
951
+ catch (e) {
952
+ if (e instanceof TypeError)
953
+ return null;
954
+ throw e;
955
+ }
956
+ }
957
+ return obj;
958
+ }
980
959
  function maybeDeepFreeze(obj) {
981
960
  if (__DEV__) {
982
961
  deepFreeze(obj);
@@ -1038,11 +1017,17 @@ function asyncMap(observable, mapFn, catchFn) {
1038
1017
  });
1039
1018
  }
1040
1019
 
1020
+ var canUseWeakMap = typeof WeakMap === 'function' && !(typeof navigator === 'object' &&
1021
+ navigator.product === 'ReactNative');
1022
+ var canUseWeakSet = typeof WeakSet === 'function';
1023
+ var canUseSymbol = typeof Symbol === 'function' &&
1024
+ typeof Symbol.for === 'function';
1025
+
1041
1026
  function fixObservableSubclass(subclass) {
1042
1027
  function set(key) {
1043
1028
  Object.defineProperty(subclass, key, { value: zenObservableTs.Observable });
1044
1029
  }
1045
- if (typeof Symbol === "function" && Symbol.species) {
1030
+ if (canUseSymbol && Symbol.species) {
1046
1031
  set(Symbol.species);
1047
1032
  }
1048
1033
  set("@@species");
@@ -1188,10 +1173,6 @@ function graphQLResultHasError(result) {
1188
1173
  return (result.errors && result.errors.length > 0) || false;
1189
1174
  }
1190
1175
 
1191
- var canUseWeakMap = typeof WeakMap === 'function' && !(typeof navigator === 'object' &&
1192
- navigator.product === 'ReactNative');
1193
- var canUseWeakSet = typeof WeakSet === 'function';
1194
-
1195
1176
  function compact() {
1196
1177
  var objects = [];
1197
1178
  for (var _i = 0; _i < arguments.length; _i++) {
@@ -1225,19 +1206,18 @@ function stringifyForDisplay(value) {
1225
1206
  }).split(JSON.stringify(undefId)).join("<undefined>");
1226
1207
  }
1227
1208
 
1228
- checkDEV();
1229
-
1209
+ exports.DEV = globals.DEV;
1210
+ exports.maybe = globals.maybe;
1230
1211
  exports.Observable = zenObservableTs.Observable;
1231
1212
  exports.Concast = Concast;
1232
- exports.DEV = DEV;
1233
1213
  exports.DeepMerger = DeepMerger;
1234
1214
  exports.addTypenameToDocument = addTypenameToDocument;
1235
1215
  exports.argumentsObjectFromField = argumentsObjectFromField;
1236
1216
  exports.asyncMap = asyncMap;
1237
1217
  exports.buildQueryFromSelectionSet = buildQueryFromSelectionSet;
1218
+ exports.canUseSymbol = canUseSymbol;
1238
1219
  exports.canUseWeakMap = canUseWeakMap;
1239
1220
  exports.canUseWeakSet = canUseWeakSet;
1240
- exports.checkDEV = checkDEV;
1241
1221
  exports.checkDocument = checkDocument;
1242
1222
  exports.cloneDeep = cloneDeep;
1243
1223
  exports.compact = compact;
@@ -1269,7 +1249,6 @@ exports.isReference = isReference;
1269
1249
  exports.iterateObserversSafely = iterateObserversSafely;
1270
1250
  exports.makeReference = makeReference;
1271
1251
  exports.makeUniqueId = makeUniqueId;
1272
- exports.maybe = maybe;
1273
1252
  exports.maybeDeepFreeze = maybeDeepFreeze;
1274
1253
  exports.mergeDeep = mergeDeep;
1275
1254
  exports.mergeDeepArray = mergeDeepArray;