@apollo/client 3.4.17 → 3.5.6

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 (421) hide show
  1. package/README.md +1 -1
  2. package/{apollo-client.cjs.js → apollo-client.cjs} +1219 -1280
  3. package/apollo-client.cjs.map +1 -0
  4. package/apollo-client.min.cjs +1 -0
  5. package/cache/{cache.cjs.js → cache.cjs} +757 -601
  6. package/cache/cache.cjs.map +1 -0
  7. package/cache/core/cache.d.ts +6 -4
  8. package/cache/core/cache.d.ts.map +1 -1
  9. package/cache/core/cache.js +28 -1
  10. package/cache/core/cache.js.map +1 -1
  11. package/cache/core/types/Cache.d.ts +12 -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.d.ts +4 -0
  15. package/cache/core/types/DataProxy.d.ts.map +1 -1
  16. package/cache/core/types/DataProxy.js.map +1 -1
  17. package/cache/core/types/common.d.ts +8 -5
  18. package/cache/core/types/common.d.ts.map +1 -1
  19. package/cache/core/types/common.js +6 -11
  20. package/cache/core/types/common.js.map +1 -1
  21. package/cache/inmemory/helpers.js +1 -1
  22. package/cache/inmemory/helpers.js.map +1 -1
  23. package/cache/inmemory/inMemoryCache.d.ts +4 -4
  24. package/cache/inmemory/inMemoryCache.d.ts.map +1 -1
  25. package/cache/inmemory/inMemoryCache.js +12 -3
  26. package/cache/inmemory/inMemoryCache.js.map +1 -1
  27. package/cache/inmemory/key-extractor.d.ts +9 -0
  28. package/cache/inmemory/key-extractor.d.ts.map +1 -0
  29. package/cache/inmemory/key-extractor.js +118 -0
  30. package/cache/inmemory/key-extractor.js.map +1 -0
  31. package/cache/inmemory/policies.d.ts +7 -3
  32. package/cache/inmemory/policies.d.ts.map +1 -1
  33. package/cache/inmemory/policies.js +47 -118
  34. package/cache/inmemory/policies.js.map +1 -1
  35. package/cache/inmemory/readFromStore.d.ts +2 -2
  36. package/cache/inmemory/readFromStore.d.ts.map +1 -1
  37. package/cache/inmemory/readFromStore.js +54 -42
  38. package/cache/inmemory/readFromStore.js.map +1 -1
  39. package/cache/inmemory/writeToStore.d.ts +8 -3
  40. package/cache/inmemory/writeToStore.d.ts.map +1 -1
  41. package/cache/inmemory/writeToStore.js +166 -95
  42. package/cache/inmemory/writeToStore.js.map +1 -1
  43. package/cache/package.json +2 -1
  44. package/core/ApolloClient.d.ts +0 -1
  45. package/core/ApolloClient.d.ts.map +1 -1
  46. package/core/ApolloClient.js +3 -3
  47. package/core/ApolloClient.js.map +1 -1
  48. package/core/LocalState.js +1 -1
  49. package/core/LocalState.js.map +1 -1
  50. package/core/ObservableQuery.d.ts +2 -2
  51. package/core/ObservableQuery.d.ts.map +1 -1
  52. package/core/ObservableQuery.js +19 -14
  53. package/core/ObservableQuery.js.map +1 -1
  54. package/core/QueryInfo.d.ts +2 -2
  55. package/core/QueryInfo.d.ts.map +1 -1
  56. package/core/QueryInfo.js.map +1 -1
  57. package/core/QueryManager.d.ts +0 -1
  58. package/core/QueryManager.d.ts.map +1 -1
  59. package/core/QueryManager.js +10 -10
  60. package/core/QueryManager.js.map +1 -1
  61. package/core/{core.cjs.js → core.cjs} +38 -34
  62. package/core/core.cjs.map +1 -0
  63. package/core/package.json +2 -1
  64. package/errors/{errors.cjs.js → errors.cjs} +3 -3
  65. package/errors/errors.cjs.map +1 -0
  66. package/errors/index.d.ts +3 -1
  67. package/errors/index.d.ts.map +1 -1
  68. package/errors/index.js +2 -2
  69. package/errors/index.js.map +1 -1
  70. package/errors/package.json +2 -1
  71. package/invariantErrorCodes.js +84 -104
  72. package/link/batch/{batch.cjs.js → batch.cjs} +2 -2
  73. package/link/batch/batch.cjs.map +1 -0
  74. package/link/batch/batchLink.d.ts +0 -1
  75. package/link/batch/batchLink.d.ts.map +1 -1
  76. package/link/batch/batching.d.ts +0 -1
  77. package/link/batch/batching.d.ts.map +1 -1
  78. package/link/batch/batching.js +1 -1
  79. package/link/batch/batching.js.map +1 -1
  80. package/link/batch/package.json +2 -1
  81. package/link/batch-http/{batch-http.cjs.js → batch-http.cjs} +3 -3
  82. package/link/batch-http/batch-http.cjs.map +1 -0
  83. package/link/batch-http/batchHttpLink.d.ts +0 -1
  84. package/link/batch-http/batchHttpLink.d.ts.map +1 -1
  85. package/link/batch-http/batchHttpLink.js +3 -3
  86. package/link/batch-http/batchHttpLink.js.map +1 -1
  87. package/link/batch-http/package.json +2 -1
  88. package/link/context/{context.cjs.js → context.cjs} +1 -1
  89. package/link/context/context.cjs.map +1 -0
  90. package/link/context/index.js.map +1 -1
  91. package/link/context/package.json +2 -1
  92. package/link/core/ApolloLink.d.ts +2 -3
  93. package/link/core/ApolloLink.d.ts.map +1 -1
  94. package/link/core/ApolloLink.js +1 -1
  95. package/link/core/ApolloLink.js.map +1 -1
  96. package/link/core/{core.cjs.js → core.cjs} +2 -2
  97. package/link/core/core.cjs.map +1 -0
  98. package/link/core/package.json +2 -1
  99. package/link/core/types.d.ts +4 -7
  100. package/link/core/types.d.ts.map +1 -1
  101. package/link/core/types.js.map +1 -1
  102. package/link/error/{error.cjs.js → error.cjs} +2 -2
  103. package/link/error/error.cjs.map +1 -0
  104. package/link/error/index.d.ts +5 -7
  105. package/link/error/index.d.ts.map +1 -1
  106. package/link/error/index.js +1 -1
  107. package/link/error/index.js.map +1 -1
  108. package/link/error/package.json +2 -1
  109. package/link/http/checkFetcher.js +1 -1
  110. package/link/http/createHttpLink.d.ts.map +1 -1
  111. package/link/http/createHttpLink.js +3 -3
  112. package/link/http/createHttpLink.js.map +1 -1
  113. package/link/http/{http.cjs.js → http.cjs} +28 -15
  114. package/link/http/http.cjs.map +1 -0
  115. package/link/http/index.d.ts +1 -1
  116. package/link/http/index.d.ts.map +1 -1
  117. package/link/http/index.js +1 -1
  118. package/link/http/index.js.map +1 -1
  119. package/link/http/package.json +2 -1
  120. package/link/http/parseAndCheckHttpResponse.js +3 -3
  121. package/link/http/parseAndCheckHttpResponse.js.map +1 -1
  122. package/link/http/rewriteURIForGET.js +1 -1
  123. package/link/http/rewriteURIForGET.js.map +1 -1
  124. package/link/http/selectHttpOptionsAndBody.d.ts +11 -1
  125. package/link/http/selectHttpOptionsAndBody.d.ts.map +1 -1
  126. package/link/http/selectHttpOptionsAndBody.js +20 -7
  127. package/link/http/selectHttpOptionsAndBody.js.map +1 -1
  128. package/link/http/serializeFetchParameter.js +1 -1
  129. package/link/http/serializeFetchParameter.js.map +1 -1
  130. package/link/persisted-queries/index.d.ts.map +1 -1
  131. package/link/persisted-queries/index.js +3 -3
  132. package/link/persisted-queries/index.js.map +1 -1
  133. package/link/persisted-queries/package.json +2 -1
  134. package/link/persisted-queries/{persisted-queries.cjs.js → persisted-queries.cjs} +3 -3
  135. package/link/persisted-queries/persisted-queries.cjs.map +1 -0
  136. package/link/retry/package.json +2 -1
  137. package/link/retry/{retry.cjs.js → retry.cjs} +1 -1
  138. package/link/retry/retry.cjs.map +1 -0
  139. package/link/retry/retryLink.d.ts +0 -1
  140. package/link/retry/retryLink.d.ts.map +1 -1
  141. package/link/retry/retryLink.js.map +1 -1
  142. package/link/schema/index.d.ts +0 -1
  143. package/link/schema/index.d.ts.map +1 -1
  144. package/link/schema/index.js +8 -1
  145. package/link/schema/index.js.map +1 -1
  146. package/link/schema/package.json +2 -1
  147. package/link/schema/{schema.cjs.js → schema.cjs} +9 -2
  148. package/link/schema/schema.cjs.map +1 -0
  149. package/link/utils/fromError.d.ts +0 -1
  150. package/link/utils/fromError.d.ts.map +1 -1
  151. package/link/utils/fromPromise.d.ts +0 -1
  152. package/link/utils/fromPromise.d.ts.map +1 -1
  153. package/link/utils/package.json +2 -1
  154. package/link/utils/toPromise.d.ts +0 -1
  155. package/link/utils/toPromise.d.ts.map +1 -1
  156. package/link/utils/{utils.cjs.js → utils.cjs} +2 -2
  157. package/link/utils/utils.cjs.map +1 -0
  158. package/link/utils/validateOperation.js +1 -1
  159. package/link/utils/validateOperation.js.map +1 -1
  160. package/link/ws/index.d.ts +0 -1
  161. package/link/ws/index.d.ts.map +1 -1
  162. package/link/ws/package.json +2 -1
  163. package/link/ws/{ws.cjs.js → ws.cjs} +1 -1
  164. package/link/ws/ws.cjs.map +1 -0
  165. package/{main.cjs.js → main.cjs} +5 -5
  166. package/main.cjs.map +1 -0
  167. package/package.json +20 -19
  168. package/react/components/Query.js.map +1 -1
  169. package/react/components/{components.cjs.js → components.cjs} +4 -4
  170. package/react/components/components.cjs.map +1 -0
  171. package/react/components/package.json +2 -1
  172. package/react/context/ApolloConsumer.js +1 -1
  173. package/react/context/ApolloProvider.js +1 -1
  174. package/react/context/{context.cjs.js → context.cjs} +6 -6
  175. package/react/context/context.cjs.map +1 -0
  176. package/react/context/index.d.ts +3 -3
  177. package/react/context/index.d.ts.map +1 -1
  178. package/react/context/index.js +3 -3
  179. package/react/context/index.js.map +1 -1
  180. package/react/context/package.json +2 -1
  181. package/react/hoc/hoc-utils.js +1 -1
  182. package/react/hoc/{hoc.cjs.js → hoc.cjs} +12 -12
  183. package/react/hoc/hoc.cjs.map +1 -0
  184. package/react/hoc/mutation-hoc.js +2 -2
  185. package/react/hoc/mutation-hoc.js.map +1 -1
  186. package/react/hoc/package.json +2 -1
  187. package/react/hoc/query-hoc.js +1 -1
  188. package/react/hoc/query-hoc.js.map +1 -1
  189. package/react/hoc/subscription-hoc.js +1 -1
  190. package/react/hoc/subscription-hoc.js.map +1 -1
  191. package/react/hoc/withApollo.js +2 -2
  192. package/react/hoc/withApollo.js.map +1 -1
  193. package/react/hooks/hooks.cjs +502 -0
  194. package/react/hooks/hooks.cjs.map +1 -0
  195. package/react/hooks/package.json +2 -1
  196. package/react/hooks/useApolloClient.d.ts +1 -1
  197. package/react/hooks/useApolloClient.d.ts.map +1 -1
  198. package/react/hooks/useApolloClient.js +7 -5
  199. package/react/hooks/useApolloClient.js.map +1 -1
  200. package/react/hooks/useLazyQuery.d.ts.map +1 -1
  201. package/react/hooks/useLazyQuery.js +56 -2
  202. package/react/hooks/useLazyQuery.js.map +1 -1
  203. package/react/hooks/useMutation.d.ts.map +1 -1
  204. package/react/hooks/useMutation.js +89 -21
  205. package/react/hooks/useMutation.js.map +1 -1
  206. package/react/hooks/useQuery.d.ts +2 -3
  207. package/react/hooks/useQuery.d.ts.map +1 -1
  208. package/react/hooks/useQuery.js +224 -2
  209. package/react/hooks/useQuery.js.map +1 -1
  210. package/react/hooks/useSubscription.d.ts +2 -7
  211. package/react/hooks/useSubscription.d.ts.map +1 -1
  212. package/react/hooks/useSubscription.js +89 -32
  213. package/react/hooks/useSubscription.js.map +1 -1
  214. package/react/package.json +2 -1
  215. package/react/parser/index.d.ts +1 -0
  216. package/react/parser/index.d.ts.map +1 -1
  217. package/react/parser/index.js +16 -9
  218. package/react/parser/index.js.map +1 -1
  219. package/react/parser/package.json +2 -1
  220. package/react/parser/{parser.cjs.js → parser.cjs} +18 -10
  221. package/react/parser/parser.cjs.map +1 -0
  222. package/react/{react.cjs.js → react.cjs} +3 -3
  223. package/react/react.cjs.map +1 -0
  224. package/react/ssr/RenderPromises.d.ts +7 -3
  225. package/react/ssr/RenderPromises.d.ts.map +1 -1
  226. package/react/ssr/RenderPromises.js.map +1 -1
  227. package/react/ssr/package.json +2 -1
  228. package/react/ssr/{ssr.cjs.js → ssr.cjs} +4 -4
  229. package/react/ssr/ssr.cjs.map +1 -0
  230. package/react/types/types.d.ts +7 -18
  231. package/react/types/types.d.ts.map +1 -1
  232. package/react/types/types.js.map +1 -1
  233. package/testing/{testing.cjs.js → core/core.cjs} +10 -104
  234. package/testing/core/core.cjs.map +1 -0
  235. package/{utilities/testing → testing/core}/index.d.ts +0 -1
  236. package/testing/core/index.d.ts.map +1 -0
  237. package/{utilities/testing → testing/core}/index.js +0 -1
  238. package/testing/core/index.js.map +1 -0
  239. package/{utilities/testing → testing/core}/itAsync.d.ts +0 -0
  240. package/testing/core/itAsync.d.ts.map +1 -0
  241. package/{utilities/testing → testing/core}/itAsync.js +0 -0
  242. package/testing/core/itAsync.js.map +1 -0
  243. package/{utilities/testing → testing/core}/mocking/mockClient.d.ts +0 -0
  244. package/testing/core/mocking/mockClient.d.ts.map +1 -0
  245. package/{utilities/testing → testing/core}/mocking/mockClient.js +0 -0
  246. package/testing/core/mocking/mockClient.js.map +1 -0
  247. package/{utilities/testing → testing/core}/mocking/mockFetch.d.ts +0 -0
  248. package/testing/core/mocking/mockFetch.d.ts.map +1 -0
  249. package/{utilities/testing → testing/core}/mocking/mockFetch.js +1 -1
  250. package/testing/core/mocking/mockFetch.js.map +1 -0
  251. package/{utilities/testing → testing/core}/mocking/mockLink.d.ts +0 -1
  252. package/testing/core/mocking/mockLink.d.ts.map +1 -0
  253. package/{utilities/testing → testing/core}/mocking/mockLink.js +5 -5
  254. package/testing/core/mocking/mockLink.js.map +1 -0
  255. package/{utilities/testing → testing/core}/mocking/mockQueryManager.d.ts +1 -1
  256. package/testing/core/mocking/mockQueryManager.d.ts.map +1 -0
  257. package/{utilities/testing → testing/core}/mocking/mockQueryManager.js +1 -1
  258. package/testing/core/mocking/mockQueryManager.js.map +1 -0
  259. package/{utilities/testing → testing/core}/mocking/mockSubscriptionLink.d.ts +1 -4
  260. package/testing/core/mocking/mockSubscriptionLink.d.ts.map +1 -0
  261. package/{utilities/testing → testing/core}/mocking/mockSubscriptionLink.js +1 -1
  262. package/testing/core/mocking/mockSubscriptionLink.js.map +1 -0
  263. package/{utilities/testing → testing/core}/mocking/mockWatchQuery.d.ts +1 -1
  264. package/testing/core/mocking/mockWatchQuery.d.ts.map +1 -0
  265. package/{utilities/testing → testing/core}/mocking/mockWatchQuery.js +0 -0
  266. package/testing/core/mocking/mockWatchQuery.js.map +1 -0
  267. package/{utilities/testing → testing/core}/observableToPromise.d.ts +2 -3
  268. package/testing/core/observableToPromise.d.ts.map +1 -0
  269. package/{utilities/testing → testing/core}/observableToPromise.js +1 -1
  270. package/testing/core/observableToPromise.js.map +1 -0
  271. package/testing/core/package.json +8 -0
  272. package/testing/core/subscribeAndCount.d.ts +4 -0
  273. package/testing/core/subscribeAndCount.d.ts.map +1 -0
  274. package/{utilities/testing → testing/core}/subscribeAndCount.js +1 -1
  275. package/testing/core/subscribeAndCount.js.map +1 -0
  276. package/{utilities/testing → testing/core}/withConsoleSpy.d.ts +0 -0
  277. package/testing/core/withConsoleSpy.d.ts.map +1 -0
  278. package/{utilities/testing → testing/core}/withConsoleSpy.js +0 -0
  279. package/testing/core/withConsoleSpy.js.map +1 -0
  280. package/{utilities/testing → testing/core}/wrap.d.ts +0 -0
  281. package/testing/core/wrap.d.ts.map +1 -0
  282. package/{utilities/testing → testing/core}/wrap.js +0 -0
  283. package/testing/core/wrap.js.map +1 -0
  284. package/testing/index.d.ts +2 -1
  285. package/testing/index.d.ts.map +1 -1
  286. package/testing/index.js +2 -1
  287. package/testing/index.js.map +1 -1
  288. package/testing/package.json +2 -1
  289. package/{utilities/testing/mocking → testing/react}/MockedProvider.d.ts +5 -5
  290. package/testing/react/MockedProvider.d.ts.map +1 -0
  291. package/{utilities/testing/mocking → testing/react}/MockedProvider.js +4 -4
  292. package/testing/react/MockedProvider.js.map +1 -0
  293. package/testing/testing.cjs +58 -0
  294. package/testing/testing.cjs.map +1 -0
  295. package/utilities/common/errorHandling.d.ts +1 -1
  296. package/utilities/common/errorHandling.d.ts.map +1 -1
  297. package/utilities/common/errorHandling.js.map +1 -1
  298. package/utilities/common/makeUniqueId.js +1 -1
  299. package/utilities/common/makeUniqueId.js.map +1 -1
  300. package/utilities/common/mergeDeep.d.ts.map +1 -1
  301. package/utilities/common/mergeDeep.js +6 -1
  302. package/utilities/common/mergeDeep.js.map +1 -1
  303. package/utilities/globals/fix-graphql.js +1 -1
  304. package/utilities/globals/global.d.ts.map +1 -1
  305. package/utilities/globals/global.js +1 -1
  306. package/utilities/globals/global.js.map +1 -1
  307. package/utilities/globals/{globals.cjs.js → globals.cjs} +3 -3
  308. package/utilities/globals/globals.cjs.map +1 -0
  309. package/utilities/globals/index.js +1 -1
  310. package/utilities/globals/package.json +2 -1
  311. package/utilities/graphql/directives.js +5 -5
  312. package/utilities/graphql/directives.js.map +1 -1
  313. package/utilities/graphql/fragments.d.ts.map +1 -1
  314. package/utilities/graphql/fragments.js +4 -4
  315. package/utilities/graphql/fragments.js.map +1 -1
  316. package/utilities/graphql/getFromAST.js +8 -8
  317. package/utilities/graphql/getFromAST.js.map +1 -1
  318. package/utilities/graphql/storeUtils.js +6 -6
  319. package/utilities/graphql/storeUtils.js.map +1 -1
  320. package/utilities/graphql/transform.d.ts.map +1 -1
  321. package/utilities/graphql/transform.js.map +1 -1
  322. package/utilities/observables/Concast.d.ts +0 -1
  323. package/utilities/observables/Concast.d.ts.map +1 -1
  324. package/utilities/observables/asyncMap.d.ts +0 -1
  325. package/utilities/observables/asyncMap.d.ts.map +1 -1
  326. package/utilities/observables/subclassing.d.ts +0 -1
  327. package/utilities/observables/subclassing.d.ts.map +1 -1
  328. package/utilities/package.json +2 -1
  329. package/utilities/{utilities.cjs.js → utilities.cjs} +31 -26
  330. package/utilities/utilities.cjs.map +1 -0
  331. package/version.js +1 -1
  332. package/apollo-client.cjs.js.map +0 -1
  333. package/apollo-client.cjs.min.js +0 -1
  334. package/cache/cache.cjs.js.map +0 -1
  335. package/core/core.cjs.js.map +0 -1
  336. package/errors/errors.cjs.js.map +0 -1
  337. package/link/batch/batch.cjs.js.map +0 -1
  338. package/link/batch-http/batch-http.cjs.js.map +0 -1
  339. package/link/context/context.cjs.js.map +0 -1
  340. package/link/core/core.cjs.js.map +0 -1
  341. package/link/error/error.cjs.js.map +0 -1
  342. package/link/http/http.cjs.js.map +0 -1
  343. package/link/persisted-queries/persisted-queries.cjs.js.map +0 -1
  344. package/link/retry/retry.cjs.js.map +0 -1
  345. package/link/schema/schema.cjs.js.map +0 -1
  346. package/link/utils/utils.cjs.js.map +0 -1
  347. package/link/ws/ws.cjs.js.map +0 -1
  348. package/main.cjs.js.map +0 -1
  349. package/react/components/components.cjs.js.map +0 -1
  350. package/react/context/context.cjs.js.map +0 -1
  351. package/react/data/MutationData.d.ts +0 -29
  352. package/react/data/MutationData.d.ts.map +0 -1
  353. package/react/data/MutationData.js +0 -115
  354. package/react/data/MutationData.js.map +0 -1
  355. package/react/data/OperationData.d.ts +0 -24
  356. package/react/data/OperationData.d.ts.map +0 -1
  357. package/react/data/OperationData.js +0 -53
  358. package/react/data/OperationData.js.map +0 -1
  359. package/react/data/QueryData.d.ts +0 -44
  360. package/react/data/QueryData.d.ts.map +0 -1
  361. package/react/data/QueryData.js +0 -298
  362. package/react/data/QueryData.js.map +0 -1
  363. package/react/data/SubscriptionData.d.ts +0 -28
  364. package/react/data/SubscriptionData.d.ts.map +0 -1
  365. package/react/data/SubscriptionData.js +0 -122
  366. package/react/data/SubscriptionData.js.map +0 -1
  367. package/react/data/data.cjs.js +0 -581
  368. package/react/data/data.cjs.js.map +0 -1
  369. package/react/data/index.d.ts +0 -6
  370. package/react/data/index.d.ts.map +0 -1
  371. package/react/data/index.js +0 -6
  372. package/react/data/index.js.map +0 -1
  373. package/react/data/package.json +0 -7
  374. package/react/hoc/hoc.cjs.js.map +0 -1
  375. package/react/hooks/hooks.cjs.js +0 -195
  376. package/react/hooks/hooks.cjs.js.map +0 -1
  377. package/react/hooks/utils/useAfterFastRefresh.d.ts +0 -3
  378. package/react/hooks/utils/useAfterFastRefresh.d.ts.map +0 -1
  379. package/react/hooks/utils/useAfterFastRefresh.js +0 -19
  380. package/react/hooks/utils/useAfterFastRefresh.js.map +0 -1
  381. package/react/hooks/utils/useBaseQuery.d.ts +0 -7
  382. package/react/hooks/utils/useBaseQuery.d.ts.map +0 -1
  383. package/react/hooks/utils/useBaseQuery.js +0 -55
  384. package/react/hooks/utils/useBaseQuery.js.map +0 -1
  385. package/react/hooks/utils/useDeepMemo.d.ts +0 -2
  386. package/react/hooks/utils/useDeepMemo.d.ts.map +0 -1
  387. package/react/hooks/utils/useDeepMemo.js +0 -10
  388. package/react/hooks/utils/useDeepMemo.js.map +0 -1
  389. package/react/parser/parser.cjs.js.map +0 -1
  390. package/react/react.cjs.js.map +0 -1
  391. package/react/ssr/ssr.cjs.js.map +0 -1
  392. package/testing/testing.cjs.js.map +0 -1
  393. package/utilities/globals/globals.cjs.js.map +0 -1
  394. package/utilities/testing/index.d.ts.map +0 -1
  395. package/utilities/testing/index.js.map +0 -1
  396. package/utilities/testing/itAsync.d.ts.map +0 -1
  397. package/utilities/testing/itAsync.js.map +0 -1
  398. package/utilities/testing/mocking/MockedProvider.d.ts.map +0 -1
  399. package/utilities/testing/mocking/MockedProvider.js.map +0 -1
  400. package/utilities/testing/mocking/mockClient.d.ts.map +0 -1
  401. package/utilities/testing/mocking/mockClient.js.map +0 -1
  402. package/utilities/testing/mocking/mockFetch.d.ts.map +0 -1
  403. package/utilities/testing/mocking/mockFetch.js.map +0 -1
  404. package/utilities/testing/mocking/mockLink.d.ts.map +0 -1
  405. package/utilities/testing/mocking/mockLink.js.map +0 -1
  406. package/utilities/testing/mocking/mockQueryManager.d.ts.map +0 -1
  407. package/utilities/testing/mocking/mockQueryManager.js.map +0 -1
  408. package/utilities/testing/mocking/mockSubscriptionLink.d.ts.map +0 -1
  409. package/utilities/testing/mocking/mockSubscriptionLink.js.map +0 -1
  410. package/utilities/testing/mocking/mockWatchQuery.d.ts.map +0 -1
  411. package/utilities/testing/mocking/mockWatchQuery.js.map +0 -1
  412. package/utilities/testing/observableToPromise.d.ts.map +0 -1
  413. package/utilities/testing/observableToPromise.js.map +0 -1
  414. package/utilities/testing/subscribeAndCount.d.ts +0 -5
  415. package/utilities/testing/subscribeAndCount.d.ts.map +0 -1
  416. package/utilities/testing/subscribeAndCount.js.map +0 -1
  417. package/utilities/testing/withConsoleSpy.d.ts.map +0 -1
  418. package/utilities/testing/withConsoleSpy.js.map +0 -1
  419. package/utilities/testing/wrap.d.ts.map +0 -1
  420. package/utilities/testing/wrap.js.map +0 -1
  421. package/utilities/utilities.cjs.js.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"persisted-queries.cjs","sources":["index.js"],"sourcesContent":["import { __assign } from \"tslib\";\nimport { invariant } from '../../utilities/globals';\nimport { print } from 'graphql';\nimport { ApolloLink } from '../core';\nimport { Observable, compact, } from '../../utilities';\nexport var VERSION = 1;\nexport var PersistedQueryLink;\n(function (PersistedQueryLink) {\n ;\n ;\n ;\n})(PersistedQueryLink || (PersistedQueryLink = {}));\nvar defaultOptions = {\n disable: function (_a) {\n var graphQLErrors = _a.graphQLErrors, operation = _a.operation;\n if (graphQLErrors &&\n graphQLErrors.some(function (_a) {\n var message = _a.message;\n return message === 'PersistedQueryNotSupported';\n })) {\n return true;\n }\n var response = operation.getContext().response;\n if (response &&\n response.status &&\n (response.status === 400 || response.status === 500)) {\n return true;\n }\n return false;\n },\n useGETForHashedQueries: false,\n};\nfunction operationDefinesMutation(operation) {\n return operation.query.definitions.some(function (d) { return d.kind === 'OperationDefinition' && d.operation === 'mutation'; });\n}\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\nvar hashesByQuery = new WeakMap();\nvar nextHashesChildKey = 0;\nexport var createPersistedQueryLink = function (options) {\n __DEV__ ? invariant(options && (typeof options.sha256 === 'function' ||\n typeof options.generateHash === 'function'), 'Missing/invalid \"sha256\" or \"generateHash\" function. Please ' +\n 'configure one using the \"createPersistedQueryLink(options)\" options ' +\n 'parameter.') : invariant(options && (typeof options.sha256 === 'function' ||\n typeof options.generateHash === 'function'), 22);\n var _a = compact(defaultOptions, options), sha256 = _a.sha256, _b = _a.generateHash, generateHash = _b === void 0 ? function (query) {\n return Promise.resolve(sha256(print(query)));\n } : _b, disable = _a.disable, useGETForHashedQueries = _a.useGETForHashedQueries;\n var supportsPersistedQueries = true;\n var hashesChildKey = 'forLink' + nextHashesChildKey++;\n var getHashPromise = function (query) {\n return new Promise(function (resolve) { return resolve(generateHash(query)); });\n };\n function getQueryHash(query) {\n if (!query || typeof query !== 'object') {\n return getHashPromise(query);\n }\n var hashes = hashesByQuery.get(query);\n if (!hashes)\n hashesByQuery.set(query, hashes = Object.create(null));\n return hasOwnProperty.call(hashes, hashesChildKey)\n ? hashes[hashesChildKey]\n : hashes[hashesChildKey] = getHashPromise(query);\n }\n return new ApolloLink(function (operation, forward) {\n __DEV__ ? invariant(forward, 'PersistedQueryLink cannot be the last link in the chain.') : invariant(forward, 23);\n var query = operation.query;\n return new Observable(function (observer) {\n var subscription;\n var retried = false;\n var originalFetchOptions;\n var setFetchOptions = false;\n var retry = function (_a, cb) {\n var response = _a.response, networkError = _a.networkError;\n if (!retried && ((response && response.errors) || networkError)) {\n retried = true;\n var disablePayload = {\n response: response,\n networkError: networkError,\n operation: operation,\n graphQLErrors: response ? response.errors : undefined,\n };\n supportsPersistedQueries = !disable(disablePayload);\n if ((response &&\n response.errors &&\n response.errors.some(function (_a) {\n var message = _a.message;\n return message === 'PersistedQueryNotFound';\n })) ||\n !supportsPersistedQueries) {\n if (subscription)\n subscription.unsubscribe();\n operation.setContext({\n http: {\n includeQuery: true,\n includeExtensions: supportsPersistedQueries,\n },\n fetchOptions: {\n method: 'POST',\n },\n });\n if (setFetchOptions) {\n operation.setContext({ fetchOptions: originalFetchOptions });\n }\n subscription = forward(operation).subscribe(handler);\n return;\n }\n }\n cb();\n };\n var handler = {\n next: function (response) {\n retry({ response: response }, function () { return observer.next(response); });\n },\n error: function (networkError) {\n retry({ networkError: networkError }, function () { return observer.error(networkError); });\n },\n complete: observer.complete.bind(observer),\n };\n operation.setContext({\n http: {\n includeQuery: !supportsPersistedQueries,\n includeExtensions: supportsPersistedQueries,\n },\n });\n if (useGETForHashedQueries &&\n supportsPersistedQueries &&\n !operationDefinesMutation(operation)) {\n operation.setContext(function (_a) {\n var _b = _a.fetchOptions, fetchOptions = _b === void 0 ? {} : _b;\n originalFetchOptions = fetchOptions;\n return {\n fetchOptions: __assign(__assign({}, fetchOptions), { method: 'GET' }),\n };\n });\n setFetchOptions = true;\n }\n if (supportsPersistedQueries) {\n getQueryHash(query).then(function (sha256Hash) {\n operation.extensions.persistedQuery = {\n version: VERSION,\n sha256Hash: sha256Hash,\n };\n subscription = forward(operation).subscribe(handler);\n }).catch(observer.error.bind(observer));\n ;\n }\n else {\n subscription = forward(operation).subscribe(handler);\n }\n return function () {\n if (subscription)\n subscription.unsubscribe();\n };\n });\n });\n};\n//# sourceMappingURL=index.js.map"],"names":["PersistedQueryLink","invariant","compact","print","ApolloLink","Observable","__assign"],"mappings":";;;;;;;;;;AAKU,IAAC,OAAO,GAAG,EAAE;AACZA,oCAAmB;AAC9B,CAAC,UAAU,kBAAkB,EAAE;AAI/B,CAAC,EAAEA,0BAAkB,KAAKA,0BAAkB,GAAG,EAAE,CAAC,CAAC,CAAC;AACpD,IAAI,cAAc,GAAG;AACrB,IAAI,OAAO,EAAE,UAAU,EAAE,EAAE;AAC3B,QAAQ,IAAI,aAAa,GAAG,EAAE,CAAC,aAAa,EAAE,SAAS,GAAG,EAAE,CAAC,SAAS,CAAC;AACvE,QAAQ,IAAI,aAAa;AACzB,YAAY,aAAa,CAAC,IAAI,CAAC,UAAU,EAAE,EAAE;AAC7C,gBAAgB,IAAI,OAAO,GAAG,EAAE,CAAC,OAAO,CAAC;AACzC,gBAAgB,OAAO,OAAO,KAAK,4BAA4B,CAAC;AAChE,aAAa,CAAC,EAAE;AAChB,YAAY,OAAO,IAAI,CAAC;AACxB,SAAS;AACT,QAAQ,IAAI,QAAQ,GAAG,SAAS,CAAC,UAAU,EAAE,CAAC,QAAQ,CAAC;AACvD,QAAQ,IAAI,QAAQ;AACpB,YAAY,QAAQ,CAAC,MAAM;AAC3B,aAAa,QAAQ,CAAC,MAAM,KAAK,GAAG,IAAI,QAAQ,CAAC,MAAM,KAAK,GAAG,CAAC,EAAE;AAClE,YAAY,OAAO,IAAI,CAAC;AACxB,SAAS;AACT,QAAQ,OAAO,KAAK,CAAC;AACrB,KAAK;AACL,IAAI,sBAAsB,EAAE,KAAK;AACjC,CAAC,CAAC;AACF,SAAS,wBAAwB,CAAC,SAAS,EAAE;AAC7C,IAAI,OAAO,SAAS,CAAC,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AAG,EAAE,KAAK,KAAK,CAAC,GAAG,EAAE,GAAG,EAAE,CAAC;AACrF,oBAAoB,oBAAoB,GAAG,YAAY,CAAC;AACxD,oBAAoB,OAAO;AAC3B,wBAAwB,YAAY,EAAEC,cAAQ,CAACA,cAAQ,CAAC,EAAE,EAAE,YAAY,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC;AAC7F,qBAAqB,CAAC;AACtB,iBAAiB,CAAC,CAAC;AACnB,gBAAgB,eAAe,GAAG,IAAI,CAAC;AACvC,aAAa;AACb,YAAY,IAAI,wBAAwB,EAAE;AAC1C,gBAAgB,YAAY,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,UAAU,UAAU,EAAE;AAC/D,oBAAoB,SAAS,CAAC,UAAU,CAAC,cAAc,GAAG;AAC1D,wBAAwB,OAAO,EAAE,OAAO;AACxC,wBAAwB,UAAU,EAAE,UAAU;AAC9C,qBAAqB,CAAC;AACtB,oBAAoB,YAAY,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;AACzE,iBAAiB,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC;AAExD,aAAa;AACb,iBAAiB;AACjB,gBAAgB,YAAY,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;AACrE,aAAa;AACb,YAAY,OAAO,YAAY;AAC/B,gBAAgB,IAAI,YAAY;AAChC,oBAAoB,YAAY,CAAC,WAAW,EAAE,CAAC;AAC/C,aAAa,CAAC;AACd,SAAS,CAAC,CAAC;AACX,KAAK,CAAC,CAAC;AACP;;;;;"}
@@ -1,6 +1,7 @@
1
1
  {
2
2
  "name": "@apollo/client/link/retry",
3
- "main": "retry.cjs.js",
3
+ "type": "module",
4
+ "main": "retry.cjs",
4
5
  "module": "index.js",
5
6
  "types": "index.d.ts",
6
7
  "sideEffects": false
@@ -167,4 +167,4 @@ var RetryLink = (function (_super) {
167
167
  }(core.ApolloLink));
168
168
 
169
169
  exports.RetryLink = RetryLink;
170
- //# sourceMappingURL=retry.cjs.js.map
170
+ //# sourceMappingURL=retry.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"retry.cjs","sources":["delayFunction.js","retryFunction.js","retryLink.js"],"sourcesContent":["export function buildDelayFunction(delayOptions) {\n var _a = delayOptions || {}, _b = _a.initial, initial = _b === void 0 ? 300 : _b, _c = _a.jitter, jitter = _c === void 0 ? true : _c, _d = _a.max, max = _d === void 0 ? Infinity : _d;\n var baseDelay = jitter ? initial : initial / 2;\n return function delayFunction(count) {\n var delay = Math.min(max, baseDelay * Math.pow(2, count));\n if (jitter) {\n delay = Math.random() * delay;\n }\n return delay;\n };\n}\n//# sourceMappingURL=delayFunction.js.map","export function buildRetryFunction(retryOptions) {\n var _a = retryOptions || {}, retryIf = _a.retryIf, _b = _a.max, max = _b === void 0 ? 5 : _b;\n return function retryFunction(count, operation, error) {\n if (count >= max)\n return false;\n return retryIf ? retryIf(error, operation) : !!error;\n };\n}\n//# sourceMappingURL=retryFunction.js.map","import { __awaiter, __extends, __generator } from \"tslib\";\nimport { ApolloLink } from '../core';\nimport { Observable } from '../../utilities';\nimport { buildDelayFunction, } from './delayFunction';\nimport { buildRetryFunction, } from './retryFunction';\nvar RetryableOperation = (function () {\n function RetryableOperation(operation, nextLink, delayFor, retryIf) {\n var _this = this;\n this.operation = operation;\n this.nextLink = nextLink;\n this.delayFor = delayFor;\n this.retryIf = retryIf;\n this.retryCount = 0;\n this.values = [];\n this.complete = false;\n this.canceled = false;\n this.observers = [];\n this.currentSubscription = null;\n this.onNext = function (value) {\n _this.values.push(value);\n for (var _i = 0, _a = _this.observers; _i < _a.length; _i++) {\n var observer = _a[_i];\n if (!observer)\n continue;\n observer.next(value);\n }\n };\n this.onComplete = function () {\n _this.complete = true;\n for (var _i = 0, _a = _this.observers; _i < _a.length; _i++) {\n var observer = _a[_i];\n if (!observer)\n continue;\n observer.complete();\n }\n };\n this.onError = function (error) { return __awaiter(_this, void 0, void 0, function () {\n var shouldRetry, _i, _a, observer;\n return __generator(this, function (_b) {\n switch (_b.label) {\n case 0:\n this.retryCount += 1;\n return [4, this.retryIf(this.retryCount, this.operation, error)];\n case 1:\n shouldRetry = _b.sent();\n if (shouldRetry) {\n this.scheduleRetry(this.delayFor(this.retryCount, this.operation, error));\n return [2];\n }\n this.error = error;\n for (_i = 0, _a = this.observers; _i < _a.length; _i++) {\n observer = _a[_i];\n if (!observer)\n continue;\n observer.error(error);\n }\n return [2];\n }\n });\n }); };\n }\n RetryableOperation.prototype.subscribe = function (observer) {\n if (this.canceled) {\n throw new Error(\"Subscribing to a retryable link that was canceled is not supported\");\n }\n this.observers.push(observer);\n for (var _i = 0, _a = this.values; _i < _a.length; _i++) {\n var value = _a[_i];\n observer.next(value);\n }\n if (this.complete) {\n observer.complete();\n }\n else if (this.error) {\n observer.error(this.error);\n }\n };\n RetryableOperation.prototype.unsubscribe = function (observer) {\n var index = this.observers.indexOf(observer);\n if (index < 0) {\n throw new Error(\"RetryLink BUG! Attempting to unsubscribe unknown observer!\");\n }\n this.observers[index] = null;\n if (this.observers.every(function (o) { return o === null; })) {\n this.cancel();\n }\n };\n RetryableOperation.prototype.start = function () {\n if (this.currentSubscription)\n return;\n this.try();\n };\n RetryableOperation.prototype.cancel = function () {\n if (this.currentSubscription) {\n this.currentSubscription.unsubscribe();\n }\n clearTimeout(this.timerId);\n this.timerId = undefined;\n this.currentSubscription = null;\n this.canceled = true;\n };\n RetryableOperation.prototype.try = function () {\n this.currentSubscription = this.nextLink(this.operation).subscribe({\n next: this.onNext,\n error: this.onError,\n complete: this.onComplete,\n });\n };\n RetryableOperation.prototype.scheduleRetry = function (delay) {\n var _this = this;\n if (this.timerId) {\n throw new Error(\"RetryLink BUG! Encountered overlapping retries\");\n }\n this.timerId = setTimeout(function () {\n _this.timerId = undefined;\n _this.try();\n }, delay);\n };\n return RetryableOperation;\n}());\nvar RetryLink = (function (_super) {\n __extends(RetryLink, _super);\n function RetryLink(options) {\n var _this = _super.call(this) || this;\n var _a = options || {}, attempts = _a.attempts, delay = _a.delay;\n _this.delayFor =\n typeof delay === 'function' ? delay : buildDelayFunction(delay);\n _this.retryIf =\n typeof attempts === 'function' ? attempts : buildRetryFunction(attempts);\n return _this;\n }\n RetryLink.prototype.request = function (operation, nextLink) {\n var retryable = new RetryableOperation(operation, nextLink, this.delayFor, this.retryIf);\n retryable.start();\n return new Observable(function (observer) {\n retryable.subscribe(observer);\n return function () {\n retryable.unsubscribe(observer);\n };\n });\n };\n return RetryLink;\n}(ApolloLink));\nexport { RetryLink };\n//# sourceMappingURL=retryLink.js.map"],"names":["__awaiter","__generator","__extends","Observable","ApolloLink"],"mappings":";;;;;;;;AAAO,SAAS,kBAAkB,CAAC,YAAY,EAAE;AACjD,IAAI,IAAI,EAAE,GAAG,YAAY,IAAI,EAAE,EAAE,EAAE,GAAG,EAAE,CAAC,OAAO,EAAE,OAAO,GAAG,EAAE,KAAK,KAAK,CAAC,GAAG,GAAG,GAAG,EAAE,EAAE,EAAE,GAAG,EAAE,CAAC,MAAM,EAAE,MAAM,GAAG,EAAE,KAAK,KAAK,CAAC,GAAG,IAAI,GAAG,EAAE,EAAE,EAAE,GAAG,EAAE,CAAC,GAAG,EAAE,GAAG,GAAG,EAAE,KAAK,KAAK,CAAC,GAAG,QAAQ,GAAG,EAAE,CAAC;AAC3L,IAAI,IAAI,SAAS,GAAG,MAAM,GAAG,OAAO,GAAG,OAAO,GAAG,CAAC,CAAC;AACnD,IAAI,OAAO,SAAS,aAAa,CAAC,KAAK,EAAE;AACzC,QAAQ,IAAI,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,SAAS,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC;AAClE,QAAQ,IAAI,MAAM,EAAE;AACpB,YAAY,KAAK,GAAG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;;"}
@@ -1,4 +1,3 @@
1
- /// <reference types="zen-observable" />
2
1
  import { ApolloLink, Operation, FetchResult, NextLink } from '../core';
3
2
  import { Observable } from '../../utilities';
4
3
  import { DelayFunction, DelayFunctionOptions } from './delayFunction';
@@ -1 +1 @@
1
- {"version":3,"file":"retryLink.d.ts","sourceRoot":"","sources":["../../../src/link/retry/retryLink.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACvE,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EACL,aAAa,EACb,oBAAoB,EAErB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,aAAa,EACb,oBAAoB,EAErB,MAAM,iBAAiB,CAAC;AAEzB,yBAAiB,SAAS,CAAC;IACzB,UAAiB,OAAO;QAItB,KAAK,CAAC,EAAE,oBAAoB,GAAG,aAAa,CAAC;QAK7C,QAAQ,CAAC,EAAE,oBAAoB,GAAG,aAAa,CAAC;KACjD;CACF;AAsJD,qBAAa,SAAU,SAAQ,UAAU;IACvC,OAAO,CAAC,QAAQ,CAAgB;IAChC,OAAO,CAAC,OAAO,CAAgB;gBAEnB,OAAO,CAAC,EAAE,SAAS,CAAC,OAAO;IAShC,OAAO,CACZ,SAAS,EAAE,SAAS,EACpB,QAAQ,EAAE,QAAQ,GACjB,UAAU,CAAC,WAAW,CAAC;CAgB3B"}
1
+ {"version":3,"file":"retryLink.d.ts","sourceRoot":"","sources":["../../../src/link/retry/retryLink.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACvE,OAAO,EAAE,UAAU,EAAoC,MAAM,iBAAiB,CAAC;AAC/E,OAAO,EACL,aAAa,EACb,oBAAoB,EAErB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,aAAa,EACb,oBAAo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QACF,SAAS,CAAC,KAAK,EAAE,CAAC;QAElB,OAAO,IAAI,UAAU,CAAC,UAAA,QAAQ;YAC5B,SAAS,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC;YAC9B,OAAO;gBACL,SAAS,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC;YAClC,CAAC,CAAC;QACJ,CAAC,CAAC,CAAC;IACL,CAAC;IACH,gBAAC;AAAD,CAAC,AAhCD,CAA+B,UAAU,GAgCxC","sourcesContent":["import { ApolloLink, Operation, FetchResult, NextLink } from '../core';\nimport { Observable } from '../../utilities';\nimport {\n DelayFunction,\n DelayFunctionOptions,\n buildDelayFunction,\n} from './delayFunction';\nimport {\n RetryFunction,\n RetryFunctionOptions,\n buildRetryFunction,\n} from './retryFunction';\n\nexport namespace RetryLink {\n export interface Options {\n /**\n * Configuration for the delay strategy to use, or a custom delay strategy.\n */\n delay?: DelayFunctionOptions | DelayFunction;\n\n /**\n * Configuration for the retry strategy to use, or a custom retry strategy.\n */\n attempts?: RetryFunctionOptions | RetryFunction;\n }\n}\n\n/**\n * Tracking and management of operations that may be (or currently are) retried.\n */\nclass RetryableOperation<TValue = any> {\n private retryCount: number = 0;\n private values: any[] = [];\n private error: any;\n private complete = false;\n private canceled = false;\n private observers: (ZenObservable.Observer<TValue> | null)[] = [];\n private currentSubscription: ZenObservable.Subscription | null = null;\n private timerId: number | undefined;\n\n constructor(\n private operation: Operation,\n private nextLink: NextLink,\n private delayFor: DelayFunction,\n private retryIf: RetryFunction,\n ) {}\n\n /**\n * Register a new observer for this operation.\n *\n * If the operation has previously emitted other events, they will be\n * immediately triggered for the observer.\n */\n public subscribe(observer: ZenObservable.Observer<TValue>) {\n if (this.canceled) {\n throw new Error(\n `Subscribing to a retryable link that was canceled is not supported`,\n );\n }\n this.observers.push(observer);\n\n // If we've already begun, catch this observer up.\n for (const value of this.values) {\n observer.next!(value);\n }\n\n if (this.complete) {\n observer.complete!();\n } else if (this.error) {\n observer.error!(this.error);\n }\n }\n\n /**\n * Remove a previously registered observer from this operation.\n *\n * If no observers remain, the operation will stop retrying, and unsubscribe\n * from its downstream link.\n */\n public unsubscribe(observer: ZenObservable.Observer<TValue>) {\n const index = this.observers.indexOf(observer);\n if (index < 0) {\n throw new Error(\n `RetryLink BUG! Attempting to unsubscribe unknown observer!`,\n );\n }\n // Note that we are careful not to change the order of length of the array,\n // as we are often mid-iteration when calling this method.\n this.observers[index] = null;\n\n // If this is the last observer, we're done.\n if (this.observers.every(o => o === null)) {\n this.cancel();\n }\n }\n\n /**\n * Start the initial request.\n */\n public start() {\n if (this.currentSubscription) return; // Already started.\n\n this.try();\n }\n\n /**\n * Stop retrying for the operation, and cancel any in-progress requests.\n */\n public cancel() {\n if (this.currentSubscription) {\n this.currentSubscription.unsubscribe();\n }\n clearTimeout(this.timerId);\n this.timerId = undefined;\n this.currentSubscription = null;\n this.canceled = true;\n }\n\n private try() {\n this.currentSubscription = this.nextLink(this.operation).subscribe({\n next: this.onNext,\n error: this.onError,\n complete: this.onComplete,\n });\n }\n\n private onNext = (value: any) => {\n this.values.push(value);\n for (const observer of this.observers) {\n if (!observer) continue;\n observer.next!(value);\n }\n };\n\n private onComplete = () => {\n this.complete = true;\n for (const observer of this.observers) {\n if (!observer) continue;\n observer.complete!();\n }\n };\n\n private onError = async (error: any) => {\n this.retryCount += 1;\n\n // Should we retry?\n const shouldRetry = await this.retryIf(\n this.retryCount,\n this.operation,\n error,\n );\n if (shouldRetry) {\n this.scheduleRetry(this.delayFor(this.retryCount, this.operation, error));\n return;\n }\n\n this.error = error;\n for (const observer of this.observers) {\n if (!observer) continue;\n observer.error!(error);\n }\n };\n\n private scheduleRetry(delay: number) {\n if (this.timerId) {\n throw new Error(`RetryLink BUG! Encountered overlapping retries`);\n }\n\n this.timerId = (setTimeout(() => {\n this.timerId = undefined;\n this.try();\n }, delay) as any) as number;\n }\n}\n\nexport class RetryLink extends ApolloLink {\n private delayFor: DelayFunction;\n private retryIf: RetryFunction;\n\n constructor(options?: RetryLink.Options) {\n super();\n const { attempts, delay } = options || ({} as RetryLink.Options);\n this.delayFor =\n typeof delay === 'function' ? delay : buildDelayFunction(delay);\n this.retryIf =\n typeof attempts === 'function' ? attempts : buildRetryFunction(attempts);\n }\n\n public request(\n operation: Operation,\n nextLink: NextLink,\n ): Observable<FetchResult> {\n const retryable = new RetryableOperation(\n operation,\n nextLink,\n this.delayFor,\n this.retryIf,\n );\n retryable.start();\n\n return new Observable(observer => {\n retryable.subscribe(observer);\n return () => {\n retryable.unsubscribe(observer);\n };\n });\n }\n}\n"]}
1
+ {"version":3,"file":"retryLink.js","sourceRoot":"","sources":["../../../src/link/retry/retryLink.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAoC,MAAM,SAAS,CAAC;AACvE,OAAO,EAAE,UAAU,EAAoC,MAAM,iBAAiB,CAAC;AAC/E,OAAO,EAGL,kBAAkB,GACnB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAGL,kBAAkB,GACnB,MAAM,iBAAiB,CAAC;AAmBzB;IAUE,4BACU,SAAoB,EACpB,QAAkB,EAClB,QAAuB,EACvB,OAAsB;QAJhC,iBAKI;QAJM,cAAS,GAAT,SAAS,CAAW;QACpB,aAAQ,GAAR,QAAQ,CAAU;QAClB,aAAQ,GAAR,QAAQ,CAAe;QACvB,YAAO,GAAP,OAAO,CAAe;QAbxB,eAAU,GAAW,CAAC,CAAC;QACvB,WAAM,GAAU,EAAE,CAAC;QAEnB,aAAQ,GAAG,KAAK,CAAC;QACjB,aAAQ,GAAG,KAAK,CAAC;QACjB,cAAS,GAAgC,EAAE,CAAC;QAC5C,wBAAmB,GAAkC,IAAI,CAAC;QAyF1D,WAAM,GAAG,UAAC,KAAU;YAC1B,KAAI,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;YACxB,KAAuB,UAAc,EAAd,KAAA,KAAI,CAAC,SAAS,EAAd,cAAc,EAAd,IAAc,EAAE;gBAAlC,IAAM,QAAQ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CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC;YAC9B,OAAO;gBACL,SAAS,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC;YAClC,CAAC,CAAC;QACJ,CAAC,CAAC,CAAC;IACL,CAAC;IACH,gBAAC;AAAD,CAAC,AAhCD,CAA+B,UAAU,GAgCxC","sourcesContent":["import { ApolloLink, Operation, FetchResult, NextLink } from '../core';\nimport { Observable, Observer, ObservableSubscription } from '../../utilities';\nimport {\n DelayFunction,\n DelayFunctionOptions,\n buildDelayFunction,\n} from './delayFunction';\nimport {\n RetryFunction,\n RetryFunctionOptions,\n buildRetryFunction,\n} from './retryFunction';\n\nexport namespace RetryLink {\n export interface Options {\n /**\n * Configuration for the delay strategy to use, or a custom delay strategy.\n */\n delay?: DelayFunctionOptions | DelayFunction;\n\n /**\n * Configuration for the retry strategy to use, or a custom retry strategy.\n */\n attempts?: RetryFunctionOptions | RetryFunction;\n }\n}\n\n/**\n * Tracking and management of operations that may be (or currently are) retried.\n */\nclass RetryableOperation<TValue = any> {\n private retryCount: number = 0;\n private values: any[] = [];\n private error: any;\n private complete = false;\n private canceled = false;\n private observers: (Observer<TValue> | null)[] = [];\n private currentSubscription: ObservableSubscription | null = null;\n private timerId: number | undefined;\n\n constructor(\n private operation: Operation,\n private nextLink: NextLink,\n private delayFor: DelayFunction,\n private retryIf: RetryFunction,\n ) {}\n\n /**\n * Register a new observer for this operation.\n *\n * If the operation has previously emitted other events, they will be\n * immediately triggered for the observer.\n */\n public subscribe(observer: Observer<TValue>) {\n if (this.canceled) {\n throw new Error(\n `Subscribing to a retryable link that was canceled is not supported`,\n );\n }\n this.observers.push(observer);\n\n // If we've already begun, catch this observer up.\n for (const value of this.values) {\n observer.next!(value);\n }\n\n if (this.complete) {\n observer.complete!();\n } else if (this.error) {\n observer.error!(this.error);\n }\n }\n\n /**\n * Remove a previously registered observer from this operation.\n *\n * If no observers remain, the operation will stop retrying, and unsubscribe\n * from its downstream link.\n */\n public unsubscribe(observer: Observer<TValue>) {\n const index = this.observers.indexOf(observer);\n if (index < 0) {\n throw new Error(\n `RetryLink BUG! Attempting to unsubscribe unknown observer!`,\n );\n }\n // Note that we are careful not to change the order of length of the array,\n // as we are often mid-iteration when calling this method.\n this.observers[index] = null;\n\n // If this is the last observer, we're done.\n if (this.observers.every(o => o === null)) {\n this.cancel();\n }\n }\n\n /**\n * Start the initial request.\n */\n public start() {\n if (this.currentSubscription) return; // Already started.\n\n this.try();\n }\n\n /**\n * Stop retrying for the operation, and cancel any in-progress requests.\n */\n public cancel() {\n if (this.currentSubscription) {\n this.currentSubscription.unsubscribe();\n }\n clearTimeout(this.timerId);\n this.timerId = undefined;\n this.currentSubscription = null;\n this.canceled = true;\n }\n\n private try() {\n this.currentSubscription = this.nextLink(this.operation).subscribe({\n next: this.onNext,\n error: this.onError,\n complete: this.onComplete,\n });\n }\n\n private onNext = (value: any) => {\n this.values.push(value);\n for (const observer of this.observers) {\n if (!observer) continue;\n observer.next!(value);\n }\n };\n\n private onComplete = () => {\n this.complete = true;\n for (const observer of this.observers) {\n if (!observer) continue;\n observer.complete!();\n }\n };\n\n private onError = async (error: any) => {\n this.retryCount += 1;\n\n // Should we retry?\n const shouldRetry = await this.retryIf(\n this.retryCount,\n this.operation,\n error,\n );\n if (shouldRetry) {\n this.scheduleRetry(this.delayFor(this.retryCount, this.operation, error));\n return;\n }\n\n this.error = error;\n for (const observer of this.observers) {\n if (!observer) continue;\n observer.error!(error);\n }\n };\n\n private scheduleRetry(delay: number) {\n if (this.timerId) {\n throw new Error(`RetryLink BUG! Encountered overlapping retries`);\n }\n\n this.timerId = (setTimeout(() => {\n this.timerId = undefined;\n this.try();\n }, delay) as any) as number;\n }\n}\n\nexport class RetryLink extends ApolloLink {\n private delayFor: DelayFunction;\n private retryIf: RetryFunction;\n\n constructor(options?: RetryLink.Options) {\n super();\n const { attempts, delay } = options || ({} as RetryLink.Options);\n this.delayFor =\n typeof delay === 'function' ? delay : buildDelayFunction(delay);\n this.retryIf =\n typeof attempts === 'function' ? attempts : buildRetryFunction(attempts);\n }\n\n public request(\n operation: Operation,\n nextLink: NextLink,\n ): Observable<FetchResult> {\n const retryable = new RetryableOperation(\n operation,\n nextLink,\n this.delayFor,\n this.retryIf,\n );\n retryable.start();\n\n return new Observable(observer => {\n retryable.subscribe(observer);\n return () => {\n retryable.unsubscribe(observer);\n };\n });\n }\n}\n"]}
@@ -1,4 +1,3 @@
1
- /// <reference types="zen-observable" />
2
1
  import { GraphQLSchema } from 'graphql';
3
2
  import { ApolloLink, Operation, FetchResult } from '../core';
4
3
  import { Observable } from '../../utilities';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/link/schema/index.ts"],"names":[],"mappings":";AAAA,OAAO,EAAqB,aAAa,EAAE,MAAM,SAAS,CAAC;AAE3D,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAC7D,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAE7C,yBAAiB,UAAU,CAAC;IAC1B,KAAY,eAAe,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAClD,KAAY,uBAAuB,GAAG,CACpC,SAAS,EAAE,SAAS,KACjB,eAAe,GAAG,WAAW,CAAC,eAAe,CAAC,CAAC;IAEpD,UAAiB,OAAO;QAItB,MAAM,EAAE,aAAa,CAAC;QAKtB,SAAS,CAAC,EAAE,GAAG,CAAC;QAKhB,OAAO,CAAC,EAAE,eAAe,GAAG,uBAAuB,CAAC;QAMpD,QAAQ,CAAC,EAAE,OAAO,CAAC;KACpB;CACF;AAED,qBAAa,UAAW,SAAQ,UAAU;IACjC,MAAM,EAAE,UAAU,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;IACrC,SAAS,EAAE,UAAU,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC;IAC3C,OAAO,EAAE,UAAU,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IACvC,QAAQ,EAAE,OAAO,CAAC;gBAEb,OAAO,EAAE,UAAU,CAAC,OAAO;IAQhC,OAAO,CAAC,SAAS,EAAE,SAAS,GAAG,UAAU,CAAC,WAAW,CAAC;CAoC9D"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/link/schema/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqB,aAAa,EAAE,MAAM,SAAS,CAAC;AAE3D,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAC7D,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAE7C,yBAAiB,UAAU,CAAC;IAC1B,KAAY,eAAe,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAClD,KAAY,uBAAuB,GAAG,CACpC,SAAS,EAAE,SAAS,KACjB,eAAe,GAAG,WAAW,CAAC,eAAe,CAAC,CAAC;IAEpD,UAAiB,OAAO;QAItB,MAAM,EAAE,aAAa,CAAC;QAKtB,SAAS,CAAC,EAAE,GAAG,CAAC;QAKhB,OAAO,CAAC,EAAE,eAAe,GAAG,uBAAuB,CAAC;QAMpD,QAAQ,CAAC,EAAE,OAAO,CAAC;KACpB;CACF;AAED,qBAAa,UAAW,SAAQ,UAAU;IACjC,MAAM,EAAE,UAAU,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;IACrC,SAAS,EAAE,UAAU,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC;IAC3C,OAAO,EAAE,UAAU,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IACvC,QAAQ,EAAE,OAAO,CAAC;gBAEb,OAAO,EAAE,UAAU,CAAC,OAAO;IAQhC,OAAO,CAAC,SAAS,EAAE,SAAS,GAAG,UAAU,CAAC,WAAW,CAAC;CAoC9D"}
@@ -24,7 +24,14 @@ var SchemaLink = (function (_super) {
24
24
  return { errors: validationErrors };
25
25
  }
26
26
  }
27
- return execute(_this.schema, operation.query, _this.rootValue, context, operation.variables, operation.operationName);
27
+ return execute({
28
+ schema: _this.schema,
29
+ document: operation.query,
30
+ rootValue: _this.rootValue,
31
+ contextValue: context,
32
+ variableValues: operation.variables,
33
+ operationName: operation.operationName,
34
+ });
28
35
  }).then(function (data) {
29
36
  if (!observer.closed) {
30
37
  observer.next(data);
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/link/schema/index.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAiB,MAAM,SAAS,CAAC;AAE3D,OAAO,EAAE,UAAU,EAA0B,MAAM,SAAS,CAAC;AAC7D,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAgC7C;IAAgC,8BAAU;IAMxC,oBAAY,OAA2B;QAAvC,YACE,iBAAO,SAKR;QAJC,KAAI,CAAC,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;QAC7B,KAAI,CAAC,SAAS,GAAG,OAAO,CAAC,SAAS,CAAC;QACnC,KAAI,CAAC,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;QAC/B,KAAI,CAAC,QAAQ,GAAG,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC;;IACrC,CAAC;IAEM,4BAAO,GAAd,UAAe,SAAoB;QAAnC,iBAmCC;QAlCC,OAAO,IAAI,UAAU,CAAc,UAAA,QAAQ;YACzC,IAAI,OAAO,CACT,UAAA,OAAO,IAAI,OAAA,OAAO,CAChB,OAAO,KAAI,CAAC,OAAO,KAAK,UAAU;gBAChC,CAAC,CAAC,KAAI,CAAC,OAAO,CAAC,SAAS,CAAC;gBACzB,CAAC,CAAC,KAAI,CAAC,OAAO,CACjB,EAJU,CAIV,CACF,CAAC,IAAI,CAAC,UAAA,OAAO;gBACZ,IAAI,KAAI,CAAC,QAAQ,EAAE;oBACjB,IAAM,gBAAgB,GAAG,QAAQ,CAAC,KAAI,CAAC,MAAM,EAAE,SAAS,CAAC,KAAK,CAAC,CAAC;oBAChE,IAAI,gBAAgB,CAAC,MAAM,GAAG,CAAC,EAAE;wBAC/B,OAAO,EAAE,MAAM,EAAE,gBAAgB,EAAE,CAAC;qBACrC;iBACF;gBAED,OAAO,OAAO,CACZ,KAAI,CAAC,MAAM,EACX,SAAS,CAAC,KAAK,EACf,KAAI,CAAC,SAAS,EACd,OAAO,EACP,SAAS,CAAC,SAAS,EACnB,SAAS,CAAC,aAAa,CACxB,CAAA;YACH,CAAC,CAAC,CAAC,IAAI,CAAC,UAAA,IAAI;gBACV,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE;oBACpB,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;oBACpB,QAAQ,CAAC,QAAQ,EAAE,CAAC;iBACrB;YACH,CAAC,CAAC,CAAC,KAAK,CAAC,UAAA,KAAK;gBACZ,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE;oBACpB,QAAQ,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;iBACvB;YACH,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC;IACH,iBAAC;AAAD,CAAC,AAlDD,CAAgC,UAAU,GAkDzC","sourcesContent":["import { validate, execute, GraphQLSchema } from 'graphql';\n\nimport { ApolloLink, Operation, FetchResult } from '../core';\nimport { Observable } from '../../utilities';\n\nexport namespace SchemaLink {\n export type ResolverContext = Record<string, any>;\n export type ResolverContextFunction = (\n operation: Operation,\n ) => ResolverContext | PromiseLike<ResolverContext>;\n\n export interface Options {\n /**\n * The schema to generate responses from.\n */\n schema: GraphQLSchema;\n\n /**\n * The root value to use when generating responses.\n */\n rootValue?: any;\n\n /**\n * A context to provide to resolvers declared within the schema.\n */\n context?: ResolverContext | ResolverContextFunction;\n\n /**\n * Validate incoming queries against the given schema, returning\n * validation errors as a GraphQL server would.\n */\n validate?: boolean;\n }\n}\n\nexport class SchemaLink extends ApolloLink {\n public schema: SchemaLink.Options[\"schema\"];\n public rootValue: SchemaLink.Options[\"rootValue\"];\n public context: SchemaLink.Options[\"context\"];\n public validate: boolean;\n\n constructor(options: SchemaLink.Options) {\n super();\n this.schema = options.schema;\n this.rootValue = options.rootValue;\n this.context = options.context;\n this.validate = !!options.validate;\n }\n\n public request(operation: Operation): Observable<FetchResult> {\n return new Observable<FetchResult>(observer => {\n new Promise<SchemaLink.ResolverContext>(\n resolve => resolve(\n typeof this.context === 'function'\n ? this.context(operation)\n : this.context\n )\n ).then(context => {\n if (this.validate) {\n const validationErrors = validate(this.schema, operation.query);\n if (validationErrors.length > 0) {\n return { errors: validationErrors };\n }\n }\n\n return execute(\n this.schema,\n operation.query,\n this.rootValue,\n context,\n operation.variables,\n operation.operationName,\n )\n }).then(data => {\n if (!observer.closed) {\n observer.next(data);\n observer.complete();\n }\n }).catch(error => {\n if (!observer.closed) {\n observer.error(error);\n }\n });\n });\n }\n}\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/link/schema/index.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAiB,MAAM,SAAS,CAAC;AAE3D,OAAO,EAAE,UAAU,EAA0B,MAAM,SAAS,CAAC;AAC7D,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAgC7C;IAAgC,8BAAU;IAMxC,oBAAY,OAA2B;QAAvC,YACE,iBAAO,SAKR;QAJC,KAAI,CAAC,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;QAC7B,KAAI,CAAC,SAAS,GAAG,OAAO,CAAC,SAAS,CAAC;QACnC,KAAI,CAAC,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;QAC/B,KAAI,CAAC,QAAQ,GAAG,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC;;IACrC,CAAC;IAEM,4BAAO,GAAd,UAAe,SAAoB;QAAnC,iBAmCC;QAlCC,OAAO,IAAI,UAAU,CAAc,UAAA,QAAQ;YACzC,IAAI,OAAO,CACT,UAAA,OAAO,IAAI,OAAA,OAAO,CAChB,OAAO,KAAI,CAAC,OAAO,KAAK,UAAU;gBAChC,CAAC,CAAC,KAAI,CAAC,OAAO,CAAC,SAAS,CAAC;gBACzB,CAAC,CAAC,KAAI,CAAC,OAAO,CACjB,EAJU,CAIV,CACF,CAAC,IAAI,CAAC,UAAA,OAAO;gBACZ,IAAI,KAAI,CAAC,QAAQ,EAAE;oBACjB,IAAM,gBAAgB,GAAG,QAAQ,CAAC,KAAI,CAAC,MAAM,EAAE,SAAS,CAAC,KAAK,CAAC,CAAC;oBAChE,IAAI,gBAAgB,CAAC,MAAM,GAAG,CAAC,EAAE;wBAC/B,OAAO,EAAE,MAAM,EAAE,gBAAgB,EAAE,CAAC;qBACrC;iBACF;gBAED,OAAO,OAAO,CAAC;oBACb,MAAM,EAAE,KAAI,CAAC,MAAM;oBACnB,QAAQ,EAAE,SAAS,CAAC,KAAK;oBACzB,SAAS,EAAE,KAAI,CAAC,SAAS;oBACzB,YAAY,EAAE,OAAO;oBACrB,cAAc,EAAE,SAAS,CAAC,SAAS;oBACnC,aAAa,EAAE,SAAS,CAAC,aAAa;iBACvC,CAAC,CAAC;YACL,CAAC,CAAC,CAAC,IAAI,CAAC,UAAA,IAAI;gBACV,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE;oBACpB,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;oBACpB,QAAQ,CAAC,QAAQ,EAAE,CAAC;iBACrB;YACH,CAAC,CAAC,CAAC,KAAK,CAAC,UAAA,KAAK;gBACZ,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE;oBACpB,QAAQ,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;iBACvB;YACH,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC;IACH,iBAAC;AAAD,CAAC,AAlDD,CAAgC,UAAU,GAkDzC","sourcesContent":["import { validate, execute, GraphQLSchema } from 'graphql';\n\nimport { ApolloLink, Operation, FetchResult } from '../core';\nimport { Observable } from '../../utilities';\n\nexport namespace SchemaLink {\n export type ResolverContext = Record<string, any>;\n export type ResolverContextFunction = (\n operation: Operation,\n ) => ResolverContext | PromiseLike<ResolverContext>;\n\n export interface Options {\n /**\n * The schema to generate responses from.\n */\n schema: GraphQLSchema;\n\n /**\n * The root value to use when generating responses.\n */\n rootValue?: any;\n\n /**\n * A context to provide to resolvers declared within the schema.\n */\n context?: ResolverContext | ResolverContextFunction;\n\n /**\n * Validate incoming queries against the given schema, returning\n * validation errors as a GraphQL server would.\n */\n validate?: boolean;\n }\n}\n\nexport class SchemaLink extends ApolloLink {\n public schema: SchemaLink.Options[\"schema\"];\n public rootValue: SchemaLink.Options[\"rootValue\"];\n public context: SchemaLink.Options[\"context\"];\n public validate: boolean;\n\n constructor(options: SchemaLink.Options) {\n super();\n this.schema = options.schema;\n this.rootValue = options.rootValue;\n this.context = options.context;\n this.validate = !!options.validate;\n }\n\n public request(operation: Operation): Observable<FetchResult> {\n return new Observable<FetchResult>(observer => {\n new Promise<SchemaLink.ResolverContext>(\n resolve => resolve(\n typeof this.context === 'function'\n ? this.context(operation)\n : this.context\n )\n ).then(context => {\n if (this.validate) {\n const validationErrors = validate(this.schema, operation.query);\n if (validationErrors.length > 0) {\n return { errors: validationErrors };\n }\n }\n\n return execute({\n schema: this.schema,\n document: operation.query,\n rootValue: this.rootValue,\n contextValue: context,\n variableValues: operation.variables,\n operationName: operation.operationName,\n });\n }).then(data => {\n if (!observer.closed) {\n observer.next(data);\n observer.complete();\n }\n }).catch(error => {\n if (!observer.closed) {\n observer.error(error);\n }\n });\n });\n }\n}\n"]}
@@ -1,6 +1,7 @@
1
1
  {
2
2
  "name": "@apollo/client/link/schema",
3
- "main": "schema.cjs.js",
3
+ "type": "module",
4
+ "main": "schema.cjs",
4
5
  "module": "index.js",
5
6
  "types": "index.d.ts",
6
7
  "sideEffects": false
@@ -29,7 +29,14 @@ var SchemaLink = (function (_super) {
29
29
  return { errors: validationErrors };
30
30
  }
31
31
  }
32
- return graphql.execute(_this.schema, operation.query, _this.rootValue, context, operation.variables, operation.operationName);
32
+ return graphql.execute({
33
+ schema: _this.schema,
34
+ document: operation.query,
35
+ rootValue: _this.rootValue,
36
+ contextValue: context,
37
+ variableValues: operation.variables,
38
+ operationName: operation.operationName,
39
+ });
33
40
  }).then(function (data) {
34
41
  if (!observer.closed) {
35
42
  observer.next(data);
@@ -46,4 +53,4 @@ var SchemaLink = (function (_super) {
46
53
  }(core.ApolloLink));
47
54
 
48
55
  exports.SchemaLink = SchemaLink;
49
- //# sourceMappingURL=schema.cjs.js.map
56
+ //# sourceMappingURL=schema.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema.cjs","sources":["index.js"],"sourcesContent":["import { __extends } from \"tslib\";\nimport { validate, execute } from 'graphql';\nimport { ApolloLink } from '../core';\nimport { Observable } from '../../utilities';\nvar SchemaLink = (function (_super) {\n __extends(SchemaLink, _super);\n function SchemaLink(options) {\n var _this = _super.call(this) || this;\n _this.schema = options.schema;\n _this.rootValue = options.rootValue;\n _this.context = options.context;\n _this.validate = !!options.validate;\n return _this;\n }\n SchemaLink.prototype.request = function (operation) {\n var _this = this;\n return new Observable(function (observer) {\n new Promise(function (resolve) { return resolve(typeof _this.context === 'function'\n ? _this.context(operation)\n : _this.context); }).then(function (context) {\n if (_this.validate) {\n var validationErrors = validate(_this.schema, operation.query);\n if (validationErrors.length > 0) {\n return { errors: validationErrors };\n }\n }\n return execute({\n schema: _this.schema,\n document: operation.query,\n rootValue: _this.rootValue,\n contextValue: context,\n variableValues: operation.variables,\n operationName: operation.operationName,\n });\n }).then(function (data) {\n if (!observer.closed) {\n observer.next(data);\n observer.complete();\n }\n }).catch(function (error) {\n if (!observer.closed) {\n observer.error(error);\n }\n });\n });\n };\n return SchemaLink;\n}(ApolloLink));\nexport { SchemaLink };\n//# sourceMappingURL=index.js.map"],"names":["__extends","Observable","validate","execute","ApolloLink"],"mappings":";;;;;;;;;AAIG,IAAC,UAAU,IAAI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jB,gBAAgB,OAAOC,eAAO,CAAC;AAC/B,oBAAoB,MAAM,EAAE,KAAK,CAAC,MAAM;AACxC,oBAAoB,QAAQ,EAAE,SAAS,CAAC,KAAK;AAC7C,oBAAoB,SAAS,EAAE,KAAK,CAAC,SAAS;AAC9C,oBAAoB,YAAY,EAAE,OAAO;AACzC,oBAAoB,cAAc,EAAE,SAAS,CAAC,SAAS;AACvD,oBAAoB,aAAa,EAAE,SAAS,CAAC,aAAa;AAC1D,iBAAiB,CAAC,CAAC;AACnB,aAAa,CAAC,CAAC,IAAI,CAAC,UAAU,IAAI,EAAE;AACpC,gBAAgB,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE;AACtC,oBAAoB,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACxC,oBAAoB,QAAQ,CAAC,QAAQ,EAAE,CAAC;AACxC,iBAAiB;AACjB,aAAa,CAAC,CAAC,KAAK,CAAC,UAAU,KAAK,EAAE;AACtC,gBAAgB,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE;AACtC,oBAAoB,QAAQ,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;AAC1C,iBAAiB;AACjB,aAAa,CAAC,CAAC;AACf,SAAS,CAAC,CAAC;AACX,KAAK,CAAC;AACN,IAAI,OAAO,UAAU,CAAC;AACtB,CAAC,CAACC,eAAU,CAAC;;;;"}
@@ -1,4 +1,3 @@
1
- /// <reference types="zen-observable" />
2
1
  import { Observable } from '../../utilities';
3
2
  export declare function fromError<T>(errorValue: any): Observable<T>;
4
3
  //# sourceMappingURL=fromError.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"fromError.d.ts","sourceRoot":"","sources":["../../../src/link/utils/fromError.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAE7C,wBAAgB,SAAS,CAAC,CAAC,EAAE,UAAU,EAAE,GAAG,GAAG,UAAU,CAAC,CAAC,CAAC,CAI3D"}
1
+ {"version":3,"file":"fromError.d.ts","sourceRoot":"","sources":["../../../src/link/utils/fromError.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAE7C,wBAAgB,SAAS,CAAC,CAAC,EAAE,UAAU,EAAE,GAAG,GAAG,UAAU,CAAC,CAAC,CAAC,CAI3D"}
@@ -1,4 +1,3 @@
1
- /// <reference types="zen-observable" />
2
1
  import { Observable } from '../../utilities';
3
2
  export declare function fromPromise<T>(promise: Promise<T>): Observable<T>;
4
3
  //# sourceMappingURL=fromPromise.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"fromPromise.d.ts","sourceRoot":"","sources":["../../../src/link/utils/fromPromise.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAE7C,wBAAgB,WAAW,CAAC,CAAC,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,GAAG,UAAU,CAAC,CAAC,CAAC,CASjE"}
1
+ {"version":3,"file":"fromPromise.d.ts","sourceRoot":"","sources":["../../../src/link/utils/fromPromise.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAE7C,wBAAgB,WAAW,CAAC,CAAC,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,GAAG,UAAU,CAAC,CAAC,CAAC,CASjE"}
@@ -1,6 +1,7 @@
1
1
  {
2
2
  "name": "@apollo/client/link/utils",
3
- "main": "utils.cjs.js",
3
+ "type": "module",
4
+ "main": "utils.cjs",
4
5
  "module": "index.js",
5
6
  "types": "index.d.ts",
6
7
  "sideEffects": false
@@ -1,4 +1,3 @@
1
- /// <reference types="zen-observable" />
2
1
  import { Observable } from '../../utilities';
3
2
  export declare function toPromise<R>(observable: Observable<R>): Promise<R>;
4
3
  //# sourceMappingURL=toPromise.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"toPromise.d.ts","sourceRoot":"","sources":["../../../src/link/utils/toPromise.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAE7C,wBAAgB,SAAS,CAAC,CAAC,EAAE,UAAU,EAAE,UAAU,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAiBlE"}
1
+ {"version":3,"file":"toPromise.d.ts","sourceRoot":"","sources":["../../../src/link/utils/toPromise.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAE7C,wBAAgB,SAAS,CAAC,CAAC,EAAE,UAAU,EAAE,UAAU,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAiBlE"}
@@ -61,7 +61,7 @@ function validateOperation(operation) {
61
61
  for (var _i = 0, _a = Object.keys(operation); _i < _a.length; _i++) {
62
62
  var key = _a[_i];
63
63
  if (OPERATION_FIELDS.indexOf(key) < 0) {
64
- throw __DEV__ ? new globals.InvariantError("illegal argument: " + key) : new globals.InvariantError(26);
64
+ throw __DEV__ ? new globals.InvariantError("illegal argument: ".concat(key)) : new globals.InvariantError(24);
65
65
  }
66
66
  }
67
67
  return operation;
@@ -112,4 +112,4 @@ exports.throwServerError = throwServerError;
112
112
  exports.toPromise = toPromise;
113
113
  exports.transformOperation = transformOperation;
114
114
  exports.validateOperation = validateOperation;
115
- //# sourceMappingURL=utils.cjs.js.map
115
+ //# sourceMappingURL=utils.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.cjs","sources":["fromError.js","toPromise.js","fromPromise.js","throwServerError.js","validateOperation.js","createOperation.js","transformOperation.js"],"sourcesContent":["import { Observable } from '../../utilities';\nexport function fromError(errorValue) {\n return new Observable(function (observer) {\n observer.error(errorValue);\n });\n}\n//# sourceMappingURL=fromError.js.map","import { invariant } from '../../utilities/globals';\nexport function toPromise(observable) {\n var completed = false;\n return new Promise(function (resolve, reject) {\n observable.subscribe({\n next: function (data) {\n if (completed) {\n __DEV__ && invariant.warn(\"Promise Wrapper does not support multiple results from Observable\");\n }\n else {\n completed = true;\n resolve(data);\n }\n },\n error: reject,\n });\n });\n}\n//# sourceMappingURL=toPromise.js.map","import { Observable } from '../../utilities';\nexport function fromPromise(promise) {\n return new Observable(function (observer) {\n promise\n .then(function (value) {\n observer.next(value);\n observer.complete();\n })\n .catch(observer.error.bind(observer));\n });\n}\n//# sourceMappingURL=fromPromise.js.map","export var throwServerError = function (response, result, message) {\n var error = new Error(message);\n error.name = 'ServerError';\n error.response = response;\n error.statusCode = response.status;\n error.result = result;\n throw error;\n};\n//# sourceMappingURL=throwServerError.js.map","import { InvariantError } from '../../utilities/globals';\nexport function validateOperation(operation) {\n var OPERATION_FIELDS = [\n 'query',\n 'operationName',\n 'variables',\n 'extensions',\n 'context',\n ];\n for (var _i = 0, _a = Object.keys(operation); _i < _a.length; _i++) {\n var key = _a[_i];\n if (OPERATION_FIELDS.indexOf(key) < 0) {\n throw __DEV__ ? new InvariantError(\"illegal argument: \".concat(key)) : new InvariantError(24);\n }\n }\n return operation;\n}\n//# sourceMappingURL=validateOperation.js.map","import { __assign } from \"tslib\";\nexport function createOperation(starting, operation) {\n var context = __assign({}, starting);\n var setContext = function (next) {\n if (typeof next === 'function') {\n context = __assign(__assign({}, context), next(context));\n }\n else {\n context = __assign(__assign({}, context), next);\n }\n };\n var getContext = function () { return (__assign({}, context)); };\n Object.defineProperty(operation, 'setContext', {\n enumerable: false,\n value: setContext,\n });\n Object.defineProperty(operation, 'getContext', {\n enumerable: false,\n value: getContext,\n });\n return operation;\n}\n//# sourceMappingURL=createOperation.js.map","import { getOperationName } from '../../utilities';\nexport function transformOperation(operation) {\n var transformedOperation = {\n variables: operation.variables || {},\n extensions: operation.extensions || {},\n operationName: operation.operationName,\n query: operation.query,\n };\n if (!transformedOperation.operationName) {\n transformedOperation.operationName =\n typeof transformedOperation.query !== 'string'\n ? getOperationName(transformedOperation.query) || undefined\n : '';\n }\n return transformedOperation;\n}\n//# s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AkB,EAAE,CAAC;AACrB,KAAK;AACL,IAAI,OAAO,oBAAoB,CAAC;AAChC;;;;;;;;;;"}
@@ -10,7 +10,7 @@ export function validateOperation(operation) {
10
10
  for (var _i = 0, _a = Object.keys(operation); _i < _a.length; _i++) {
11
11
  var key = _a[_i];
12
12
  if (OPERATION_FIELDS.indexOf(key) < 0) {
13
- throw __DEV__ ? new InvariantError("illegal argument: " + key) : new InvariantError(26);
13
+ throw __DEV__ ? new InvariantError("illegal argument: ".concat(key)) : new InvariantError(24);
14
14
  }
15
15
  }
16
16
  return operation;
@@ -1 +1 @@
1
- {"version":3,"file":"validateOperation.js","sourceRoot":"","sources":["../../../src/link/utils/validateOperation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAA;AAGxD,MAAM,UAAU,iBAAiB,CAAC,SAAyB;IACzD,IAAM,gBAAgB,GAAG;QACvB,OAAO;QACP,eAAe;QACf,WAAW;QACX,YAAY;QACZ,SAAS;KACV,CAAC;IACF,KAAgB,UAAsB,EAAtB,KAAA,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,EAAtB,cAAsB,EAAtB,IAAsB,EAAE;QAAnC,IAAI,GAAG,SAAA;QACV,IAAI,gBAAgB,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE;YACrC,MAAM,IAAI,cAAc,CAAC,uBAAqB,GAAK,CAAC,CAAC;SACtD;KACF;IAED,OAAO,SAAS,CAAC;AACnB,CAAC","sourcesContent":["import { InvariantError } from '../../utilities/globals'\nimport { GraphQLRequest } from '../core';\n\nexport function validateOperation(operation: GraphQLRequest): GraphQLRequest {\n const OPERATION_FIELDS = [\n 'query',\n 'operationName',\n 'variables',\n 'extensions',\n 'context',\n ];\n for (let key of Object.keys(operation)) {\n if (OPERATION_FIELDS.indexOf(key) < 0) {\n throw new InvariantError(`illegal argument: ${key}`);\n }\n }\n\n return operation;\n}\n"]}
1
+ {"version":3,"file":"validateOperation.js","sourceRoot":"","sources":["../../../src/link/utils/validateOperation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAA;AAGxD,MAAM,UAAU,iBAAiB,CAAC,SAAyB;IACzD,IAAM,gBAAgB,GAAG;QACvB,OAAO;QACP,eAAe;QACf,WAAW;QACX,YAAY;QACZ,SAAS;KACV,CAAC;IACF,KAAgB,UAAsB,EAAtB,KAAA,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,EAAtB,cAAsB,EAAtB,IAAsB,EAAE;QAAnC,IAAI,GAAG,SAAA;QACV,IAAI,gBAAgB,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE;YACrC,MAAM,IAAI,cAAc,CAAC,4BAAqB,GAAG,CAAE,CAAC,CAAC;SACtD;KACF;IAED,OAAO,SAAS,CAAC;AACnB,CAAC","sourcesContent":["import { InvariantError } from '../../utilities/globals'\nimport { GraphQLRequest } from '../core';\n\nexport function validateOperation(operation: GraphQLRequest): GraphQLRequest {\n const OPERATION_FIELDS = [\n 'query',\n 'operationName',\n 'variables',\n 'extensions',\n 'context',\n ];\n for (let key of Object.keys(operation)) {\n if (OPERATION_FIELDS.indexOf(key) < 0) {\n throw new InvariantError(`illegal argument: ${key}`);\n }\n }\n\n return operation;\n}\n"]}
@@ -1,4 +1,3 @@
1
- /// <reference types="zen-observable" />
2
1
  import { SubscriptionClient, ClientOptions } from 'subscriptions-transport-ws';
3
2
  import { ApolloLink, Operation, FetchResult } from '../core';
4
3
  import { Observable } from '../../utilities';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/link/ws/index.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,kBAAkB,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAE/E,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAC7D,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAi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ws.cjs",
4
5
  "module": "index.js",
5
6
  "types": "index.d.ts",
6
7
  "sideEffects": false
@@ -25,4 +25,4 @@ var WebSocketLink = (function (_super) {
25
25
  }(core.ApolloLink));
26
26
 
27
27
  exports.WebSocketLink = WebSocketLink;
28
- //# sourceMappingURL=ws.cjs.js.map
28
+ //# sourceMappingURL=ws.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ws.cjs","sources":["index.js"],"sourcesContent":["import { __extends } from \"tslib\";\nimport { SubscriptionClient } from 'subscriptions-transport-ws';\nimport { ApolloLink } from '../core';\nvar WebSocketLink = (function (_super) {\n __extends(WebSocketLink, _super);\n function WebSocketLink(paramsOrClient) {\n var _this = _super.call(this) || this;\n if (paramsOrClient instanceof SubscriptionClient) {\n _this.subscriptionClient = paramsOrClient;\n }\n else {\n _this.subscriptionClient = new SubscriptionClient(paramsOrClient.uri, paramsOrClient.options, paramsOrClient.webSocketImpl);\n }\n return _this;\n }\n WebSocketLink.prototype.request = function (operation) {\n return this.subscriptionClient.request(operation);\n };\n return WebSocketLink;\n}(ApolloLink));\nexport { WebSocketLink };\n//# sourceMappingURL=index.js.map"],"names":["__extends","SubscriptionClient","ApolloLink"],"mappings":";;;;;;;;AAGG,IAAC,aAAa,IAAI,UAAU,MAAM,EAAE;AACvC,IAAIA,eAAS,CAAC,aAAa,EAAE,MAAM,CAAC,CAAC;AACrC,IAAI,SAAS,aAAa,CAAC,cAAc,EAAE;AAC3C,QAAQ,IAAI,KAAK,GAAG,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC;AAC9C,QAAQ,IAAI,cAAc,YAAYC,2CAAkB,EAAE;AAC1D,YAAY,KAAK,CAAC,kBAAkB,GAAG,cAAc,CAAC;AACtD,SAAS;AACT,aAAa;AACb,YAAY,KAAK,CAAC,kBAAkB,GAAG,IAAIA,2CAAkB,CAAC,cAAc,CAAC,GAAG,EAAE,cAAc,CAAC,OAAO,EAAE,cAAc,CAAC,aAAa,CAAC,CAAC;AACxI,SAAS;AACT,QAAQ,OAAO,KAAK,CAAC;AACrB,KAAK;AACL,IAAI,aAAa,CAAC,SAAS,CAAC,OAAO,GAAG,UAAU,SAAS,EAAE;AAC3D,QAAQ,OAAO,IAAI,CAAC,kBAAkB,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;AAC1D,KAAK,CAAC;AACN,IAAI,OAAO,aAAa,CAAC;AACzB,CAAC,CAACC,eAAU,CAAC;;;;"}
@@ -7,10 +7,10 @@ var react = require('./react');
7
7
 
8
8
 
9
9
 
10
- Object.keys(core).forEach(function (k) {
10
+ for (var k in core) {
11
11
  if (k !== 'default' && !exports.hasOwnProperty(k)) exports[k] = core[k];
12
- });
13
- Object.keys(react).forEach(function (k) {
12
+ }
13
+ for (var k in react) {
14
14
  if (k !== 'default' && !exports.hasOwnProperty(k)) exports[k] = react[k];
15
- });
16
- //# sourceMappingURL=main.cjs.js.map
15
+ }
16
+ //# sourceMappingURL=main.cjs.map
package/main.cjs.map ADDED
@@ -0,0 +1 @@
1
+ {"version":3,"file":"main.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@apollo/client",
3
- "version": "3.4.17",
3
+ "version": "3.5.6",
4
4
  "description": "A fully-featured caching GraphQL client.",
5
5
  "private": false,
6
6
  "keywords": [
@@ -13,7 +13,7 @@
13
13
  ],
14
14
  "author": "packages@apollographql.com",
15
15
  "license": "MIT",
16
- "main": "./main.cjs.js",
16
+ "main": "./main.cjs",
17
17
  "module": "./index.js",
18
18
  "types": "./index.d.ts",
19
19
  "sideEffects": false,
@@ -29,7 +29,7 @@
29
29
  },
30
30
  "homepage": "https://www.apollographql.com/docs/react/",
31
31
  "peerDependencies": {
32
- "graphql": "^14.0.0 || ^15.0.0",
32
+ "graphql": "^14.0.0 || ^15.0.0 || ^16.0.0",
33
33
  "react": "^16.8.0 || ^17.0.0",
34
34
  "subscriptions-transport-ws": "^0.9.0 || ^0.11.0"
35
35
  },
@@ -51,23 +51,23 @@
51
51
  "optimism": "^0.16.1",
52
52
  "prop-types": "^15.7.2",
53
53
  "symbol-observable": "^4.0.0",
54
- "ts-invariant": "^0.9.0",
54
+ "ts-invariant": "^0.9.4",
55
55
  "tslib": "^2.3.0",
56
- "zen-observable-ts": "~1.1.0"
56
+ "zen-observable-ts": "^1.2.0"
57
57
  },
58
58
  "devDependencies": {
59
- "@babel/parser": "7.16.2",
59
+ "@babel/parser": "7.16.4",
60
60
  "@graphql-tools/schema": "8.3.1",
61
61
  "@rollup/plugin-node-resolve": "11.2.1",
62
- "@testing-library/react": "9.5.0",
62
+ "@testing-library/react": "12.1.2",
63
63
  "@testing-library/react-hooks": "7.0.2",
64
64
  "@types/fast-json-stable-stringify": "2.0.0",
65
65
  "@types/fetch-mock": "7.3.5",
66
66
  "@types/glob": "7.2.0",
67
67
  "@types/hoist-non-react-statics": "3.3.1",
68
- "@types/jest": "26.0.24",
69
- "@types/lodash": "4.14.176",
70
- "@types/node": "16.11.6",
68
+ "@types/jest": "27.0.3",
69
+ "@types/lodash": "4.14.177",
70
+ "@types/node": "16.11.11",
71
71
  "@types/react": "17.0.34",
72
72
  "@types/react-dom": "17.0.2",
73
73
  "bundlesize": "0.18.1",
@@ -75,28 +75,29 @@
75
75
  "crypto-hash": "1.3.0",
76
76
  "fetch-mock": "9.11.0",
77
77
  "glob": "7.2.0",
78
- "graphql": "15.7.2",
79
- "jest": "26.6.3",
78
+ "graphql": "16.0.1",
79
+ "jest": "27.4.3",
80
80
  "jest-fetch-mock": "3.0.3",
81
- "jest-junit": "12.3.0",
81
+ "jest-junit": "13.0.0",
82
82
  "lodash": "4.17.21",
83
83
  "react": "17.0.2",
84
84
  "react-dom": "17.0.2",
85
- "recast": "0.20.5",
85
+ "recast": "0.21.0",
86
86
  "resolve": "1.20.0",
87
87
  "rimraf": "3.0.2",
88
- "rollup": "2.50.5",
88
+ "rollup": "2.60.2",
89
89
  "rollup-plugin-terser": "7.0.2",
90
90
  "rxjs": "6.6.7",
91
91
  "subscriptions-transport-ws": "0.11.0",
92
- "terser": "5.9.0",
93
- "ts-jest": "26.5.6",
92
+ "terser": "5.10.0",
93
+ "ts-jest": "27.1.0",
94
94
  "ts-node": "10.4.0",
95
- "typescript": "4.4.4",
95
+ "typescript": "4.5.2",
96
96
  "wait-for-observables": "1.0.3",
97
97
  "whatwg-fetch": "3.6.2"
98
98
  },
99
99
  "publishConfig": {
100
100
  "access": "public"
101
- }
101
+ },
102
+ "type": "module"
102
103
  }
@@ -1 +1 @@
1
- {"version":3,"file":"Query.js","sourceRoot":"","sources":["../../../src/react/components/Query.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,SAAS,MAAM,YAAY,CAAC;AAIxC,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAEpC,MAAM,UAAU,KAAK,CACnB,KAA+C;IAEvC,IAAA,QAAQ,GAAwB,KAAK,SAA7B,EAAE,KAAK,GAAiB,KAAK,MAAtB,EAAK,OAAO,UAAK,KAAK,EAAvC,qBAA+B,CAAF,CAAW;IAC9C,IAAM,MAAM,GAAG,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;IACxC,OAAO,MAAM,CAAC,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;AAC1C,CAAC;AAMD,KAAK,CAAC,SAAS,GAAG;IAChB,MAAM,EAAE,SAAS,CAAC,MAAM;IACxB,QAAQ,EAAE,SAAS,CAAC,IAAI,CAAC,UAAU;IACnC,WAAW,EAAE,SAAS,CAAC,MAAM;IAC7B,2BAA2B,EAAE,SAAS,CAAC,IAAI;IAC3C,WAAW,EAAE,SAAS,CAAC,IAAI;IAC3B,OAAO,EAAE,SAAS,CAAC,IAAI;IACvB,YAAY,EAAE,SAAS,CAAC,MAAM;IAC9B,KAAK,EAAE,SAAS,CAAC,MAAM,CAAC,UAAU;IAClC,SAAS,EAAE,SAAS,CAAC,MAAM;IAC3B,GAAG,EAAE,SAAS,CAAC,IAAI;IACnB,cAAc,EAAE,SAAS,CAAC,IAAI;IAC9B,iBAAiB,EAAE,SAAS,CAAC,IAAI;CACF,CAAC","sourcesContent":["import * as PropTypes from 'prop-types';\n\nimport { OperationVariables } from '../../core';\nimport { QueryComponentOptions } from './types';\nimport { useQuery } from '../hooks';\n\nexport function Query<TData = any, TVariables = OperationVariables>(\n props: QueryComponentOptions<TData, TVariables>\n) {\n const { children, query, ...options } = props;\n const result = useQuery(query, options);\n return result ? children(result) : null;\n}\n\nexport interface Query<TData, TVariables> {\n propTypes: PropTypes.InferProps<QueryComponentOptions<TData, TVariables>>;\n}\n\nQuery.propTypes = {\n client: PropTypes.object,\n children: PropTypes.func.isRequired,\n fetchPolicy: PropTypes.string,\n notifyOnNetworkStatusChange: PropTypes.bool,\n onCompleted: PropTypes.func,\n onError: PropTypes.func,\n pollInterval: PropTypes.number,\n query: PropTypes.object.isRequired,\n variables: PropTypes.object,\n ssr: PropTypes.bool,\n partialRefetch: PropTypes.bool,\n returnPartialData: PropTypes.bool\n} as Query<any, any>[\"propTypes\"];\n"]}
1
+ {"version":3,"file":"Query.js","sourceRoot":"","sources":["../../../src/react/components/Query.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,SAAS,MAAM,YAAY,CAAC;AAIxC,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAEpC,MAAM,UAAU,KAAK,CACnB,KAA+C;IAEvC,IAAA,QAAQ,GAAwB,KAAK,SAA7B,EAAE,KAAK,GAAiB,KAAK,MAAtB,EAAK,OAAO,UAAK,KAAK,EAAvC,qBAA+B,CAAF,CAAW;IAC9C,IAAM,MAAM,GAAG,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;IACxC,OAAO,MAAM,CAAC,CAAC,CAAC,QAAQ,CAAC,MAAa,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;AACjD,CAAC;AAMD,KAAK,CAAC,SAAS,GAAG;IAChB,MAAM,EAAE,SAAS,CAAC,MAAM;IACxB,QAAQ,EAAE,SAAS,CAAC,IAAI,CAAC,UAAU;IACnC,WAAW,EAAE,SAAS,CAAC,MAAM;IAC7B,2BAA2B,EAAE,SAAS,CAAC,IAAI;IAC3C,WAAW,EAAE,SAAS,CAAC,IAAI;IAC3B,OAAO,EAAE,SAAS,CAAC,IAAI;IACvB,YAAY,EAAE,SAAS,CAAC,MAAM;IAC9B,KAAK,EAAE,SAAS,CAAC,MAAM,CAAC,UAAU;IAClC,SAAS,EAAE,SAAS,CAAC,MAAM;IAC3B,GAAG,EAAE,SAAS,CAAC,IAAI;IACnB,cAAc,EAAE,SAAS,CAAC,IAAI;IAC9B,iBAAiB,EAAE,SAAS,CAAC,IAAI;CACF,CAAC","sourcesContent":["import * as PropTypes from 'prop-types';\n\nimport { OperationVariables } from '../../core';\nimport { QueryComponentOptions } from './types';\nimport { useQuery } from '../hooks';\n\nexport function Query<TData = any, TVariables = OperationVariables>(\n props: QueryComponentOptions<TData, TVariables>\n) {\n const { children, query, ...options } = props;\n const result = useQuery(query, options);\n return result ? children(result as any) : null;\n}\n\nexport interface Query<TData, TVariables> {\n propTypes: PropTypes.InferProps<QueryComponentOptions<TData, TVariables>>;\n}\n\nQuery.propTypes = {\n client: PropTypes.object,\n children: PropTypes.func.isRequired,\n fetchPolicy: PropTypes.string,\n notifyOnNetworkStatusChange: PropTypes.bool,\n onCompleted: PropTypes.func,\n onError: PropTypes.func,\n pollInterval: PropTypes.number,\n query: PropTypes.object.isRequired,\n variables: PropTypes.object,\n ssr: PropTypes.bool,\n partialRefetch: PropTypes.bool,\n returnPartialData: PropTypes.bool\n} as Query<any, any>[\"propTypes\"];\n"]}
@@ -10,11 +10,11 @@ function _interopNamespace(e) {
10
10
  if (e && e.__esModule) return e;
11
11
  var n = Object.create(null);
12
12
  if (e) {
13
- Object.keys(e).forEach(function (k) {
13
+ for (var k in e) {
14
14
  n[k] = e[k];
15
- });
15
+ }
16
16
  }
17
- n['default'] = e;
17
+ n["default"] = e;
18
18
  return Object.freeze(n);
19
19
  }
20
20
 
@@ -76,4 +76,4 @@ Subscription.propTypes = {
76
76
  exports.Mutation = Mutation;
77
77
  exports.Query = Query;
78
78
  exports.Subscription = Subscription;
79
- //# sourceMappingURL=components.cjs.js.map
79
+ //# sourceMappingURL=components.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"components.cjs","sources":["Query.js","Mutation.js","Subscription.js"],"sourcesContent":["import { __rest } from \"tslib\";\nimport * as PropTypes from 'prop-types';\nimport { useQuery } from '../hooks';\nexport function Query(props) {\n var children = props.children, query = props.query, options = __rest(props, [\"children\", \"query\"]);\n var result = useQuery(query, options);\n return result ? children(result) : null;\n}\nQuery.propTypes = {\n client: PropTypes.object,\n children: PropTypes.func.isRequired,\n fetchPolicy: PropTypes.string,\n notifyOnNetworkStatusChange: PropTypes.bool,\n onCompleted: PropTypes.func,\n onError: PropTypes.func,\n pollInterval: PropTypes.number,\n query: PropTypes.object.isRequired,\n variables: PropTypes.object,\n ssr: PropTypes.bool,\n partialRefetch: PropTypes.bool,\n returnPartialData: PropTypes.bool\n};\n//# sourceMappingURL=Query.js.map","import * as PropTypes from 'prop-types';\nimport { useMutation } from '../hooks';\nexport function Mutation(props) {\n var _a = useMutation(props.mutation, props), runMutation = _a[0], result = _a[1];\n return props.children ? props.children(runMutation, result) : null;\n}\nMutation.propTypes = {\n mutation: PropTypes.object.isRequired,\n variables: PropTypes.object,\n optimisticResponse: PropTypes.oneOfType([PropTypes.object, PropTypes.func]),\n refetchQueries: PropTypes.oneOfType([\n PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.string, PropTypes.object])),\n PropTypes.func\n ]),\n awaitRefetchQueries: PropTypes.bool,\n update: PropTypes.func,\n children: PropTypes.func.isRequired,\n onCompleted: PropTypes.func,\n onError: PropTypes.func,\n fetchPolicy: PropTypes.string,\n};\n//# sourceMappingURL=Mutation.js.map","import * as PropTypes from 'prop-types';\nimport { useSubscription } from '../hooks';\nexport function Subscription(props) {\n var result = useSubscription(props.subscription, props);\n return props.children && result ? props.children(result) : null;\n}\nSubscription.propTypes = {\n subscription: PropTypes.object.isRequired,\n variables: PropTypes.object,\n children: PropTypes.func,\n onSubscriptionData: PropTypes.func,\n onSubscriptionComplete: PropTypes.func,\n shouldResubscribe: PropTypes.oneOfType([PropTypes.func, PropTypes.bool])\n};\n//# sourceMappingURL=Subscription.js.map"],"names":["__rest","useQuery","PropTypes","useMutation","useSubscription"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAGO,SAAS,KAAK,CAAC,KAAK,EAAE;AAC7B,IAAI,IAAI,QAAQ,GAAG,KAAK,CAAC,QAAQ,EAAE,KAAK,GAAG,KAAK,CAAC,KAAK,EAAE,OAAO,GAAGA,YAAM,CAAC,KAAK,EAAE,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC,CAAC;AACvG,IAAI,IAAI,MAAM,GAAGC,cAAQ,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;AAC1C,IAAI,OAAO,MAAM,GAAG,QAAQ,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC;AAC5C,CAAC;AACD,KAAK,CAAC,SAAS,GAAG;AAClB,IAAI,MAAM,EAAEC,oBAAS,CAAC,MAAM;AAC5B,IAAI,QAAQ,EAAEA,oBAAS,CAAC,IAAI,CAAC,UAAU;AACvC,IAAI,WAAW,EAAEA,oBAAS,CAAC,MAAM;AACjC,IAAI,2BAA2B,EAAEA,oBAAS,CAAC,IAAI;AAC/C,IAAI,WAAW,EAAEA,oBAAS,CAAC,IAAI;AAC/B,IAAI,OAAO,EAAEA,oBAAS,CAAC,IAAI;AAC3B,IAAI,YAAY,EAAEA,oBAAS,CAAC,MAAM;AAClC,IAAI,KAAK,EAAEA,oBAAS,CAAC,MAAM,CAAC,UAAU;AACtC,IAAI,SAAS,EAAEA,oBAAS,CAAC,MAAM;AAC/B,IAAI,GAAG,EAAE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jC,CAAC;;AClBM,SAAS,YAAY,CAAC,KAAK,EAAE;AACpC,IAAI,IAAI,MAAM,GAAGE,qBAAe,CAAC,KAAK,CAAC,YAAY,EAAE,KAAK,CAAC,CAAC;AAC5D,IAAI,OAAO,KAAK,CAAC,QAAQ,IAAI,MAAM,GAAG,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC;AACpE,CAAC;AACD,YAAY,CAAC,SAAS,GAAG;AACzB,IAAI,YAAY,EAAEF,oBAAS,CAAC,MAAM,CAAC,UAAU;AAC7C,IAAI,SAAS,EAAEA,oBAAS,CAAC,MAAM;AAC/B,IAAI,QAAQ,EAAEA,oBAAS,CAAC,IAAI;AAC5B,IAAI,kBAAkB,EAAEA,oBAAS,CAAC,IAAI;AACtC,IAAI,sBAAsB,EAAEA,oBAAS,CAAC,IAAI;AAC1C,IAAI,iBAAiB,EAAEA,oBAAS,CAAC,SAAS,CAAC,CAACA,oBAAS,CAAC,IAAI,EAAEA,oBAAS,CAAC,IAAI,CAAC,CAAC;AAC5E,CAAC;;;;;;"}
@@ -1,6 +1,7 @@
1
1
  {
2
2
  "name": "@apollo/client/react/components",
3
- "main": "components.cjs.js",
3
+ "type": "module",
4
+ "main": "components.cjs",
4
5
  "module": "index.js",
5
6
  "types": "index.d.ts",
6
7
  "sideEffects": false
@@ -5,7 +5,7 @@ export var ApolloConsumer = function (props) {
5
5
  var ApolloContext = getApolloContext();
6
6
  return React.createElement(ApolloContext.Consumer, null, function (context) {
7
7
  __DEV__ ? invariant(context && context.client, 'Could not find "client" in the context of ApolloConsumer. ' +
8
- 'Wrap the root component in an <ApolloProvider>.') : invariant(context && context.client, 27);
8
+ 'Wrap the root component in an <ApolloProvider>.') : invariant(context && context.client, 25);
9
9
  return props.children(context.client);
10
10
  });
11
11
  };
@@ -10,7 +10,7 @@ export var ApolloProvider = function (_a) {
10
10
  context = Object.assign({}, context, { client: client });
11
11
  }
12
12
  __DEV__ ? invariant(context.client, 'ApolloProvider was not passed a client instance. Make ' +
13
- 'sure you pass in your client via the "client" prop.') : invariant(context.client, 28);
13
+ 'sure you pass in your client via the "client" prop.') : invariant(context.client, 26);
14
14
  return (React.createElement(ApolloContext.Provider, { value: context }, children));
15
15
  });
16
16
  };