@apollo/client 3.8.0-beta.6 → 3.8.0-beta.7

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 (634) hide show
  1. package/apollo-client.cjs +201 -189
  2. package/apollo-client.cjs.map +1 -1
  3. package/apollo-client.min.cjs +1 -1
  4. package/cache/cache.cjs +12 -12
  5. package/cache/cache.cjs.map +1 -1
  6. package/cache/cache.cjs.native.js +12 -12
  7. package/cache/core/cache.d.ts +3 -3
  8. package/cache/core/cache.d.ts.map +1 -1
  9. package/cache/core/cache.js +1 -1
  10. package/cache/core/cache.js.map +1 -1
  11. package/cache/core/types/Cache.d.ts +3 -3
  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 +2 -2
  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 +2 -2
  18. package/cache/core/types/common.d.ts.map +1 -1
  19. package/cache/core/types/common.js.map +1 -1
  20. package/cache/index.d.ts +14 -14
  21. package/cache/index.d.ts.map +1 -1
  22. package/cache/index.js +13 -13
  23. package/cache/index.js.map +1 -1
  24. package/cache/inmemory/entityStore.d.ts +5 -5
  25. package/cache/inmemory/entityStore.d.ts.map +1 -1
  26. package/cache/inmemory/entityStore.js +3 -3
  27. package/cache/inmemory/entityStore.js.map +1 -1
  28. package/cache/inmemory/fragmentRegistry.js.map +1 -1
  29. package/cache/inmemory/helpers.d.ts +5 -5
  30. package/cache/inmemory/helpers.d.ts.map +1 -1
  31. package/cache/inmemory/helpers.js +1 -1
  32. package/cache/inmemory/helpers.js.map +1 -1
  33. package/cache/inmemory/inMemoryCache.d.ts +8 -8
  34. package/cache/inmemory/inMemoryCache.d.ts.map +1 -1
  35. package/cache/inmemory/inMemoryCache.js +13 -13
  36. package/cache/inmemory/inMemoryCache.js.map +1 -1
  37. package/cache/inmemory/key-extractor.d.ts +1 -1
  38. package/cache/inmemory/key-extractor.d.ts.map +1 -1
  39. package/cache/inmemory/key-extractor.js.map +1 -1
  40. package/cache/inmemory/object-canon.d.ts.map +1 -1
  41. package/cache/inmemory/object-canon.js +2 -3
  42. package/cache/inmemory/object-canon.js.map +1 -1
  43. package/cache/inmemory/policies.d.ts +6 -6
  44. package/cache/inmemory/policies.d.ts.map +1 -1
  45. package/cache/inmemory/policies.js +9 -9
  46. package/cache/inmemory/policies.js.map +1 -1
  47. package/cache/inmemory/reactiveVars.d.ts +1 -1
  48. package/cache/inmemory/reactiveVars.d.ts.map +1 -1
  49. package/cache/inmemory/reactiveVars.js.map +1 -1
  50. package/cache/inmemory/readFromStore.d.ts +6 -6
  51. package/cache/inmemory/readFromStore.d.ts.map +1 -1
  52. package/cache/inmemory/readFromStore.js +7 -7
  53. package/cache/inmemory/readFromStore.js.map +1 -1
  54. package/cache/inmemory/types.d.ts +6 -6
  55. package/cache/inmemory/types.d.ts.map +1 -1
  56. package/cache/inmemory/types.js.map +1 -1
  57. package/cache/inmemory/writeToStore.d.ts +6 -6
  58. package/cache/inmemory/writeToStore.d.ts.map +1 -1
  59. package/cache/inmemory/writeToStore.js +10 -10
  60. package/cache/inmemory/writeToStore.js.map +1 -1
  61. package/config/jest/setup.d.ts +1 -1
  62. package/config/jest/setup.d.ts.map +1 -1
  63. package/config/jest/setup.js +2 -2
  64. package/config/jest/setup.js.map +1 -1
  65. package/core/ApolloClient.d.ts +10 -10
  66. package/core/ApolloClient.d.ts.map +1 -1
  67. package/core/ApolloClient.js +10 -10
  68. package/core/ApolloClient.js.map +1 -1
  69. package/core/LocalState.d.ts +5 -5
  70. package/core/LocalState.d.ts.map +1 -1
  71. package/core/LocalState.js +3 -3
  72. package/core/LocalState.js.map +1 -1
  73. package/core/ObservableQuery.d.ts +10 -10
  74. package/core/ObservableQuery.d.ts.map +1 -1
  75. package/core/ObservableQuery.js +11 -11
  76. package/core/ObservableQuery.js.map +1 -1
  77. package/core/QueryInfo.d.ts +9 -9
  78. package/core/QueryInfo.d.ts.map +1 -1
  79. package/core/QueryInfo.js +4 -4
  80. package/core/QueryInfo.js.map +1 -1
  81. package/core/QueryManager.d.ts +10 -10
  82. package/core/QueryManager.d.ts.map +1 -1
  83. package/core/QueryManager.js +17 -17
  84. package/core/QueryManager.js.map +1 -1
  85. package/core/core.cjs +25 -24
  86. package/core/core.cjs.map +1 -1
  87. package/core/core.cjs.native.js +25 -24
  88. package/core/equalByQuery.d.ts +2 -2
  89. package/core/equalByQuery.d.ts.map +1 -1
  90. package/core/equalByQuery.js +9 -8
  91. package/core/equalByQuery.js.map +1 -1
  92. package/core/index.d.ts +13 -13
  93. package/core/index.d.ts.map +1 -1
  94. package/core/index.js +12 -13
  95. package/core/index.js.map +1 -1
  96. package/core/types.d.ts +10 -10
  97. package/core/types.d.ts.map +1 -1
  98. package/core/types.js.map +1 -1
  99. package/core/watchQueryOptions.d.ts +4 -4
  100. package/core/watchQueryOptions.d.ts.map +1 -1
  101. package/core/watchQueryOptions.js.map +1 -1
  102. package/dev/dev.cjs +2 -3
  103. package/dev/dev.cjs.map +1 -1
  104. package/dev/dev.cjs.native.js +2 -3
  105. package/dev/index.d.ts +3 -3
  106. package/dev/index.d.ts.map +1 -1
  107. package/dev/index.js +3 -3
  108. package/dev/index.js.map +1 -1
  109. package/dev/loadDevMessages.js +2 -2
  110. package/dev/loadDevMessages.js.map +1 -1
  111. package/dev/loadErrorMessageHandler.d.ts +1 -1
  112. package/dev/loadErrorMessageHandler.d.ts.map +1 -1
  113. package/dev/loadErrorMessageHandler.js +2 -2
  114. package/dev/loadErrorMessageHandler.js.map +1 -1
  115. package/dev/loadErrorMessages.js +2 -2
  116. package/dev/loadErrorMessages.js.map +1 -1
  117. package/errors/errors.cjs.map +1 -1
  118. package/errors/index.d.ts +4 -4
  119. package/errors/index.d.ts.map +1 -1
  120. package/errors/index.js +2 -2
  121. package/errors/index.js.map +1 -1
  122. package/index.d.ts +2 -2
  123. package/index.d.ts.map +1 -1
  124. package/index.js +2 -2
  125. package/index.js.map +1 -1
  126. package/link/batch/batch.cjs.map +1 -1
  127. package/link/batch/batchLink.d.ts +5 -5
  128. package/link/batch/batchLink.d.ts.map +1 -1
  129. package/link/batch/batchLink.js +3 -3
  130. package/link/batch/batchLink.js.map +1 -1
  131. package/link/batch/batching.d.ts +2 -2
  132. package/link/batch/batching.d.ts.map +1 -1
  133. package/link/batch/batching.js +1 -1
  134. package/link/batch/batching.js.map +1 -1
  135. package/link/batch/index.d.ts +1 -1
  136. package/link/batch/index.d.ts.map +1 -1
  137. package/link/batch/index.js +1 -1
  138. package/link/batch/index.js.map +1 -1
  139. package/link/batch-http/batch-http.cjs.map +1 -1
  140. package/link/batch-http/batchHttpLink.d.ts +5 -5
  141. package/link/batch-http/batchHttpLink.d.ts.map +1 -1
  142. package/link/batch-http/batchHttpLink.js +5 -5
  143. package/link/batch-http/batchHttpLink.js.map +1 -1
  144. package/link/batch-http/index.d.ts +1 -1
  145. package/link/batch-http/index.d.ts.map +1 -1
  146. package/link/batch-http/index.js +1 -1
  147. package/link/batch-http/index.js.map +1 -1
  148. package/link/context/context.cjs.map +1 -1
  149. package/link/context/index.d.ts +3 -3
  150. package/link/context/index.d.ts.map +1 -1
  151. package/link/context/index.js +2 -2
  152. package/link/context/index.js.map +1 -1
  153. package/link/core/ApolloLink.d.ts +3 -3
  154. package/link/core/ApolloLink.d.ts.map +1 -1
  155. package/link/core/ApolloLink.js +4 -4
  156. package/link/core/ApolloLink.js.map +1 -1
  157. package/link/core/concat.d.ts +1 -1
  158. package/link/core/concat.d.ts.map +1 -1
  159. package/link/core/concat.js +1 -1
  160. package/link/core/concat.js.map +1 -1
  161. package/link/core/core.cjs +1 -1
  162. package/link/core/core.cjs.map +1 -1
  163. package/link/core/core.cjs.native.js +1 -1
  164. package/link/core/empty.d.ts +1 -1
  165. package/link/core/empty.d.ts.map +1 -1
  166. package/link/core/empty.js +1 -1
  167. package/link/core/empty.js.map +1 -1
  168. package/link/core/execute.d.ts +1 -1
  169. package/link/core/execute.d.ts.map +1 -1
  170. package/link/core/execute.js +1 -1
  171. package/link/core/execute.js.map +1 -1
  172. package/link/core/from.d.ts +1 -1
  173. package/link/core/from.d.ts.map +1 -1
  174. package/link/core/from.js +1 -1
  175. package/link/core/from.js.map +1 -1
  176. package/link/core/index.d.ts +8 -8
  177. package/link/core/index.d.ts.map +1 -1
  178. package/link/core/index.js +8 -8
  179. package/link/core/index.js.map +1 -1
  180. package/link/core/split.d.ts +1 -1
  181. package/link/core/split.d.ts.map +1 -1
  182. package/link/core/split.js +1 -1
  183. package/link/core/split.js.map +1 -1
  184. package/link/core/types.d.ts +2 -2
  185. package/link/core/types.d.ts.map +1 -1
  186. package/link/core/types.js.map +1 -1
  187. package/link/error/error.cjs.map +1 -1
  188. package/link/error/index.d.ts +4 -4
  189. package/link/error/index.d.ts.map +1 -1
  190. package/link/error/index.js +2 -2
  191. package/link/error/index.js.map +1 -1
  192. package/link/http/HttpLink.d.ts +3 -3
  193. package/link/http/HttpLink.d.ts.map +1 -1
  194. package/link/http/HttpLink.js +2 -2
  195. package/link/http/HttpLink.js.map +1 -1
  196. package/link/http/checkFetcher.js +1 -1
  197. package/link/http/checkFetcher.js.map +1 -1
  198. package/link/http/createHttpLink.d.ts +2 -2
  199. package/link/http/createHttpLink.d.ts.map +1 -1
  200. package/link/http/createHttpLink.js +14 -14
  201. package/link/http/createHttpLink.js.map +1 -1
  202. package/link/http/http.cjs +2 -2
  203. package/link/http/http.cjs.map +1 -1
  204. package/link/http/http.cjs.native.js +2 -2
  205. package/link/http/index.d.ts +10 -10
  206. package/link/http/index.d.ts.map +1 -1
  207. package/link/http/index.js +10 -10
  208. package/link/http/index.js.map +1 -1
  209. package/link/http/iterators/nodeStream.js.map +1 -1
  210. package/link/http/iterators/promise.js.map +1 -1
  211. package/link/http/iterators/reader.js.map +1 -1
  212. package/link/http/parseAndCheckHttpResponse.d.ts +2 -2
  213. package/link/http/parseAndCheckHttpResponse.d.ts.map +1 -1
  214. package/link/http/parseAndCheckHttpResponse.js +2 -2
  215. package/link/http/parseAndCheckHttpResponse.js.map +1 -1
  216. package/link/http/responseIterator.js.map +1 -1
  217. package/link/http/rewriteURIForGET.d.ts +1 -1
  218. package/link/http/rewriteURIForGET.d.ts.map +1 -1
  219. package/link/http/rewriteURIForGET.js +1 -1
  220. package/link/http/rewriteURIForGET.js.map +1 -1
  221. package/link/http/selectHttpOptionsAndBody.d.ts +2 -2
  222. package/link/http/selectHttpOptionsAndBody.d.ts.map +1 -1
  223. package/link/http/selectHttpOptionsAndBody.js +1 -1
  224. package/link/http/selectHttpOptionsAndBody.js.map +1 -1
  225. package/link/http/selectURI.d.ts +1 -1
  226. package/link/http/selectURI.d.ts.map +1 -1
  227. package/link/http/selectURI.js.map +1 -1
  228. package/link/http/serializeFetchParameter.d.ts +1 -1
  229. package/link/http/serializeFetchParameter.d.ts.map +1 -1
  230. package/link/http/serializeFetchParameter.js +1 -1
  231. package/link/http/serializeFetchParameter.js.map +1 -1
  232. package/link/persisted-queries/index.d.ts +3 -3
  233. package/link/persisted-queries/index.d.ts.map +1 -1
  234. package/link/persisted-queries/index.js +4 -4
  235. package/link/persisted-queries/index.js.map +1 -1
  236. package/link/persisted-queries/persisted-queries.cjs.map +1 -1
  237. package/link/remove-typename/index.d.ts +1 -1
  238. package/link/remove-typename/index.d.ts.map +1 -1
  239. package/link/remove-typename/index.js +1 -1
  240. package/link/remove-typename/index.js.map +1 -1
  241. package/link/remove-typename/remove-typename.cjs.map +1 -1
  242. package/link/remove-typename/removeTypenameFromVariables.d.ts +1 -1
  243. package/link/remove-typename/removeTypenameFromVariables.d.ts.map +1 -1
  244. package/link/remove-typename/removeTypenameFromVariables.js +2 -2
  245. package/link/remove-typename/removeTypenameFromVariables.js.map +1 -1
  246. package/link/retry/delayFunction.d.ts +1 -1
  247. package/link/retry/delayFunction.d.ts.map +1 -1
  248. package/link/retry/delayFunction.js.map +1 -1
  249. package/link/retry/index.d.ts +1 -1
  250. package/link/retry/index.d.ts.map +1 -1
  251. package/link/retry/index.js +1 -1
  252. package/link/retry/index.js.map +1 -1
  253. package/link/retry/retry.cjs.map +1 -1
  254. package/link/retry/retryFunction.d.ts +1 -1
  255. package/link/retry/retryFunction.d.ts.map +1 -1
  256. package/link/retry/retryFunction.js.map +1 -1
  257. package/link/retry/retryLink.d.ts +5 -5
  258. package/link/retry/retryLink.d.ts.map +1 -1
  259. package/link/retry/retryLink.js +4 -4
  260. package/link/retry/retryLink.js.map +1 -1
  261. package/link/schema/index.d.ts +3 -3
  262. package/link/schema/index.d.ts.map +1 -1
  263. package/link/schema/index.js +2 -2
  264. package/link/schema/index.js.map +1 -1
  265. package/link/schema/schema.cjs.map +1 -1
  266. package/link/subscriptions/index.d.ts +3 -3
  267. package/link/subscriptions/index.d.ts.map +1 -1
  268. package/link/subscriptions/index.js +1 -1
  269. package/link/subscriptions/index.js.map +1 -1
  270. package/link/subscriptions/subscriptions.cjs.map +1 -1
  271. package/link/utils/createOperation.d.ts +1 -1
  272. package/link/utils/createOperation.d.ts.map +1 -1
  273. package/link/utils/createOperation.js.map +1 -1
  274. package/link/utils/fromError.d.ts +1 -1
  275. package/link/utils/fromError.d.ts.map +1 -1
  276. package/link/utils/fromError.js +1 -1
  277. package/link/utils/fromError.js.map +1 -1
  278. package/link/utils/fromPromise.d.ts +1 -1
  279. package/link/utils/fromPromise.d.ts.map +1 -1
  280. package/link/utils/fromPromise.js +1 -1
  281. package/link/utils/fromPromise.js.map +1 -1
  282. package/link/utils/index.d.ts +9 -9
  283. package/link/utils/index.d.ts.map +1 -1
  284. package/link/utils/index.js +9 -9
  285. package/link/utils/index.js.map +1 -1
  286. package/link/utils/toPromise.d.ts +1 -1
  287. package/link/utils/toPromise.d.ts.map +1 -1
  288. package/link/utils/toPromise.js +2 -2
  289. package/link/utils/toPromise.js.map +1 -1
  290. package/link/utils/transformOperation.d.ts +1 -1
  291. package/link/utils/transformOperation.d.ts.map +1 -1
  292. package/link/utils/transformOperation.js +1 -1
  293. package/link/utils/transformOperation.js.map +1 -1
  294. package/link/utils/utils.cjs +1 -1
  295. package/link/utils/utils.cjs.map +1 -1
  296. package/link/utils/utils.cjs.native.js +1 -1
  297. package/link/utils/validateOperation.d.ts +1 -1
  298. package/link/utils/validateOperation.d.ts.map +1 -1
  299. package/link/utils/validateOperation.js +1 -1
  300. package/link/utils/validateOperation.js.map +1 -1
  301. package/link/ws/index.d.ts +3 -3
  302. package/link/ws/index.d.ts.map +1 -1
  303. package/link/ws/index.js +1 -1
  304. package/link/ws/index.js.map +1 -1
  305. package/link/ws/ws.cjs.map +1 -1
  306. package/package.json +14 -10
  307. package/react/cache/QueryReference.d.ts +7 -6
  308. package/react/cache/QueryReference.d.ts.map +1 -1
  309. package/react/cache/QueryReference.js +84 -53
  310. package/react/cache/QueryReference.js.map +1 -1
  311. package/react/cache/SuspenseCache.d.ts +3 -3
  312. package/react/cache/SuspenseCache.d.ts.map +1 -1
  313. package/react/cache/SuspenseCache.js +2 -2
  314. package/react/cache/SuspenseCache.js.map +1 -1
  315. package/react/cache/index.d.ts +1 -1
  316. package/react/cache/index.d.ts.map +1 -1
  317. package/react/cache/index.js +1 -1
  318. package/react/cache/index.js.map +1 -1
  319. package/react/components/Mutation.d.ts +3 -3
  320. package/react/components/Mutation.d.ts.map +1 -1
  321. package/react/components/Mutation.js +1 -1
  322. package/react/components/Mutation.js.map +1 -1
  323. package/react/components/Query.d.ts +2 -2
  324. package/react/components/Query.d.ts.map +1 -1
  325. package/react/components/Query.js +1 -1
  326. package/react/components/Query.js.map +1 -1
  327. package/react/components/Subscription.d.ts +2 -2
  328. package/react/components/Subscription.d.ts.map +1 -1
  329. package/react/components/Subscription.js +1 -1
  330. package/react/components/Subscription.js.map +1 -1
  331. package/react/components/components.cjs.map +1 -1
  332. package/react/components/index.d.ts +4 -4
  333. package/react/components/index.d.ts.map +1 -1
  334. package/react/components/index.js +4 -4
  335. package/react/components/index.js.map +1 -1
  336. package/react/components/types.d.ts +2 -2
  337. package/react/components/types.d.ts.map +1 -1
  338. package/react/components/types.js.map +1 -1
  339. package/react/context/ApolloConsumer.d.ts +1 -1
  340. package/react/context/ApolloConsumer.d.ts.map +1 -1
  341. package/react/context/ApolloConsumer.js +2 -2
  342. package/react/context/ApolloConsumer.js.map +1 -1
  343. package/react/context/ApolloContext.d.ts +4 -5
  344. package/react/context/ApolloContext.d.ts.map +1 -1
  345. package/react/context/ApolloContext.js +11 -4
  346. package/react/context/ApolloContext.js.map +1 -1
  347. package/react/context/ApolloProvider.d.ts +2 -2
  348. package/react/context/ApolloProvider.d.ts.map +1 -1
  349. package/react/context/ApolloProvider.js +2 -2
  350. package/react/context/ApolloProvider.js.map +1 -1
  351. package/react/context/context.cjs +9 -2
  352. package/react/context/context.cjs.map +1 -1
  353. package/react/context/context.cjs.native.js +9 -2
  354. package/react/context/index.d.ts +4 -4
  355. package/react/context/index.d.ts.map +1 -1
  356. package/react/context/index.js +4 -4
  357. package/react/context/index.js.map +1 -1
  358. package/react/hoc/graphql.d.ts +2 -2
  359. package/react/hoc/graphql.d.ts.map +1 -1
  360. package/react/hoc/graphql.js +4 -4
  361. package/react/hoc/graphql.js.map +1 -1
  362. package/react/hoc/hoc-utils.d.ts +2 -2
  363. package/react/hoc/hoc-utils.d.ts.map +1 -1
  364. package/react/hoc/hoc-utils.js +1 -1
  365. package/react/hoc/hoc-utils.js.map +1 -1
  366. package/react/hoc/hoc.cjs.map +1 -1
  367. package/react/hoc/index.d.ts +7 -7
  368. package/react/hoc/index.d.ts.map +1 -1
  369. package/react/hoc/index.js +7 -7
  370. package/react/hoc/index.js.map +1 -1
  371. package/react/hoc/mutation-hoc.d.ts +3 -3
  372. package/react/hoc/mutation-hoc.d.ts.map +1 -1
  373. package/react/hoc/mutation-hoc.js +3 -3
  374. package/react/hoc/mutation-hoc.js.map +1 -1
  375. package/react/hoc/query-hoc.d.ts +1 -1
  376. package/react/hoc/query-hoc.d.ts.map +1 -1
  377. package/react/hoc/query-hoc.js +3 -3
  378. package/react/hoc/query-hoc.js.map +1 -1
  379. package/react/hoc/subscription-hoc.d.ts +1 -1
  380. package/react/hoc/subscription-hoc.d.ts.map +1 -1
  381. package/react/hoc/subscription-hoc.js +3 -3
  382. package/react/hoc/subscription-hoc.js.map +1 -1
  383. package/react/hoc/types.d.ts +4 -4
  384. package/react/hoc/types.d.ts.map +1 -1
  385. package/react/hoc/types.js.map +1 -1
  386. package/react/hoc/withApollo.d.ts +1 -1
  387. package/react/hoc/withApollo.d.ts.map +1 -1
  388. package/react/hoc/withApollo.js +2 -2
  389. package/react/hoc/withApollo.js.map +1 -1
  390. package/react/hooks/hooks.cjs +146 -129
  391. package/react/hooks/hooks.cjs.map +1 -1
  392. package/react/hooks/hooks.cjs.native.js +146 -129
  393. package/react/hooks/index.d.ts +11 -11
  394. package/react/hooks/index.d.ts.map +1 -1
  395. package/react/hooks/index.js +11 -11
  396. package/react/hooks/index.js.map +1 -1
  397. package/react/hooks/internal/__use.js +2 -2
  398. package/react/hooks/internal/__use.js.map +1 -1
  399. package/react/hooks/internal/index.d.ts +3 -4
  400. package/react/hooks/internal/index.d.ts.map +1 -1
  401. package/react/hooks/internal/index.js +3 -4
  402. package/react/hooks/internal/index.js.map +1 -1
  403. package/react/hooks/internal/useDeepMemo.js +2 -2
  404. package/react/hooks/internal/useDeepMemo.js.map +1 -1
  405. package/react/hooks/internal/useIsomorphicLayoutEffect.d.ts +2 -2
  406. package/react/hooks/internal/useIsomorphicLayoutEffect.d.ts.map +1 -1
  407. package/react/hooks/internal/useIsomorphicLayoutEffect.js +4 -4
  408. package/react/hooks/internal/useIsomorphicLayoutEffect.js.map +1 -1
  409. package/react/hooks/useApolloClient.d.ts +1 -1
  410. package/react/hooks/useApolloClient.d.ts.map +1 -1
  411. package/react/hooks/useApolloClient.js +4 -4
  412. package/react/hooks/useApolloClient.js.map +1 -1
  413. package/react/hooks/useBackgroundQuery.d.ts +5 -5
  414. package/react/hooks/useBackgroundQuery.d.ts.map +1 -1
  415. package/react/hooks/useBackgroundQuery.js +13 -13
  416. package/react/hooks/useBackgroundQuery.js.map +1 -1
  417. package/react/hooks/useFragment.d.ts +4 -4
  418. package/react/hooks/useFragment.d.ts.map +1 -1
  419. package/react/hooks/useFragment.js +2 -2
  420. package/react/hooks/useFragment.js.map +1 -1
  421. package/react/hooks/useLazyQuery.d.ts +2 -2
  422. package/react/hooks/useLazyQuery.d.ts.map +1 -1
  423. package/react/hooks/useLazyQuery.js +9 -9
  424. package/react/hooks/useLazyQuery.js.map +1 -1
  425. package/react/hooks/useMutation.d.ts +2 -2
  426. package/react/hooks/useMutation.d.ts.map +1 -1
  427. package/react/hooks/useMutation.js +10 -10
  428. package/react/hooks/useMutation.js.map +1 -1
  429. package/react/hooks/useQuery.d.ts +4 -4
  430. package/react/hooks/useQuery.d.ts.map +1 -1
  431. package/react/hooks/useQuery.js +17 -17
  432. package/react/hooks/useQuery.js.map +1 -1
  433. package/react/hooks/useReactiveVar.d.ts +1 -1
  434. package/react/hooks/useReactiveVar.d.ts.map +1 -1
  435. package/react/hooks/useReactiveVar.js +3 -3
  436. package/react/hooks/useReactiveVar.js.map +1 -1
  437. package/react/hooks/useReadQuery.d.ts +3 -3
  438. package/react/hooks/useReadQuery.d.ts.map +1 -1
  439. package/react/hooks/useReadQuery.js +5 -5
  440. package/react/hooks/useReadQuery.js.map +1 -1
  441. package/react/hooks/useSubscription.d.ts +2 -2
  442. package/react/hooks/useSubscription.d.ts.map +1 -1
  443. package/react/hooks/useSubscription.js +14 -14
  444. package/react/hooks/useSubscription.js.map +1 -1
  445. package/react/hooks/useSuspenseCache.d.ts +1 -1
  446. package/react/hooks/useSuspenseCache.d.ts.map +1 -1
  447. package/react/hooks/useSuspenseCache.js +4 -4
  448. package/react/hooks/useSuspenseCache.js.map +1 -1
  449. package/react/hooks/useSuspenseQuery.d.ts +4 -6
  450. package/react/hooks/useSuspenseQuery.d.ts.map +1 -1
  451. package/react/hooks/useSuspenseQuery.js +26 -29
  452. package/react/hooks/useSuspenseQuery.js.map +1 -1
  453. package/react/hooks/useSyncExternalStore.js +4 -4
  454. package/react/hooks/useSyncExternalStore.js.map +1 -1
  455. package/react/index.d.ts +6 -6
  456. package/react/index.d.ts.map +1 -1
  457. package/react/index.js +6 -6
  458. package/react/index.js.map +1 -1
  459. package/react/parser/index.js +1 -1
  460. package/react/parser/index.js.map +1 -1
  461. package/react/parser/parser.cjs.map +1 -1
  462. package/react/react.cjs +82 -51
  463. package/react/react.cjs.map +1 -1
  464. package/react/react.cjs.native.js +82 -51
  465. package/react/ssr/RenderPromises.d.ts +2 -2
  466. package/react/ssr/RenderPromises.d.ts.map +1 -1
  467. package/react/ssr/RenderPromises.js.map +1 -1
  468. package/react/ssr/getDataFromTree.js +2 -2
  469. package/react/ssr/getDataFromTree.js.map +1 -1
  470. package/react/ssr/index.d.ts +3 -3
  471. package/react/ssr/index.d.ts.map +1 -1
  472. package/react/ssr/index.js +3 -3
  473. package/react/ssr/index.js.map +1 -1
  474. package/react/ssr/renderToStringWithData.js +1 -1
  475. package/react/ssr/renderToStringWithData.js.map +1 -1
  476. package/react/ssr/ssr.cjs.map +1 -1
  477. package/react/types/types.d.ts +7 -7
  478. package/react/types/types.d.ts.map +1 -1
  479. package/react/types/types.js.map +1 -1
  480. package/testing/core/core.cjs.map +1 -1
  481. package/testing/core/index.d.ts +7 -7
  482. package/testing/core/index.d.ts.map +1 -1
  483. package/testing/core/index.js +7 -7
  484. package/testing/core/index.js.map +1 -1
  485. package/testing/core/mocking/mockClient.d.ts +2 -2
  486. package/testing/core/mocking/mockClient.d.ts.map +1 -1
  487. package/testing/core/mocking/mockClient.js +3 -3
  488. package/testing/core/mocking/mockClient.js.map +1 -1
  489. package/testing/core/mocking/mockLink.d.ts +3 -3
  490. package/testing/core/mocking/mockLink.d.ts.map +1 -1
  491. package/testing/core/mocking/mockLink.js +3 -3
  492. package/testing/core/mocking/mockLink.js.map +1 -1
  493. package/testing/core/mocking/mockQueryManager.d.ts +3 -3
  494. package/testing/core/mocking/mockQueryManager.d.ts.map +1 -1
  495. package/testing/core/mocking/mockQueryManager.js +3 -3
  496. package/testing/core/mocking/mockQueryManager.js.map +1 -1
  497. package/testing/core/mocking/mockSubscriptionLink.d.ts +3 -3
  498. package/testing/core/mocking/mockSubscriptionLink.d.ts.map +1 -1
  499. package/testing/core/mocking/mockSubscriptionLink.js +2 -2
  500. package/testing/core/mocking/mockSubscriptionLink.js.map +1 -1
  501. package/testing/core/mocking/mockWatchQuery.d.ts +2 -2
  502. package/testing/core/mocking/mockWatchQuery.d.ts.map +1 -1
  503. package/testing/core/mocking/mockWatchQuery.js +1 -1
  504. package/testing/core/mocking/mockWatchQuery.js.map +1 -1
  505. package/testing/core/observableToPromise.d.ts +2 -2
  506. package/testing/core/observableToPromise.d.ts.map +1 -1
  507. package/testing/core/observableToPromise.js.map +1 -1
  508. package/testing/core/subscribeAndCount.d.ts +1 -1
  509. package/testing/core/subscribeAndCount.d.ts.map +1 -1
  510. package/testing/core/subscribeAndCount.js +1 -1
  511. package/testing/core/subscribeAndCount.js.map +1 -1
  512. package/testing/index.d.ts +3 -3
  513. package/testing/index.d.ts.map +1 -1
  514. package/testing/index.js +3 -3
  515. package/testing/index.js.map +1 -1
  516. package/testing/matchers/index.js +2 -2
  517. package/testing/matchers/index.js.map +1 -1
  518. package/testing/matchers/toHaveSuspenseCacheEntryUsing.d.ts +1 -1
  519. package/testing/matchers/toHaveSuspenseCacheEntryUsing.d.ts.map +1 -1
  520. package/testing/matchers/toHaveSuspenseCacheEntryUsing.js +2 -2
  521. package/testing/matchers/toHaveSuspenseCacheEntryUsing.js.map +1 -1
  522. package/testing/matchers/toMatchDocument.d.ts +1 -1
  523. package/testing/matchers/toMatchDocument.d.ts.map +1 -1
  524. package/testing/matchers/toMatchDocument.js +1 -1
  525. package/testing/matchers/toMatchDocument.js.map +1 -1
  526. package/testing/react/MockedProvider.d.ts +7 -7
  527. package/testing/react/MockedProvider.d.ts.map +1 -1
  528. package/testing/react/MockedProvider.js +5 -5
  529. package/testing/react/MockedProvider.js.map +1 -1
  530. package/testing/testing.cjs.map +1 -1
  531. package/utilities/common/canUse.js.map +1 -1
  532. package/utilities/common/compact.d.ts +1 -1
  533. package/utilities/common/compact.d.ts.map +1 -1
  534. package/utilities/common/compact.js.map +1 -1
  535. package/utilities/common/errorHandling.d.ts +1 -1
  536. package/utilities/common/errorHandling.d.ts.map +1 -1
  537. package/utilities/common/errorHandling.js.map +1 -1
  538. package/utilities/common/incrementalResult.d.ts +1 -1
  539. package/utilities/common/incrementalResult.d.ts.map +1 -1
  540. package/utilities/common/incrementalResult.js.map +1 -1
  541. package/utilities/common/maybeDeepFreeze.d.ts.map +1 -1
  542. package/utilities/common/maybeDeepFreeze.js +3 -4
  543. package/utilities/common/maybeDeepFreeze.js.map +1 -1
  544. package/utilities/common/mergeDeep.d.ts +1 -1
  545. package/utilities/common/mergeDeep.d.ts.map +1 -1
  546. package/utilities/common/mergeDeep.js.map +1 -1
  547. package/utilities/common/mergeOptions.d.ts +1 -1
  548. package/utilities/common/mergeOptions.d.ts.map +1 -1
  549. package/utilities/common/mergeOptions.js.map +1 -1
  550. package/utilities/common/omitDeep.d.ts +1 -1
  551. package/utilities/common/omitDeep.d.ts.map +1 -1
  552. package/utilities/common/omitDeep.js +1 -1
  553. package/utilities/common/omitDeep.js.map +1 -1
  554. package/utilities/common/responseIterator.js.map +1 -1
  555. package/utilities/common/stringifyForDisplay.js.map +1 -1
  556. package/utilities/common/stripTypename.d.ts +1 -1
  557. package/utilities/common/stripTypename.d.ts.map +1 -1
  558. package/utilities/common/stripTypename.js +1 -1
  559. package/utilities/common/stripTypename.js.map +1 -1
  560. package/utilities/globals/global.d.ts.map +1 -1
  561. package/utilities/globals/global.js.map +1 -1
  562. package/utilities/globals/globals.cjs +4 -16
  563. package/utilities/globals/globals.cjs.map +1 -1
  564. package/utilities/globals/globals.cjs.native.js +4 -16
  565. package/utilities/globals/index.d.ts +5 -6
  566. package/utilities/globals/index.d.ts.map +1 -1
  567. package/utilities/globals/index.js +2 -5
  568. package/utilities/globals/index.js.map +1 -1
  569. package/utilities/globals/invariantWrappers.d.ts +1 -1
  570. package/utilities/globals/invariantWrappers.d.ts.map +1 -1
  571. package/utilities/globals/invariantWrappers.js +3 -3
  572. package/utilities/globals/invariantWrappers.js.map +1 -1
  573. package/utilities/graphql/DocumentTransform.js +3 -3
  574. package/utilities/graphql/DocumentTransform.js.map +1 -1
  575. package/utilities/graphql/directives.js +1 -1
  576. package/utilities/graphql/directives.js.map +1 -1
  577. package/utilities/graphql/fragments.js +1 -1
  578. package/utilities/graphql/fragments.js.map +1 -1
  579. package/utilities/graphql/getFromAST.js +2 -2
  580. package/utilities/graphql/getFromAST.js.map +1 -1
  581. package/utilities/graphql/operations.d.ts +1 -1
  582. package/utilities/graphql/operations.d.ts.map +1 -1
  583. package/utilities/graphql/operations.js +1 -1
  584. package/utilities/graphql/operations.js.map +1 -1
  585. package/utilities/graphql/print.js +1 -1
  586. package/utilities/graphql/print.js.map +1 -1
  587. package/utilities/graphql/storeUtils.d.ts +1 -1
  588. package/utilities/graphql/storeUtils.d.ts.map +1 -1
  589. package/utilities/graphql/storeUtils.js +3 -3
  590. package/utilities/graphql/storeUtils.js.map +1 -1
  591. package/utilities/graphql/transform.js +7 -7
  592. package/utilities/graphql/transform.js.map +1 -1
  593. package/utilities/index.d.ts +34 -34
  594. package/utilities/index.d.ts.map +1 -1
  595. package/utilities/index.js +32 -32
  596. package/utilities/index.js.map +1 -1
  597. package/utilities/observables/Concast.d.ts +2 -2
  598. package/utilities/observables/Concast.d.ts.map +1 -1
  599. package/utilities/observables/Concast.js.map +1 -1
  600. package/utilities/observables/asyncMap.d.ts +1 -1
  601. package/utilities/observables/asyncMap.d.ts.map +1 -1
  602. package/utilities/observables/asyncMap.js.map +1 -1
  603. package/utilities/observables/iteration.d.ts +1 -1
  604. package/utilities/observables/iteration.d.ts.map +1 -1
  605. package/utilities/observables/iteration.js.map +1 -1
  606. package/utilities/observables/subclassing.d.ts +1 -1
  607. package/utilities/observables/subclassing.d.ts.map +1 -1
  608. package/utilities/observables/subclassing.js.map +1 -1
  609. package/utilities/policies/pagination.d.ts +1 -1
  610. package/utilities/policies/pagination.d.ts.map +1 -1
  611. package/utilities/policies/pagination.js +1 -1
  612. package/utilities/policies/pagination.js.map +1 -1
  613. package/utilities/types/DeepOmit.d.ts +1 -1
  614. package/utilities/types/DeepOmit.d.ts.map +1 -1
  615. package/utilities/types/DeepOmit.js.map +1 -1
  616. package/utilities/types/DeepPartial.d.ts +1 -1
  617. package/utilities/types/DeepPartial.d.ts.map +1 -1
  618. package/utilities/types/DeepPartial.js.map +1 -1
  619. package/utilities/utilities.cjs +4 -4
  620. package/utilities/utilities.cjs.map +1 -1
  621. package/utilities/utilities.cjs.native.js +4 -4
  622. package/version.js +1 -1
  623. package/react/hooks/internal/useStrictModeSafeCleanupEffect.d.ts +0 -2
  624. package/react/hooks/internal/useStrictModeSafeCleanupEffect.d.ts.map +0 -1
  625. package/react/hooks/internal/useStrictModeSafeCleanupEffect.js +0 -11
  626. package/react/hooks/internal/useStrictModeSafeCleanupEffect.js.map +0 -1
  627. package/utilities/globals/DEV.d.ts +0 -3
  628. package/utilities/globals/DEV.d.ts.map +0 -1
  629. package/utilities/globals/DEV.js +0 -4
  630. package/utilities/globals/DEV.js.map +0 -1
  631. package/utilities/globals/fix-graphql.d.ts +0 -2
  632. package/utilities/globals/fix-graphql.d.ts.map +0 -1
  633. package/utilities/globals/fix-graphql.js +0 -6
  634. package/utilities/globals/fix-graphql.js.map +0 -1
@@ -1,8 +1,8 @@
1
1
  import { __awaiter, __extends, __generator } from "tslib";
2
- import { ApolloLink } from "../core/index.js";
3
- import { Observable } from "../../utilities/index.js";
4
- import { buildDelayFunction, } from "./delayFunction.js";
5
- import { buildRetryFunction, } from "./retryFunction.js";
2
+ import { ApolloLink } from '../core/index.js';
3
+ import { Observable } from '../../utilities/index.js';
4
+ import { buildDelayFunction, } from './delayFunction.js';
5
+ import { buildRetryFunction, } from './retryFunction.js';
6
6
  var RetryableOperation = (function () {
7
7
  function RetryableOperation(operation, nextLink, delayFor, retryIf) {
8
8
  var _this = this;
@@ -1 +1 @@
1
- {"version":3,"file":"retryLink.js","sourceRoot":"","sources":["../../../src/link/retry/retryLink.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAErC,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAI7C,OAAO,EACL,kBAAkB,GACnB,MAAM,iBAAiB,CAAC;AAIzB,OAAO,EACL,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,SAAA;gBACjB,IAAI,CAAC,QAAQ;oBAAE,SAAS;gBACxB,QAAQ,CAAC,IAAK,CAAC,KAAK,CAAC,CAAC;aACvB;QACH,CAAC,CAAC;QAEM,eAAU,GAAG;YACnB,KAAI,CAAC,QAAQ,GAAG,IAAI,CAAC;YACrB,KAAuB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AU,GAgCxC","sourcesContent":["import type { Operation, FetchResult, NextLink } from '../core';\nimport { ApolloLink } from '../core';\nimport type { Observer, ObservableSubscription } from '../../utilities';\nimport { Observable } from '../../utilities';\nimport type {\n DelayFunction,\n DelayFunctionOptions} from './delayFunction';\nimport {\n buildDelayFunction,\n} from './delayFunction';\nimport type {\n RetryFunction,\n RetryFunctionOptions} from './retryFunction';\nimport {\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
+ {"version":3,"file":"retryLink.js","sourceRoot":"","sources":["../../../src/link/retry/retryLink.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE9C,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAItD,OAAO,EACL,kBAAkB,GACnB,MAAM,oBAAoB,CAAC;AAI5B,OAAO,EACL,kBAAkB,GACnB,MAAM,oBAAoB,CAAC;AAmB5B;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,SAAA;gBACjB,IAAI,CAAC,QAAQ;oBAAE,SAAS;gBACxB,QAAQ,CAAC,IAAK,CAAC,KAAK,CAAC,CAAC;aACvB;QACH,CAAC,CAAC;QAEM,eAAU,GAAG;YACnB,KAAI,CAAC,QAAQ,GAAG,IAAI,CAAC;YACrB,KAAuB,UAAc,EAAd,KAAA,KAAI,CAAC,SAAS,EAAd,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from '../core/index.js';\nimport { ApolloLink } from '../core/index.js';\nimport type { Observer, ObservableSubscription } from '../../utilities/index.js';\nimport { Observable } from '../../utilities/index.js';\nimport type {\n DelayFunction,\n DelayFunctionOptions} from './delayFunction.js';\nimport {\n buildDelayFunction,\n} from './delayFunction.js';\nimport type {\n RetryFunction,\n RetryFunctionOptions} from './retryFunction.js';\nimport {\n buildRetryFunction,\n} from './retryFunction.js';\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,7 +1,7 @@
1
1
  import type { GraphQLSchema } from 'graphql';
2
- import type { Operation, FetchResult } from '../core';
3
- import { ApolloLink } from '../core';
4
- import { Observable } from '../../utilities';
2
+ import type { Operation, FetchResult } from '../core/index.js';
3
+ import { ApolloLink } from '../core/index.js';
4
+ import { Observable } from '../../utilities/index.js';
5
5
  export declare namespace SchemaLink {
6
6
  type ResolverContext = Record<string, any>;
7
7
  type ResolverContextFunction = (operation: Operation) => ResolverContext | PromiseLike<ResolverContext>;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/link/schema/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAG7C,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AACtD,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,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,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AE,SAAS,GAAG,UAAU,CAAC,WAAW,CAAC;CAoC9D"}
@@ -1,7 +1,7 @@
1
1
  import { __extends } from "tslib";
2
2
  import { validate, execute } from 'graphql';
3
- import { ApolloLink } from "../core/index.js";
4
- import { Observable } from "../../utilities/index.js";
3
+ import { ApolloLink } from '../core/index.js';
4
+ import { Observable } from '../../utilities/index.js';
5
5
  var SchemaLink = (function (_super) {
6
6
  __extends(SchemaLink, _super);
7
7
  function SchemaLink(options) {
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/link/schema/index.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAG5C,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,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 type { GraphQLSchema } from 'graphql';\nimport { validate, execute } from 'graphql';\n\nimport type { Operation, FetchResult } from '../core';\nimport { ApolloLink } 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
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/link/schema/index.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAG5C,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAgCtD;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,CAA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AAC,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 type { GraphQLSchema } from 'graphql';\nimport { validate, execute } from 'graphql';\n\nimport type { Operation, FetchResult } from '../core/index.js';\nimport { ApolloLink } from '../core/index.js';\nimport { Observable } from '../../utilities/index.js';\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 +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,UAAU,MAAM,EAAE;AACpC,IAAIA,eAAS,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC;AAClC,IAAI,SAAS,UAAU,CAAC,OAAO,EAAE;AACjC,QAAQ,IAAI,KAAK,GAAG,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC;AAC9C,QAAQ,KAAK,CAAC,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;AACtC,QAAQ,KAAK,CAAC,SAAS,GAAG,OAAO,CAAC,SAAS,CAAC;AAC5C,QAAQ,KAAK,CAAC,OAAO,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U,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
+ {"version":3,"file":"schema.cjs","sources":["index.js"],"sourcesContent":["import { __extends } from \"tslib\";\nimport { validate, execute } from 'graphql';\nimport { ApolloLink } from '../core/index.js';\nimport { Observable } from '../../utilities/index.js';\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 };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AE;AACrD,wBAAwB,OAAO,EAAE,MAAM,EAAE,gBAAgB,EAAE,CAAC;AAC5D,qBAAqB;AACrB,iBAAiB;AACjB,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,7 +1,7 @@
1
1
  import type { Client } from "graphql-ws";
2
- import type { Operation, FetchResult } from "../core";
3
- import { ApolloLink } from "../core";
4
- import { Observable } from "../../utilities";
2
+ import type { Operation, FetchResult } from "../core/index.js";
3
+ import { ApolloLink } from "../core/index.js";
4
+ import { Observable } from "../../utilities/index.js";
5
5
  export declare class GraphQLWsLink extends ApolloLink {
6
6
  readonly client: Client;
7
7
  constructor(client: Client);
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/link/subscriptions/index.ts"],"names":[],"mappings":"AA+BA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAEzC,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AACtD,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAmB,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAa9D,qBAAa,aAAc,SAAQ,UAAU;aACf,MAAM,EAAE,MAAM;gBAAd,MAAM,EAAE,MAAM;IAInC,OAAO,CAAC,SAAS,EAAE,SAAS,GAAG,UAAU,CAAC,WAAW,CAAC;CAiC9D"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/link/subscriptions/index.ts"],"names":[],"mappings":"AA+BA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAEzC,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/D,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAmB,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAavE,qBAAa,aAAc,SAAQ,UAAU;aACf,MAAM,EAAE,MAAM;gBAAd,MAAM,EAAE,MAAM;IAInC,OAAO,CAAC,SAAS,EAAE,SAAS,GAAG,UAAU,CAAC,WAAW,CAAC;CAiC9D"}
@@ -1,5 +1,5 @@
1
1
  import { __assign, __extends } from "tslib";
2
- import { print } from "../../utilities/index.js";
2
+ import { print } from '../../utilities/index.js';
3
3
  import { ApolloLink } from "../core/index.js";
4
4
  import { isNonNullObject, Observable } from "../../utilities/index.js";
5
5
  import { ApolloError } from "../../errors/index.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/link/subscriptions/index.ts"],"names":[],"mappings":";AA8BA,OAAO,EAAE,KAAK,EAAE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,IAAI,KAAK,CAAC,uBACR,SAAS,CAAC,CAAC,CAAC,sBAAe,GAAG,CAAC,IAAI,CAAE,CAAC,CAAC,CAAC,EAAE,SAE1C,SAAS,CAAC,CAAC,CAAC,WAAI,GAAG,CAAC,MAAM,CAAE,CAAC,CAAC,CAAC,EAAE,CACjC,CAAC,CACJ,CAAC;qBACH;oBAED,OAAO,QAAQ,CAAC,KAAK,CACnB,IAAI,WAAW,CAAC;wBACd,aAAa,EAAE,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC;qBAChD,CAAC,CACH,CAAC;gBACJ,CAAC;aACF,CACF,CAAC;QACJ,CAAC,CAAC,CAAC;IACL,CAAC;IACH,oBAAC;AAAD,CAAC,AAtCD,CAAmC,UAAU,GAsC5C","sourcesContent":["// This file is adapted from the graphql-ws npm package:\n// https://github.com/enisdenjo/graphql-ws\n//\n// Most of the file comes from that package's README; some other parts (such as\n// isLikeCloseEvent) come from its source.\n//\n// Here's the license of the original code:\n//\n// The MIT License (MIT)\n//\n// Copyright (c) 2020-2021 Denis Badurina\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nimport { print } from '../../utilities';\nimport type { Client } from \"graphql-ws\";\n\nimport type { Operation, FetchResult } from \"../core\";\nimport { ApolloLink } from \"../core\";\nimport { isNonNullObject, Observable } from \"../../utilities\";\nimport { ApolloError } from \"../../errors\";\n\n// https://developer.mozilla.org/en-US/docs/Web/API/WebSocket/close_event\nfunction isLikeCloseEvent(val: unknown): val is CloseEvent {\n return isNonNullObject(val) && \"code\" in val && \"reason\" in val;\n}\n\n// https://developer.mozilla.org/en-US/docs/Web/API/WebSocket/error_event\nfunction isLikeErrorEvent(err: unknown): err is Event {\n return isNonNullObject(err) && err.target?.readyState === WebSocket.CLOSED;\n}\n\nexport class GraphQLWsLink extends ApolloLink {\n constructor(public readonly client: Client) {\n super();\n }\n\n public request(operation: Operation): Observable<FetchResult> {\n return new Observable((observer) => {\n return this.client.subscribe<FetchResult>(\n { ...operation, query: print(operation.query) },\n {\n next: observer.next.bind(observer),\n complete: observer.complete.bind(observer),\n error: (err) => {\n if (err instanceof Error) {\n return observer.error(err);\n }\n const likeClose = isLikeCloseEvent(err);\n if (likeClose || isLikeErrorEvent(err)) {\n return observer.error(\n // reason will be available on clean closes\n new Error(`Socket closed${\n likeClose ? ` with event ${err.code}` : \"\"\n }${\n likeClose ? ` ${err.reason}` : \"\"\n }`)\n );\n }\n\n return observer.error(\n new ApolloError({\n graphQLErrors: Array.isArray(err) ? err : [err],\n })\n );\n },\n }\n );\n });\n }\n}\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/link/subscriptions/index.ts"],"names":[],"mappings":";AA8BA,OAAO,EAAE,KAAK,EAAE,MAAM,0BAA0B,CAAC;AAIjD,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,M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AAS,CAAC,CAAC,CAAC,WAAI,GAAG,CAAC,MAAM,CAAE,CAAC,CAAC,CAAC,EAAE,CACjC,CAAC,CACJ,CAAC;qBACH;oBAED,OAAO,QAAQ,CAAC,KAAK,CACnB,IAAI,WAAW,CAAC;wBACd,aAAa,EAAE,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC;qBAChD,CAAC,CACH,CAAC;gBACJ,CAAC;aACF,CACF,CAAC;QACJ,CAAC,CAAC,CAAC;IACL,CAAC;IACH,oBAAC;AAAD,CAAC,AAtCD,CAAmC,UAAU,GAsC5C","sourcesContent":["// This file is adapted from the graphql-ws npm package:\n// https://github.com/enisdenjo/graphql-ws\n//\n// Most of the file comes from that package's README; some other parts (such as\n// isLikeCloseEvent) come from its source.\n//\n// Here's the license of the original code:\n//\n// The MIT License (MIT)\n//\n// Copyright (c) 2020-2021 Denis Badurina\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nimport { print } from '../../utilities/index.js';\nimport type { Client } from \"graphql-ws\";\n\nimport type { Operation, FetchResult } from \"../core/index.js\";\nimport { ApolloLink } from \"../core/index.js\";\nimport { isNonNullObject, Observable } from \"../../utilities/index.js\";\nimport { ApolloError } from \"../../errors/index.js\";\n\n// https://developer.mozilla.org/en-US/docs/Web/API/WebSocket/close_event\nfunction isLikeCloseEvent(val: unknown): val is CloseEvent {\n return isNonNullObject(val) && \"code\" in val && \"reason\" in val;\n}\n\n// https://developer.mozilla.org/en-US/docs/Web/API/WebSocket/error_event\nfunction isLikeErrorEvent(err: unknown): err is Event {\n return isNonNullObject(err) && err.target?.readyState === WebSocket.CLOSED;\n}\n\nexport class GraphQLWsLink extends ApolloLink {\n constructor(public readonly client: Client) {\n super();\n }\n\n public request(operation: Operation): Observable<FetchResult> {\n return new Observable((observer) => {\n return this.client.subscribe<FetchResult>(\n { ...operation, query: print(operation.query) },\n {\n next: observer.next.bind(observer),\n complete: observer.complete.bind(observer),\n error: (err) => {\n if (err instanceof Error) {\n return observer.error(err);\n }\n const likeClose = isLikeCloseEvent(err);\n if (likeClose || isLikeErrorEvent(err)) {\n return observer.error(\n // reason will be available on clean closes\n new Error(`Socket closed${\n likeClose ? ` with event ${err.code}` : \"\"\n }${\n likeClose ? ` ${err.reason}` : \"\"\n }`)\n );\n }\n\n return observer.error(\n new ApolloError({\n graphQLErrors: Array.isArray(err) ? err : [err],\n })\n );\n },\n }\n );\n });\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"subscriptions.cjs","sources":["index.js"],"sourcesContent":["import { __assign, __extends } from \"tslib\";\nimport { print } from '../../utilities';\nimport { ApolloLink } from \"../core\";\nimport { isNonNullObject, Observable } from \"../../utilities\";\nimport { ApolloError } from \"../../errors\";\nfunction isLikeCloseEvent(val) {\n return isNonNullObject(val) && \"code\" in val && \"reason\" in val;\n}\nfunction isLikeErrorEvent(err) {\n var _a;\n return isNonNullObject(err) && ((_a = err.target) === null || _a === void 0 ? void 0 : _a.readyState) === WebSocket.CLOSED;\n}\nvar GraphQLWsLink = (function (_super) {\n __extends(GraphQLWsLink, _super);\n function GraphQLWsLink(client) {\n var _this = _super.call(this) || this;\n _this.client = client;\n return _this;\n }\n GraphQLWsLink.prototype.request = function (operation) {\n var _this = this;\n return new Observable(function (observer) {\n return _this.client.subscribe(__assign(__assign({}, operation), { query: print(operation.query) }), {\n next: observer.next.bind(observer),\n complete: observer.complete.bind(observer),\n error: function (err) {\n if (err instanceof Error) {\n return observer.error(err);\n }\n var likeClose = isLikeCloseEvent(err);\n if (likeClose || isLikeErrorEvent(err)) {\n return observer.error(new Error(\"Socket closed\".concat(likeClose ? \" with event \".concat(err.code) : \"\").concat(likeClose ? \" \".concat(err.reason) : \"\")));\n }\n return observer.error(new ApolloError({\n graphQLErrors: Array.isArray(err) ? err : [err],\n }));\n },\n });\n });\n };\n return GraphQLWsLink;\n}(ApolloLink));\nexport { GraphQLWsLink };\n//# sourceMappingURL=index.js.map"],"names":["isNonNullObject","__extends","Observable","__assign","print","ApolloError","ApolloLink"],"mappings":";;;;;;;;;AAKA,SAAS,gBAAgB,CAAC,GAAG,EAAE;AAC/B,IAAI,OAAOA,yBAAe,CAAC,GAAG,CAAC,IAAI,MAAM,IAAI,GAAG,IAAI,QAAQ,IAAI,GAAG,CAAC;AACpE,CAAC;AACD,SAAS,gBAAgB,CAAC,GAAG,EAAE;AAC/B,IAAI,IAAI,EAAE,CAAC;AACX,IAAI,OAAOA,yBAAe,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,EAAE,GAAG,GAAG,CAAC,MAAM,MAAM,IAAI,IAAI,EAAE,KAAK,KAAK,CAAC,GAAG,KAAK,CAAC,GAAG,EAAE,CAAC,UAAU,MAAM,SAAS,CAAC,MAAM,CAAC;AAC/H,CAAC;AACE,IAAC,aAAa,IAAI,UAAU,MAAM,EAAE;AACvC,IAAIC,eAAS,CAAC,aAAa,EAAE,MAAM,CAAC,CAAC;AACrC,IAAI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AAM,CAAC,GAAG,CAAC,MAAM,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC;AACnL,qBAAqB;AACrB,oBAAoB,OAAO,QAAQ,CAAC,KAAK,CAAC,IAAIC,kBAAW,CAAC;AAC1D,wBAAwB,aAAa,EAAE,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,GAAG,GAAG,CAAC,GAAG,CAAC;AACvE,qBAAqB,CAAC,CAAC,CAAC;AACxB,iBAAiB;AACjB,aAAa,CAAC,CAAC;AACf,SAAS,CAAC,CAAC;AACX,KAAK,CAAC;AACN,IAAI,OAAO,aAAa,CAAC;AACzB,CAAC,CAACC,eAAU,CAAC;;;;"}
1
+ {"version":3,"file":"subscriptions.cjs","sources":["index.js"],"sourcesContent":["import { __assign, __extends } from \"tslib\";\nimport { print } from '../../utilities/index.js';\nimport { ApolloLink } from \"../core/index.js\";\nimport { isNonNullObject, Observable } from \"../../utilities/index.js\";\nimport { ApolloError } from \"../../errors/index.js\";\nfunction isLikeCloseEvent(val) {\n return isNonNullObject(val) && \"code\" in val && \"reason\" in val;\n}\nfunction isLikeErrorEvent(err) {\n var _a;\n return isNonNullObject(err) && ((_a = err.target) === null || _a === void 0 ? void 0 : _a.readyState) === WebSocket.CLOSED;\n}\nvar GraphQLWsLink = (function (_super) {\n __extends(GraphQLWsLink, _super);\n function GraphQLWsLink(client) {\n var _this = _super.call(this) || this;\n _this.client = client;\n return _this;\n }\n GraphQLWsLink.prototype.request = function (operation) {\n var _this = this;\n return new Observable(function (observer) {\n return _this.client.subscribe(__assign(__assign({}, operation), { query: print(operation.query) }), {\n next: observer.next.bind(observer),\n complete: observer.complete.bind(observer),\n error: function (err) {\n if (err instanceof Error) {\n return observer.error(err);\n }\n var likeClose = isLikeCloseEvent(err);\n if (likeClose || isLikeErrorEvent(err)) {\n return observer.error(new Error(\"Socket closed\".concat(likeClose ? \" with event \".concat(err.code) : \"\").concat(likeClose ? \" \".concat(err.reason) : \"\")));\n }\n return observer.error(new ApolloError({\n graphQLErrors: Array.isArray(err) ? err : [err],\n }));\n },\n });\n });\n };\n return GraphQLWsLink;\n}(ApolloLink));\nexport { GraphQLWsLink };\n//# sourceMappingURL=index.js.map"],"names":["isNonNullObject","__extends","Observable","__assign","print","ApolloError","ApolloLink"],"mappings":";;;;;;;;;AAKA,SAAS,gBAAgB,CAAC,GAAG,EAAE;AAC/B,IAAI,OAAOA,yBAAe,CAAC,GAAG,CAAC,IAAI,MAAM,IAAI,GAAG,IAAI,QAAQ,IAAI,GAAG,CAAC;AACpE,CAAC;AACD,SAAS,gBAAgB,CAAC,GAAG,EAAE;AAC/B,IAAI,IAAI,EAAE,CAAC;AACX,IAAI,OAAOA,yBAAe,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,EAAE,GAAG,GAAG,CAAC,MAAM,MAAM,IAAI,IAAI,EAAE,KAAK,KAAK,CAAC,GAAG,KAAK,CAAC,GAAG,EAAE,CAAC,UAAU,MAAM,SAAS,CAAC,MAAM,CAAC;AAC/H,CAAC;AACE,IAAC,aAAa,IAAI,UAAU,MAAM,EAAE;AACvC,IAAIC,eAAS,CAAC,aAAa,EAAE,MAAM,CAAC,CAAC;AACrC,IAAI,SAAS,aAAa,CAAC,MAAM,EAAE;AACnC,QAAQ,IAAI,KAAK,GAAG,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC;AAC9C,QAAQ,KAAK,CAAC,MAAM,GAAG,MAAM,CAAC;AAC9B,QAAQ,OAAO,KAAK,CAAC;AACrB,KAAK;AACL,IAAI,aAAa,CAAC,SAAS,CAAC,OAAO,GAAG,UAAU,SAAS,EAAE;AAC3D,QAAQ,IAAI,KAAK,GAAG,IAAI,CAAC;AACzB,QAAQ,OAAO,IAAIC,oBAAU,CAAC,UAAU,QAAQ,EAAE;AAClD,YAAY,OAAO,KAAK,CAAC,MAAM,CAAC,SAAS,CAACC,cAAQ,CAACA,cAAQ,CAAC,EAAE,EAAE,SAAS,CAAC,EA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raphQLRequest, Operation } from '../core/index.js';
2
2
  export declare function createOperation(starting: any, operation: GraphQLRequest): Operation;
3
3
  //# sourceMappingURL=createOperation.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"createOperation.d.ts","sourceRoot":"","sources":["../../../src/link/utils/createOperation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAEzD,wBAAgB,eAAe,CAC7B,QAAQ,EAAE,GAAG,EACb,SAAS,EAAE,cAAc,GACxB,SAAS,CAsBX"}
1
+ {"version":3,"file":"createOperation.d.ts","sourceRoot":"","sources":["../../../src/link/utils/createOperation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAElE,wBAAgB,eAAe,CAC7B,QAAQ,EAAE,GAAG,EACb,SAAS,EAAE,cAAc,GACxB,SAAS,CAsBX"}
@@ -1 +1 @@
1
- {"version":3,"file":"createOperation.js","sourceRoot":"","sources":["../../../src/link/utils/createOperation.ts"],"names":[],"mappings":";AAEA,MAAM,UAAU,eAAe,CAC7B,QAAa,EACb,SAAyB;IAEzB,IAAI,OAAO,gBAAQ,QAAQ,CAAE,CAAC;IAC9B,IAAM,UAAU,GAAG,UAAC,IAAS;QAC3B,IAAI,OAAO,IAAI,KAAK,UAAU,EAAE;YAC9B,OAAO,yBAAQ,OAAO,GAAK,IAAI,CAAC,OAAO,CAAC,CAAE,CAAC;SAC5C;aAAM;YACL,OAAO,yBAAQ,OAAO,GAAK,IAAI,CAAE,CAAC;SACnC;IACH,CAAC,CAAC;IACF,IAAM,UAAU,GAAG,cAAM,OAAA,cAAM,OAAO,EAAG,EAAhB,CAAgB,CAAC;IAE1C,MAAM,CAAC,cAAc,CAAC,SAAS,EAAE,YAAY,EAAE;QAC7C,UAAU,EAAE,KAAK;QACjB,KAAK,EAAE,UAAU;KAClB,CAAC,CAAC;IAEH,MAAM,CAAC,cAAc,CAAC,SAAS,EAAE,YAAY,EAAE;QAC7C,UAAU,EAAE,KAAK;QACjB,KAAK,EAAE,UAAU;KAClB,CAAC,CAAC;IAEH,OAAO,SAAsB,CAAC;AAChC,CAAC","sourcesContent":["import type { GraphQLRequest, Operation } from '../core';\n\nexport function createOperation(\n starting: any,\n operation: GraphQLRequest,\n): Operation {\n let context = { ...starting };\n const setContext = (next: any) => {\n if (typeof next === 'function') {\n context = { ...context, ...next(context) };\n } else {\n context = { ...context, ...next };\n }\n };\n const getContext = () => ({ ...context });\n\n Object.defineProperty(operation, 'setContext', {\n enumerable: false,\n value: setContext,\n });\n\n Object.defineProperty(operation, 'getContext', {\n enumerable: false,\n value: getContext,\n });\n\n return operation as Operation;\n}\n"]}
1
+ {"version":3,"file":"createOperation.js","sourceRoot":"","sources":["../../../src/link/utils/createOperation.ts"],"names":[],"mappings":";AAEA,MAAM,UAAU,eAAe,CAC7B,QAAa,EACb,SAAyB;IAEzB,IAAI,OAAO,gBAAQ,QAAQ,CAAE,CAAC;IAC9B,IAAM,UAAU,GAAG,UAAC,IAAS;QAC3B,IAAI,OAAO,IAAI,KAAK,UAAU,EAAE;YAC9B,OAAO,yBAAQ,OAAO,GAAK,IAAI,CAAC,OAAO,CAAC,CAAE,CAAC;SAC5C;aAAM;YACL,OAAO,yBAAQ,OAAO,GAAK,IAAI,CAAE,CAAC;SACnC;IACH,CAAC,CAAC;IACF,IAAM,UAAU,GAAG,cAAM,OAAA,cAAM,OAAO,EAAG,EAAhB,CAAgB,CAAC;IAE1C,MAAM,CAAC,cAAc,CAAC,SAAS,EAAE,YAAY,EAAE;QAC7C,UAAU,EAAE,KAAK;QACjB,KAAK,EAAE,UAAU;KAClB,CAAC,CAAC;IAEH,MAAM,CAAC,cAAc,CAAC,SAAS,EAAE,YAAY,EAAE;QAC7C,UAAU,EAAE,KAAK;QACjB,KAAK,EAAE,UAAU;KAClB,CAAC,CAAC;IAEH,OAAO,SAAsB,CAAC;AAChC,CAAC","sourcesContent":["import type { GraphQLRequest, Operation } from '../core/index.js';\n\nexport function createOperation(\n starting: any,\n operation: GraphQLRequest,\n): Operation {\n let context = { ...starting };\n const setContext = (next: any) => {\n if (typeof next === 'function') {\n context = { ...context, ...next(context) };\n } else {\n context = { ...context, ...next };\n }\n };\n const getContext = () => ({ ...context });\n\n Object.defineProperty(operation, 'setContext', {\n enumerable: false,\n value: setContext,\n });\n\n Object.defineProperty(operation, 'getContext', {\n enumerable: false,\n value: getContext,\n });\n\n return operation as Operation;\n}\n"]}
@@ -1,3 +1,3 @@
1
- import { Observable } from '../../utilities';
1
+ import { Observable } from '../../utilities/index.js';
2
2
  export declare function fromError<T>(errorValue: any): Observable<T>;
3
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,0BAA0B,CAAC;AAEtD,wBAAgB,SAAS,CAAC,CAAC,EAAE,UAAU,EAAE,GAAG,GAAG,UAAU,CAAC,CAAC,CAAC,CAI3D"}
@@ -1,4 +1,4 @@
1
- import { Observable } from "../../utilities/index.js";
1
+ import { Observable } from '../../utilities/index.js';
2
2
  export function fromError(errorValue) {
3
3
  return new Observable(function (observer) {
4
4
  observer.error(errorValue);
@@ -1 +1 @@
1
- {"version":3,"file":"fromError.js","sourceRoot":"","sources":["../../../src/link/utils/fromError.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAE7C,MAAM,UAAU,SAAS,CAAI,UAAe;IAC1C,OAAO,IAAI,UAAU,CAAI,UAAA,QAAQ;QAC/B,QAAQ,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;IAC7B,CAAC,CAAC,CAAC;AACL,CAAC","sourcesContent":["import { Observable } from '../../utilities';\n\nexport function fromError<T>(errorValue: any): Observable<T> {\n return new Observable<T>(observer => {\n observer.error(errorValue);\n });\n}\n"]}
1
+ {"version":3,"file":"fromError.js","sourceRoot":"","sources":["../../../src/link/utils/fromError.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAEtD,MAAM,UAAU,SAAS,CAAI,UAAe;IAC1C,OAAO,IAAI,UAAU,CAAI,UAAA,QAAQ;QAC/B,QAAQ,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;IAC7B,CAAC,CAAC,CAAC;AACL,CAAC","sourcesContent":["import { Observable } from '../../utilities/index.js';\n\nexport function fromError<T>(errorValue: any): Observable<T> {\n return new Observable<T>(observer => {\n observer.error(errorValue);\n });\n}\n"]}
@@ -1,3 +1,3 @@
1
- import { Observable } from '../../utilities';
1
+ import { Observable } from '../../utilities/index.js';
2
2
  export declare function fromPromise<T>(promise: Promise<T>): Observable<T>;
3
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,0BAA0B,CAAC;AAEtD,wBAAgB,WAAW,CAAC,CAAC,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,GAAG,UAAU,CAAC,CAAC,CAAC,CASjE"}
@@ -1,4 +1,4 @@
1
- import { Observable } from "../../utilities/index.js";
1
+ import { Observable } from '../../utilities/index.js';
2
2
  export function fromPromise(promise) {
3
3
  return new Observable(function (observer) {
4
4
  promise
@@ -1 +1 @@
1
- {"version":3,"file":"fromPromise.js","sourceRoot":"","sources":["../../../src/link/utils/fromPromise.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAE7C,MAAM,UAAU,WAAW,CAAI,OAAmB;IAChD,OAAO,IAAI,UAAU,CAAI,UAAA,QAAQ;QAC/B,OAAO;aACJ,IAAI,CAAC,UAAC,KAAQ;YACb,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;YACrB,QAAQ,CAAC,QAAQ,EAAE,CAAC;QACtB,CAAC,CAAC;aACD,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC;IAC1C,CAAC,CAAC,CAAC;AACL,CAAC","sourcesContent":["import { Observable } from '../../utilities';\n\nexport function fromPromise<T>(promise: Promise<T>): Observable<T> {\n return new Observable<T>(observer => {\n promise\n .then((value: T) => {\n observer.next(value);\n observer.complete();\n })\n .catch(observer.error.bind(observer));\n });\n}\n"]}
1
+ {"version":3,"file":"fromPromise.js","sourceRoot":"","sources":["../../../src/link/utils/fromPromise.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAEtD,MAAM,UAAU,WAAW,CAAI,OAAmB;IAChD,OAAO,IAAI,UAAU,CAAI,UAAA,QAAQ;QAC/B,OAAO;aACJ,IAAI,CAAC,UAAC,KAAQ;YACb,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;YACrB,QAAQ,CAAC,QAAQ,EAAE,CAAC;QACtB,CAAC,CAAC;aACD,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC;IAC1C,CAAC,CAAC,CAAC;AACL,CAAC","sourcesContent":["import { Observable } from '../../utilities/index.js';\n\nexport function fromPromise<T>(promise: Promise<T>): Observable<T> {\n return new Observable<T>(observer => {\n promise\n .then((value: T) => {\n observer.next(value);\n observer.complete();\n })\n .catch(observer.error.bind(observer));\n });\n}\n"]}
@@ -1,10 +1,10 @@
1
- import '../../utilities/globals';
2
- export { fromError } from './fromError';
3
- export { toPromise } from './toPromise';
4
- export { fromPromise } from './fromPromise';
5
- export { ServerError, throwServerError } from './throwServerError';
6
- export { validateOperation } from './validateOperation';
7
- export { createOperation } from './createOperation';
8
- export { transformOperation } from './transformOperation';
9
- export { filterOperationVariables } from './filterOperationVariables';
1
+ import '../../utilities/globals/index.js';
2
+ export { fromError } from './fromError.js';
3
+ export { toPromise } from './toPromise.js';
4
+ export { fromPromise } from './fromPromise.js';
5
+ export { ServerError, throwServerError } from './throwServerError.js';
6
+ export { validateOperation } from './validateOperation.js';
7
+ export { createOperation } from './createOperation.js';
8
+ export { transformOperation } from './transformOperation.js';
9
+ export { filterOperationVariables } from './filterOperationVariables.js';
10
10
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/link/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,yBAAyB,CAAC;AAEjC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACnE,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/link/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,kCAAkC,CAAC;AAE1C,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACtE,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC"}
@@ -1,10 +1,10 @@
1
- import "../../utilities/globals/index.js";
2
- export { fromError } from "./fromError.js";
3
- export { toPromise } from "./toPromise.js";
4
- export { fromPromise } from "./fromPromise.js";
5
- export { throwServerError } from "./throwServerError.js";
6
- export { validateOperation } from "./validateOperation.js";
7
- export { createOperation } from "./createOperation.js";
8
- export { transformOperation } from "./transformOperation.js";
9
- export { filterOperationVariables } from "./filterOperationVariables.js";
1
+ import '../../utilities/globals/index.js';
2
+ export { fromError } from './fromError.js';
3
+ export { toPromise } from './toPromise.js';
4
+ export { fromPromise } from './fromPromise.js';
5
+ export { throwServerError } from './throwServerError.js';
6
+ export { validateOperation } from './validateOperation.js';
7
+ export { createOperation } from './createOperation.js';
8
+ export { transformOperation } from './transformOperation.js';
9
+ export { filterOperationVariables } from './filterOperationVariables.js';
10
10
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/link/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,yBAAyB,CAAC;AAEjC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAe,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACnE,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC","sourcesContent":["import '../../utilities/globals';\n\nexport { fromError } from './fromError';\nexport { toPromise } from './toPromise';\nexport { fromPromise } from './fromPromise';\nexport { ServerError, throwServerError } from './throwServerError';\nexport { validateOperation } from './validateOperation';\nexport { createOperation } from './createOperation';\nexport { transformOperation } from './transformOperation';\nexport { filterOperationVariables } from './filterOperationVariables';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/link/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,kCAAkC,CAAC;AAE1C,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAe,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACtE,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC","sourcesContent":["import '../../utilities/globals/index.js';\n\nexport { fromError } from './fromError.js';\nexport { toPromise } from './toPromise.js';\nexport { fromPromise } from './fromPromise.js';\nexport { ServerError, throwServerError } from './throwServerError.js';\nexport { validateOperation } from './validateOperation.js';\nexport { createOperation } from './createOperation.js';\nexport { transformOperation } from './transformOperation.js';\nexport { filterOperationVariables } from './filterOperationVariables.js';\n"]}
@@ -1,3 +1,3 @@
1
- import type { Observable } from '../../utilities';
1
+ import type { Observable } from '../../utilities/index.js';
2
2
  export declare function toPromise<R>(observable: Observable<R>): Promise<R>;
3
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,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAElD,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,KAAK,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAE3D,wBAAgB,SAAS,CAAC,CAAC,EAAE,UAAU,EAAE,UAAU,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAiBlE"}
@@ -1,11 +1,11 @@
1
- import { invariant, __DEV__ } from "../../utilities/globals/index.js";
1
+ import { invariant } from '../../utilities/globals/index.js';
2
2
  export function toPromise(observable) {
3
3
  var completed = false;
4
4
  return new Promise(function (resolve, reject) {
5
5
  observable.subscribe({
6
6
  next: function (data) {
7
7
  if (completed) {
8
- __DEV__ && invariant.warn(40);
8
+ globalThis.__DEV__ !== false && invariant.warn(40);
9
9
  }
10
10
  else {
11
11
  completed = true;
@@ -1 +1 @@
1
- {"version":3,"file":"toPromise.js","sourceRoot":"","sources":["../../../src/link/utils/toPromise.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAGpD,MAAM,UAAU,SAAS,CAAI,UAAyB;IACpD,IAAI,SAAS,GAAG,KAAK,CAAC;IACtB,OAAO,IAAI,OAAO,CAAI,UAAC,OAAO,EAAE,MAAM;QACpC,UAAU,CAAC,SAAS,CAAC;YACnB,IAAI,EAAE,UAAA,IAAI;gBACR,IAAI,SAAS,EAAE;oBACb,SAAS,CAAC,IAAI,CACZ,mEAAmE,CACpE,CAAC;iBACH;qBAAM;oBACL,SAAS,GAAG,IAAI,CAAC;oBACjB,OAAO,CAAC,IAAI,CAAC,CAAC;iBACf;YACH,CAAC;YACD,KAAK,EAAE,MAAM;SACd,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC","sourcesContent":["import { invariant } from '../../utilities/globals';\nimport type { Observable } from '../../utilities';\n\nexport function toPromise<R>(observable: Observable<R>): Promise<R> {\n let completed = false;\n return new Promise<R>((resolve, reject) => {\n observable.subscribe({\n next: data => {\n if (completed) {\n invariant.warn(\n `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"]}
1
+ {"version":3,"file":"toPromise.js","sourceRoot":"","sources":["../../../src/link/utils/toPromise.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,kCAAkC,CAAC;AAG7D,MAAM,UAAU,SAAS,CAAI,UAAyB;IACpD,IAAI,SAAS,GAAG,KAAK,CAAC;IACtB,OAAO,IAAI,OAAO,CAAI,UAAC,OAAO,EAAE,MAAM;QACpC,UAAU,CAAC,SAAS,CAAC;YACnB,IAAI,EAAE,UAAA,IAAI;gBACR,IAAI,SAAS,EAAE;oBACb,SAAS,CAAC,IAAI,CACZ,mEAAmE,CACpE,CAAC;iBACH;qBAAM;oBACL,SAAS,GAAG,IAAI,CAAC;oBACjB,OAAO,CAAC,IAAI,CAAC,CAAC;iBACf;YACH,CAAC;YACD,KAAK,EAAE,MAAM;SACd,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC","sourcesContent":["import { invariant } from '../../utilities/globals/index.js';\nimport type { Observable } from '../../utilities/index.js';\n\nexport function toPromise<R>(observable: Observable<R>): Promise<R> {\n let completed = false;\n return new Promise<R>((resolve, reject) => {\n observable.subscribe({\n next: data => {\n if (completed) {\n invariant.warn(\n `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"]}
@@ -1,3 +1,3 @@
1
- import type { GraphQLRequest } from '../core';
1
+ import type { GraphQLRequest } from '../core/index.js';
2
2
  export declare function transformOperation(operation: GraphQLRequest): GraphQLRequest;
3
3
  //# sourceMappingURL=transformOperation.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"transformOperation.d.ts","sourceRoot":"","sources":["../../../src/link/utils/transformOperation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAa,MAAM,SAAS,CAAC;AAGzD,wBAAgB,kBAAkB,CAAC,SAAS,EAAE,cAAc,GAAG,cAAc,CAiB5E"}
1
+ {"version":3,"file":"transformOperation.d.ts","sourceRoot":"","sources":["../../../src/link/utils/transformOperation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAa,MAAM,kBAAkB,CAAC;AAGlE,wBAAgB,kBAAkB,CAAC,SAAS,EAAE,cAAc,GAAG,cAAc,CAiB5E"}
@@ -1,4 +1,4 @@
1
- import { getOperationName } from "../../utilities/index.js";
1
+ import { getOperationName } from '../../utilities/index.js';
2
2
  export function transformOperation(operation) {
3
3
  var transformedOperation = {
4
4
  variables: operation.variables || {},
@@ -1 +1 @@
1
- {"version":3,"file":"transformOperation.js","sourceRoot":"","sources":["../../../src/link/utils/transformOperation.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAEnD,MAAM,UAAU,kBAAkB,CAAC,SAAyB;IAC1D,IAAM,oBAAoB,GAAmB;QAC3C,SAAS,EAAE,SAAS,CAAC,SAAS,IAAI,EAAE;QACpC,UAAU,EAAE,SAAS,CAAC,UAAU,IAAI,EAAE;QACtC,aAAa,EAAE,SAAS,CAAC,aAAa;QACtC,KAAK,EAAE,SAAS,CAAC,KAAK;KACvB,CAAC;IAGF,IAAI,CAAC,oBAAoB,CAAC,aAAa,EAAE;QACvC,oBAAoB,CAAC,aAAa;YAChC,OAAO,oBAAoB,CAAC,KAAK,KAAK,QAAQ;gBAC5C,CAAC,CAAC,gBAAgB,CAAC,oBAAoB,CAAC,KAAK,CAAC,IAAI,SAAS;gBAC3D,CAAC,CAAC,EAAE,CAAC;KACV;IAED,OAAO,oBAAiC,CAAC;AAC3C,CAAC","sourcesContent":["import type { GraphQLRequest, Operation } from '../core';\nimport { getOperationName } from '../../utilities';\n\nexport function transformOperation(operation: GraphQLRequest): GraphQLRequest {\n const transformedOperation: GraphQLRequest = {\n variables: operation.variables || {},\n extensions: operation.extensions || {},\n operationName: operation.operationName,\n query: operation.query,\n };\n\n // Best guess at an operation name\n if (!transformedOperation.operationName) {\n transformedOperation.operationName =\n typeof transformedOperation.query !== 'string'\n ? getOperationName(transformedOperation.query) || undefined\n : '';\n }\n\n return transformedOperation as Operation;\n}\n"]}
1
+ {"version":3,"file":"transformOperation.js","sourceRoot":"","sources":["../../../src/link/utils/transformOperation.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAE5D,MAAM,UAAU,kBAAkB,CAAC,SAAyB;IAC1D,IAAM,oBAAoB,GAAmB;QAC3C,SAAS,EAAE,SAAS,CAAC,SAAS,IAAI,EAAE;QACpC,UAAU,EAAE,SAAS,CAAC,UAAU,IAAI,EAAE;QACtC,aAAa,EAAE,SAAS,CAAC,aAAa;QACtC,KAAK,EAAE,SAAS,CAAC,KAAK;KACvB,CAAC;IAGF,IAAI,CAAC,oBAAoB,CAAC,aAAa,EAAE;QACvC,oBAAoB,CAAC,aAAa;YAChC,OAAO,oBAAoB,CAAC,KAAK,KAAK,QAAQ;gBAC5C,CAAC,CAAC,gBAAgB,CAAC,oBAAoB,CAAC,KAAK,CAAC,IAAI,SAAS;gBAC3D,CAAC,CAAC,EAAE,CAAC;KACV;IAED,OAAO,oBAAiC,CAAC;AAC3C,CAAC","sourcesContent":["import type { GraphQLRequest, Operation } from '../core/index.js';\nimport { getOperationName } from '../../utilities/index.js';\n\nexport function transformOperation(operation: GraphQLRequest): GraphQLRequest {\n const transformedOperation: GraphQLRequest = {\n variables: operation.variables || {},\n extensions: operation.extensions || {},\n operationName: operation.operationName,\n query: operation.query,\n };\n\n // Best guess at an operation name\n if (!transformedOperation.operationName) {\n transformedOperation.operationName =\n typeof transformedOperation.query !== 'string'\n ? getOperationName(transformedOperation.query) || undefined\n : '';\n }\n\n return transformedOperation as Operation;\n}\n"]}
@@ -19,7 +19,7 @@ function toPromise(observable) {
19
19
  observable.subscribe({
20
20
  next: function (data) {
21
21
  if (completed) {
22
- globals.__DEV__ && globals.invariant.warn(40);
22
+ globalThis.__DEV__ !== false && globals.invariant.warn(40);
23
23
  }
24
24
  else {
25
25
  completed = true;
@@ -1 +1 @@
1
- {"version":3,"file":"utils.cjs","sources":["fromError.js","toPromise.js","fromPromise.js","throwServerError.js","validateOperation.js","createOperation.js","transformOperation.js","filterOperationVariables.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, __DEV__ } 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(40);\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 { newInvariantError } 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 newInvariantError(41, key);\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//# sourceMappingURL=transformOperation.js.map","import { __assign } from \"tslib\";\nimport { visit } from 'graphql';\nexport function filterOperationVariables(variables, query) {\n var result = __assign({}, variables);\n var unusedNames = new Set(Object.keys(variables));\n visit(query, {\n Variable: function (node, _key, parent) {\n if (parent &&\n parent.kind !== 'VariableDefinition') {\n unusedNames.delete(node.name.value);\n }\n },\n });\n unusedNames.forEach(function (name) {\n delete result[name];\n });\n return result;\n}\n//# sourceMappingURL=filterOperationVariables.js.map"],"names":["Observable","__DEV__","invariant","newInvariantError","__assign","getOperationName","visit"],"mappings":";;;;;;;;;AACO,SAAS,SAAS,CAAC,UAAU,EAAE;AACtC,IAAI,OAAO,IAAIA,oBAAU,CAAC,UAAU,QAAQ,EAAE;AAC9C,QAAQ,QAAQ,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;AACnC,KAAK,CAAC,CAAC;AACP;;ACJO,SAAS,SAAS,CAAC,UAAU,EAAE;AACtC,IAAI,IAAI,SAAS,GAAG,KAAK,CAAC;AAC1B,IAAI,OAAO,IAAI,OAAO,CAAC,UAAU,OAAO,EAAE,MAAM,EAAE;AAClD,QAAQ,UAAU,CAAC,SAAS,CAAC;AAC7B,YAAY,IAAI,EAAE,UAAU,IAAI,EAAE;AAClC,gBAAgB,IAAI,SAAS,EAAE;AAC/B,oBAAoBC,eAAO,IAAIC,iBAAS,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AAClD,iBAAiB;AACjB,qBAAqB;AACrB,oBAAoB,SAAS,GAAG,IAAI,CAAC;AACrC,oBAAoB,OAAO,CAAC,IAAI,CAAC,CAAC;AAClC,iBAAiB;AACjB,aAAa;AACb,YAAY,KAAK,EAAE,MAAM;AACzB,SAAS,CAAC,CAAC;AACX,KAAK,CAAC,CAAC;AACP;;AChBO,SAAS,WAAW,CAAC,OAAO,EAAE;AACrC,IAAI,OAAO,IAAIF,oBAAU,CAAC,UAAU,QAAQ,EAAE;AAC9C,QAAQ,OAAO;AACf,aAAa,IAAI,CAAC,UAAU,KAAK,EAAE;AACnC,YAAY,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AACjC,YAAY,QAAQ,CAAC,QAAQ,EAAE,CAAC;AAChC,SAAS,CAAC;AACV,aAAa,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,QA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AS;AAC3E,kBAAkB,EAAE,CAAC;AACrB,KAAK;AACL,IAAI,OAAO,oBAAoB,CAAC;AAChC;;ACbO,SAAS,wBAAwB,CAAC,SAAS,EAAE,KAAK,EAAE;AAC3D,IAAI,IAAI,MAAM,GAAGD,cAAQ,CAAC,EAAE,EAAE,SAAS,CAAC,CAAC;AACzC,IAAI,IAAI,WAAW,GAAG,IAAI,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC;AACtD,IAAIE,aAAK,CAAC,KAAK,EAAE;AACjB,QAAQ,QAAQ,EAAE,UAAU,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE;AAChD,YAAY,IAAI,MAAM;AACtB,gBAAgB,MAAM,CAAC,IAAI,KAAK,oBAAoB,EAAE;AACtD,gBAAgB,WAAW,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AACpD,aAAa;AACb,SAAS;AACT,KAAK,CAAC,CAAC;AACP,IAAI,WAAW,CAAC,OAAO,CAAC,UAAU,IAAI,EAAE;AACxC,QAAQ,OAAO,MAAM,CAAC,IAAI,CAAC,CAAC;AAC5B,KAAK,CAAC,CAAC;AACP,IAAI,OAAO,MAAM,CAAC;AAClB;;;;;;;;;;;"}
1
+ {"version":3,"file":"utils.cjs","sources":["fromError.js","toPromise.js","fromPromise.js","throwServerError.js","validateOperation.js","createOperation.js","transformOperation.js","filterOperationVariables.js"],"sourcesContent":["import { Observable } from '../../utilities/index.js';\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/index.js';\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 globalThis.__DEV__ !== false && invariant.warn(40);\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/index.js';\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 { newInvariantError } from '../../utilities/globals/index.js';\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 newInvariantError(41, key);\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/index.js';\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//# sourceMappingURL=transformOperation.js.map","import { __assign } from \"tslib\";\nimport { visit } from 'graphql';\nexport function filterOperationVariables(variables, query) {\n var result = __assign({}, variables);\n var unusedNames = new Set(Object.keys(variables));\n visit(query, {\n Variable: function (node, _key, parent) {\n if (parent &&\n parent.kind !== 'VariableDefinition') {\n unusedNames.delete(node.name.value);\n }\n },\n });\n unusedNames.forEach(function (name) {\n delete result[name];\n });\n return result;\n}\n//# sourceMappingURL=filterOperationVariables.js.map"],"names":["Observable","invariant","newInvariantError","__assign","getOperationName","visit"],"mappings":";;;;;;;;;AACO,SAAS,SAAS,CAAC,UAAU,EAAE;AACtC,IAAI,OAAO,IAAIA,oBAAU,CAAC,UAAU,QAAQ,EAAE;AAC9C,QAAQ,QAAQ,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;AACnC,KAAK,CAAC,CAAC;AACP;;ACJO,SAAS,SAAS,CAAC,UAAU,EAAE;AACtC,IAAI,IAAI,SAAS,GAAG,KAAK,CAAC;AAC1B,IAAI,OAAO,IAAI,OAAO,CAAC,UAAU,OAAO,EAAE,MAAM,EAAE;AAClD,QAAQ,UAAU,CAAC,SAAS,CAAC;AAC7B,YAAY,IAAI,EAAE,UAAU,IAAI,EAAE;AAClC,gBAAgB,IAAI,SAAS,EAAE;AAC/B,oBAAoB,UAAU,CAAC,OAAO,KAAK,KAAK,IAAIC,iBAAS,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AACvE,iBAAiB;AACjB,qBAAqB;AACrB,oBAAoB,SAAS,GAAG,IAAI,CAAC;AACrC,oBAAoB,OAAO,CAAC,IAAI,CAAC,CAAC;AAClC,iBAAiB;AACjB,aAAa;AACb,YAAY,KAAK,EAAE,MAAM;AACzB,SAAS,CAAC,CAAC;AACX,KAAK,CAAC,CAAC;AACP;;AChBO,SAAS,WAAW,CAAC,OAAO,EAAE;AACrC,IAAI,OAAO,IAAID,oBAAU,CAAC,UAAU,QAAQ,EAAE;AAC9C,QAAQ,OAAO;AACf,aAAa,IAAI,CAAC,UAAU,KAAK,EAAE;AACnC,YAAY,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AACjC,YAAY,QAAQ,CAAC,QAAQ,EAAE,CAAC;AAChC,SAAS,CAAC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1D,kBAAkBC,0BAAgB,CAAC,oBAAoB,CAAC,KAAK,CAAC,IAAI,SAAS;AAC3E,kBAAkB,EAAE,CAAC;AACrB,KAAK;AACL,IAAI,OAAO,oBAAoB,CAAC;AAChC;;ACbO,SAAS,wBAAwB,CAAC,SAAS,EAAE,KAAK,EAAE;AAC3D,IAAI,IAAI,MAAM,GAAGD,cAAQ,CAAC,EAAE,EAAE,SAAS,CAAC,CAAC;AACzC,IAAI,IAAI,WAAW,GAAG,IAAI,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC;AACtD,IAAIE,aAAK,CAAC,KAAK,EAAE;AACjB,QAAQ,QAAQ,EAAE,UAAU,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE;AAChD,YAAY,IAAI,MAAM;AACtB,gBAAgB,MAAM,CAAC,IAAI,KAAK,oBAAoB,EAAE;AACtD,gBAAgB,WAAW,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AACpD,aAAa;AACb,SAAS;AACT,KAAK,CAAC,CAAC;AACP,IAAI,WAAW,CAAC,OAAO,CAAC,UAAU,IAAI,EAAE;AACxC,QAAQ,OAAO,MAAM,CAAC,IAAI,CAAC,CAAC;AAC5B,KAAK,CAAC,CAAC;AACP,IAAI,OAAO,MAAM,CAAC;AAClB;;;;;;;;;;;"}
@@ -19,7 +19,7 @@ function toPromise(observable) {
19
19
  observable.subscribe({
20
20
  next: function (data) {
21
21
  if (completed) {
22
- globals.__DEV__ && globals.invariant.warn(40);
22
+ globalThis.__DEV__ !== false && globals.invariant.warn(40);
23
23
  }
24
24
  else {
25
25
  completed = true;
@@ -1,3 +1,3 @@
1
- import type { GraphQLRequest } from '../core';
1
+ import type { GraphQLRequest } from '../core/index.js';
2
2
  export declare function validateOperation(operation: GraphQLRequest): GraphQLRequest;
3
3
  //# sourceMappingURL=validateOperation.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"validateOperation.d.ts","sourceRoot":"","sources":["../../../src/link/utils/validateOperation.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAE9C,wBAAgB,iBAAiB,CAAC,SAAS,EAAE,cAAc,GAAG,cAAc,CAe3E"}
1
+ {"version":3,"file":"validateOperation.d.ts","sourceRoot":"","sources":["../../../src/link/utils/validateOperation.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAEvD,wBAAgB,iBAAiB,CAAC,SAAS,EAAE,cAAc,GAAG,cAAc,CAe3E"}
@@ -1,4 +1,4 @@
1
- import { newInvariantError } from "../../utilities/globals/index.js";
1
+ import { newInvariantError } from '../../utilities/globals/index.js';
2
2
  export function validateOperation(operation) {
3
3
  var OPERATION_FIELDS = [
4
4
  'query',
@@ -1 +1 @@
1
- {"version":3,"file":"validateOperation.js","sourceRoot":"","sources":["../../../src/link/utils/validateOperation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAA;AAG3D,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,iBAAiB,CAAC,sBAAsB,EAAE,GAAG,CAAC,CAAC;SACtD;KACF;IAED,OAAO,SAAS,CAAC;AACnB,CAAC","sourcesContent":["import { newInvariantError } from '../../utilities/globals'\nimport type { 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 newInvariantError(`illegal argument: %s`, 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,iBAAiB,EAAE,MAAM,kCAAkC,CAAA;AAGpE,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,iBAAiB,CAAC,sBAAsB,EAAE,GAAG,CAAC,CAAC;SACtD;KACF;IAED,OAAO,SAAS,CAAC;AACnB,CAAC","sourcesContent":["import { newInvariantError } from '../../utilities/globals/index.js'\nimport type { GraphQLRequest } from '../core/index.js';\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 newInvariantError(`illegal argument: %s`, key);\n }\n }\n\n return operation;\n}\n"]}
@@ -1,8 +1,8 @@
1
1
  import type { ClientOptions } from 'subscriptions-transport-ws';
2
2
  import { SubscriptionClient } from 'subscriptions-transport-ws';
3
- import type { Operation, FetchResult } from '../core';
4
- import { ApolloLink } from '../core';
5
- import type { Observable } from '../../utilities';
3
+ import type { Operation, FetchResult } from '../core/index.js';
4
+ import { ApolloLink } from '../core/index.js';
5
+ import type { Observable } from '../../utilities/index.js';
6
6
  export declare namespace WebSocketLink {
7
7
  interface Configuration {
8
8
  uri: string;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/link/ws/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAEhE,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AACtD,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAElD,yBAAiB,aAAa,CAAC;IAI7B,UAAiB,aAAa;QAI5B,GAAG,EAAE,MAAM,CAAC;QAKZ,OAAO,CAAC,EAAE,aAAa,CAAC;QAKxB,aAAa,CAAC,EAAE,GAAG,CAAC;KACrB;CACF;AAGD,MAAM,QAAQ,eAAe,GAAG,aAAa,CAAC,aAAa,CAAC;AAE5D,qBAAa,aAAc,SAAQ,UAAU;IAC3C,OAAO,CAAC,kBAAkB,CAAqB;gBAG7C,cAAc,EAAE,aAAa,CAAC,aAAa,GAAG,kBAAkB;IAe3D,OAAO,CAAC,SAAS,EAAE,SAAS,GAAG,UAAU,CAAC,WAAW,CAAC,GAAG,IAAI;CAKrE"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/link/ws/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAEhE,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/D,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAE3D,yBAAiB,aAAa,CAAC;IAI7B,UAAiB,aAAa;QAI5B,GAAG,EAAE,MAAM,CAAC;QAKZ,OAAO,CAAC,EAAE,aAAa,CAAC;QAKxB,aAAa,CAAC,EAAE,GAAG,CAAC;KACrB;CACF;AAGD,MAAM,QAAQ,eAAe,GAAG,aAAa,CAAC,aAAa,CAAC;AAE5D,qBAAa,aAAc,SAAQ,UAAU;IAC3C,OAAO,CAAC,kBAAkB,CAAqB;gBAG7C,cAAc,EAAE,aAAa,CAAC,aAAa,GAAG,kBAAkB;IAe3D,OAAO,CAAC,SAAS,EAAE,SAAS,GAAG,UAAU,CAAC,WAAW,CAAC,GAAG,IAAI;CAKrE"}
package/link/ws/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { __extends } from "tslib";
2
2
  import { SubscriptionClient } from 'subscriptions-transport-ws';
3
- import { ApolloLink } from "../core/index.js";
3
+ import { ApolloLink } from '../core/index.js';
4
4
  var WebSocketLink = (function (_super) {
5
5
  __extends(WebSocketLink, _super);
6
6
  function WebSocketLink(paramsOrClient) {
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/link/ws/index.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAGhE,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AA4BrC;IAAmC,iCAAU;IAG3C,uBACE,cAAgE;QADlE,YAGE,iBAAO,SAWR;QATC,IAAI,cAAc,YAAY,kBAAkB,EAAE;YAChD,KAAI,CAAC,kBAAkB,GAAG,cAAc,CAAC;SAC1C;aAAM;YACL,KAAI,CAAC,kBAAkB,GAAG,IAAI,kBAAkB,CAC9C,cAAc,CAAC,GAAG,EAClB,cAAc,CAAC,OAAO,EACtB,cAAc,CAAC,aAAa,CAC7B,CAAC;SACH;;IACH,CAAC;IAEM,+BAAO,GAAd,UAAe,SAAoB;QACjC,OAAO,IAAI,CAAC,kBAAkB,CAAC,OAAO,CAAC,SAAS,CAE/C,CAAC;IACJ,CAAC;IACH,oBAAC;AAAD,CAAC,AAxBD,CAAmC,UAAU,GAwB5C","sourcesContent":["import type { ClientOptions } from 'subscriptions-transport-ws';\nimport { SubscriptionClient } from 'subscriptions-transport-ws';\n\nimport type { Operation, FetchResult } from '../core';\nimport { ApolloLink } from '../core';\nimport type { Observable } from '../../utilities';\n\nexport namespace WebSocketLink {\n /**\n * Configuration to use when constructing the subscription client (subscriptions-transport-ws).\n */\n export interface Configuration {\n /**\n * The endpoint to connect to.\n */\n uri: string;\n\n /**\n * Options to pass when constructing the subscription client.\n */\n options?: ClientOptions;\n\n /**\n * A custom WebSocket implementation to use.\n */\n webSocketImpl?: any;\n }\n}\n\n// For backwards compatibility.\nexport import WebSocketParams = WebSocketLink.Configuration;\n\nexport class WebSocketLink extends ApolloLink {\n private subscriptionClient: SubscriptionClient;\n\n constructor(\n paramsOrClient: WebSocketLink.Configuration | SubscriptionClient,\n ) {\n super();\n\n if (paramsOrClient instanceof SubscriptionClient) {\n this.subscriptionClient = paramsOrClient;\n } else {\n this.subscriptionClient = new SubscriptionClient(\n paramsOrClient.uri,\n paramsOrClient.options,\n paramsOrClient.webSocketImpl,\n );\n }\n }\n\n public request(operation: Operation): Observable<FetchResult> | null {\n return this.subscriptionClient.request(operation) as Observable<\n FetchResult\n >;\n }\n}\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/link/ws/index.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAGhE,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AA4B9C;IAAmC,iCAAU;IAG3C,uBACE,cAAgE;QADlE,YAGE,iBAAO,SAWR;QATC,IAAI,cAAc,YAAY,kBAAkB,EAAE;YAChD,KAAI,CAAC,kBAAkB,GAAG,cAAc,CAAC;SAC1C;aAAM;YACL,KAAI,CAAC,kBAAkB,GAAG,IAAI,kBAAkB,CAC9C,cAAc,CAAC,GAAG,EAClB,cAAc,CAAC,OAAO,EACtB,cAAc,CAAC,aAAa,CAC7B,CAAC;SACH;;IACH,CAAC;IAEM,+BAAO,GAAd,UAAe,SAAoB;QACjC,OAAO,IAAI,CAAC,kBAAkB,CAAC,OAAO,CAAC,SAAS,CAE/C,CAAC;IACJ,CAAC;IACH,oBAAC;AAAD,CAAC,AAxBD,CAAmC,UAAU,GAwB5C","sourcesContent":["import type { ClientOptions } from 'subscriptions-transport-ws';\nimport { SubscriptionClient } from 'subscriptions-transport-ws';\n\nimport type { Operation, FetchResult } from '../core/index.js';\nimport { ApolloLink } from '../core/index.js';\nimport type { Observable } from '../../utilities/index.js';\n\nexport namespace WebSocketLink {\n /**\n * Configuration to use when constructing the subscription client (subscriptions-transport-ws).\n */\n export interface Configuration {\n /**\n * The endpoint to connect to.\n */\n uri: string;\n\n /**\n * Options to pass when constructing the subscription client.\n */\n options?: ClientOptions;\n\n /**\n * A custom WebSocket implementation to use.\n */\n webSocketImpl?: any;\n }\n}\n\n// For backwards compatibility.\nexport import WebSocketParams = WebSocketLink.Configuration;\n\nexport class WebSocketLink extends ApolloLink {\n private subscriptionClient: SubscriptionClient;\n\n constructor(\n paramsOrClient: WebSocketLink.Configuration | SubscriptionClient,\n ) {\n super();\n\n if (paramsOrClient instanceof SubscriptionClient) {\n this.subscriptionClient = paramsOrClient;\n } else {\n this.subscriptionClient = new SubscriptionClient(\n paramsOrClient.uri,\n paramsOrClient.options,\n paramsOrClient.webSocketImpl,\n );\n }\n }\n\n public request(operation: Operation): Observable<FetchResult> | null {\n return this.subscriptionClient.request(operation) as Observable<\n FetchResult\n >;\n }\n}\n"]}
@@ -1 +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;;;;"}
1
+ {"version":3,"file":"ws.cjs","sources":["index.js"],"sourcesContent":["import { __extends } from \"tslib\";\nimport { SubscriptionClient } from 'subscriptions-transport-ws';\nimport { ApolloLink } from '../core/index.js';\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;;;;"}