@apollo/client 3.8.0-alpha.12 → 3.8.0-alpha.14

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 (434) hide show
  1. package/apollo-client.cjs +272 -215
  2. package/apollo-client.cjs.map +1 -1
  3. package/apollo-client.min.cjs +1 -1
  4. package/cache/cache.cjs +1 -1
  5. package/cache/cache.cjs.map +1 -1
  6. package/cache/cache.cjs.native.js +1 -1
  7. package/cache/core/cache.d.ts +4 -4
  8. package/cache/core/cache.d.ts.map +1 -1
  9. package/cache/core/cache.js.map +1 -1
  10. package/cache/core/types/Cache.d.ts +2 -2
  11. package/cache/core/types/Cache.d.ts.map +1 -1
  12. package/cache/core/types/Cache.js.map +1 -1
  13. package/cache/core/types/DataProxy.d.ts +4 -4
  14. package/cache/core/types/DataProxy.d.ts.map +1 -1
  15. package/cache/core/types/DataProxy.js.map +1 -1
  16. package/cache/core/types/common.d.ts +3 -3
  17. package/cache/core/types/common.d.ts.map +1 -1
  18. package/cache/core/types/common.js.map +1 -1
  19. package/cache/inmemory/entityStore.d.ts +5 -5
  20. package/cache/inmemory/entityStore.d.ts.map +1 -1
  21. package/cache/inmemory/entityStore.js.map +1 -1
  22. package/cache/inmemory/fragmentRegistry.d.ts +1 -1
  23. package/cache/inmemory/fragmentRegistry.d.ts.map +1 -1
  24. package/cache/inmemory/fragmentRegistry.js.map +1 -1
  25. package/cache/inmemory/helpers.d.ts +6 -5
  26. package/cache/inmemory/helpers.d.ts.map +1 -1
  27. package/cache/inmemory/helpers.js.map +1 -1
  28. package/cache/inmemory/inMemoryCache.d.ts +5 -5
  29. package/cache/inmemory/inMemoryCache.d.ts.map +1 -1
  30. package/cache/inmemory/inMemoryCache.js.map +1 -1
  31. package/cache/inmemory/key-extractor.d.ts +1 -1
  32. package/cache/inmemory/key-extractor.d.ts.map +1 -1
  33. package/cache/inmemory/key-extractor.js.map +1 -1
  34. package/cache/inmemory/policies.d.ts +7 -6
  35. package/cache/inmemory/policies.d.ts.map +1 -1
  36. package/cache/inmemory/policies.js +1 -1
  37. package/cache/inmemory/policies.js.map +1 -1
  38. package/cache/inmemory/reactiveVars.d.ts +1 -1
  39. package/cache/inmemory/reactiveVars.d.ts.map +1 -1
  40. package/cache/inmemory/reactiveVars.js.map +1 -1
  41. package/cache/inmemory/readFromStore.d.ts +6 -6
  42. package/cache/inmemory/readFromStore.d.ts.map +1 -1
  43. package/cache/inmemory/readFromStore.js +2 -2
  44. package/cache/inmemory/readFromStore.js.map +1 -1
  45. package/cache/inmemory/types.d.ts +6 -6
  46. package/cache/inmemory/types.d.ts.map +1 -1
  47. package/cache/inmemory/types.js.map +1 -1
  48. package/cache/inmemory/writeToStore.d.ts +6 -6
  49. package/cache/inmemory/writeToStore.d.ts.map +1 -1
  50. package/cache/inmemory/writeToStore.js.map +1 -1
  51. package/core/ApolloClient.d.ts +10 -9
  52. package/core/ApolloClient.d.ts.map +1 -1
  53. package/core/ApolloClient.js +1 -1
  54. package/core/ApolloClient.js.map +1 -1
  55. package/core/LocalState.d.ts +6 -6
  56. package/core/LocalState.d.ts.map +1 -1
  57. package/core/LocalState.js +1 -1
  58. package/core/LocalState.js.map +1 -1
  59. package/core/ObservableQuery.d.ts +9 -8
  60. package/core/ObservableQuery.d.ts.map +1 -1
  61. package/core/ObservableQuery.js.map +1 -1
  62. package/core/QueryInfo.d.ts +9 -9
  63. package/core/QueryInfo.d.ts.map +1 -1
  64. package/core/QueryInfo.js.map +1 -1
  65. package/core/QueryManager.d.ts +6 -6
  66. package/core/QueryManager.d.ts.map +1 -1
  67. package/core/QueryManager.js.map +1 -1
  68. package/core/core.cjs +1 -1
  69. package/core/core.cjs.map +1 -1
  70. package/core/core.cjs.native.js +1 -1
  71. package/core/equalByQuery.d.ts +2 -2
  72. package/core/equalByQuery.d.ts.map +1 -1
  73. package/core/equalByQuery.js.map +1 -1
  74. package/core/types.d.ts +11 -11
  75. package/core/types.d.ts.map +1 -1
  76. package/core/types.js.map +1 -1
  77. package/core/watchQueryOptions.d.ts +6 -6
  78. package/core/watchQueryOptions.d.ts.map +1 -1
  79. package/core/watchQueryOptions.js.map +1 -1
  80. package/errors/index.d.ts +4 -4
  81. package/errors/index.d.ts.map +1 -1
  82. package/errors/index.js.map +1 -1
  83. package/invariantErrorCodes.js +41 -29
  84. package/link/batch/batchLink.d.ts +4 -3
  85. package/link/batch/batchLink.d.ts.map +1 -1
  86. package/link/batch/batchLink.js.map +1 -1
  87. package/link/batch/batching.d.ts +1 -1
  88. package/link/batch/batching.d.ts.map +1 -1
  89. package/link/batch/batching.js.map +1 -1
  90. package/link/batch-http/batchHttpLink.d.ts +3 -2
  91. package/link/batch-http/batchHttpLink.d.ts.map +1 -1
  92. package/link/batch-http/batchHttpLink.js.map +1 -1
  93. package/link/context/index.d.ts +3 -2
  94. package/link/context/index.d.ts.map +1 -1
  95. package/link/context/index.js.map +1 -1
  96. package/link/core/ApolloLink.d.ts +3 -2
  97. package/link/core/ApolloLink.d.ts.map +1 -1
  98. package/link/core/ApolloLink.js.map +1 -1
  99. package/link/core/types.d.ts +4 -3
  100. package/link/core/types.d.ts.map +1 -1
  101. package/link/core/types.js.map +1 -1
  102. package/link/error/index.d.ts +4 -3
  103. package/link/error/index.d.ts.map +1 -1
  104. package/link/error/index.js.map +1 -1
  105. package/link/http/HttpLink.d.ts +3 -2
  106. package/link/http/HttpLink.d.ts.map +1 -1
  107. package/link/http/HttpLink.js.map +1 -1
  108. package/link/http/createHttpLink.d.ts +1 -1
  109. package/link/http/createHttpLink.d.ts.map +1 -1
  110. package/link/http/createHttpLink.js.map +1 -1
  111. package/link/http/http.cjs +1 -1
  112. package/link/http/http.cjs.map +1 -1
  113. package/link/http/http.cjs.native.js +1 -1
  114. package/link/http/iterators/nodeStream.d.ts +1 -1
  115. package/link/http/iterators/nodeStream.d.ts.map +1 -1
  116. package/link/http/iterators/nodeStream.js.map +1 -1
  117. package/link/http/parseAndCheckHttpResponse.d.ts +2 -2
  118. package/link/http/parseAndCheckHttpResponse.d.ts.map +1 -1
  119. package/link/http/parseAndCheckHttpResponse.js.map +1 -1
  120. package/link/http/responseIterator.d.ts +1 -1
  121. package/link/http/responseIterator.d.ts.map +1 -1
  122. package/link/http/responseIterator.js.map +1 -1
  123. package/link/http/rewriteURIForGET.d.ts +1 -1
  124. package/link/http/rewriteURIForGET.d.ts.map +1 -1
  125. package/link/http/rewriteURIForGET.js.map +1 -1
  126. package/link/http/selectHttpOptionsAndBody.d.ts +3 -2
  127. package/link/http/selectHttpOptionsAndBody.d.ts.map +1 -1
  128. package/link/http/selectHttpOptionsAndBody.js +1 -2
  129. package/link/http/selectHttpOptionsAndBody.js.map +1 -1
  130. package/link/http/selectURI.d.ts +1 -1
  131. package/link/http/selectURI.d.ts.map +1 -1
  132. package/link/http/selectURI.js.map +1 -1
  133. package/link/persisted-queries/index.d.ts +4 -3
  134. package/link/persisted-queries/index.d.ts.map +1 -1
  135. package/link/persisted-queries/index.js +12 -13
  136. package/link/persisted-queries/index.js.map +1 -1
  137. package/link/persisted-queries/persisted-queries.cjs +12 -13
  138. package/link/persisted-queries/persisted-queries.cjs.map +1 -1
  139. package/link/persisted-queries/persisted-queries.cjs.native.js +12 -13
  140. package/link/remove-typename/index.d.ts +2 -0
  141. package/link/remove-typename/index.d.ts.map +1 -0
  142. package/link/remove-typename/index.js +2 -0
  143. package/link/remove-typename/index.js.map +1 -0
  144. package/link/remove-typename/package.json +8 -0
  145. package/link/remove-typename/remove-typename.cjs +70 -0
  146. package/link/remove-typename/remove-typename.cjs.map +1 -0
  147. package/link/remove-typename/remove-typename.cjs.native.js +70 -0
  148. package/link/remove-typename/removeTypenameFromVariables.d.ts +11 -0
  149. package/link/remove-typename/removeTypenameFromVariables.d.ts.map +1 -0
  150. package/link/remove-typename/removeTypenameFromVariables.js +62 -0
  151. package/link/remove-typename/removeTypenameFromVariables.js.map +1 -0
  152. package/link/retry/delayFunction.d.ts +1 -1
  153. package/link/retry/delayFunction.d.ts.map +1 -1
  154. package/link/retry/delayFunction.js.map +1 -1
  155. package/link/retry/retryFunction.d.ts +1 -1
  156. package/link/retry/retryFunction.d.ts.map +1 -1
  157. package/link/retry/retryFunction.js.map +1 -1
  158. package/link/retry/retryLink.d.ts +4 -3
  159. package/link/retry/retryLink.d.ts.map +1 -1
  160. package/link/retry/retryLink.js.map +1 -1
  161. package/link/schema/index.d.ts +3 -2
  162. package/link/schema/index.d.ts.map +1 -1
  163. package/link/schema/index.js.map +1 -1
  164. package/link/subscriptions/index.d.ts +2 -1
  165. package/link/subscriptions/index.d.ts.map +1 -1
  166. package/link/subscriptions/index.js +2 -2
  167. package/link/subscriptions/index.js.map +1 -1
  168. package/link/subscriptions/subscriptions.cjs +1 -1
  169. package/link/subscriptions/subscriptions.cjs.map +1 -1
  170. package/link/subscriptions/subscriptions.cjs.native.js +1 -1
  171. package/link/utils/createOperation.d.ts +1 -1
  172. package/link/utils/createOperation.d.ts.map +1 -1
  173. package/link/utils/createOperation.js.map +1 -1
  174. package/link/utils/filterOperationVariables.d.ts +1 -1
  175. package/link/utils/filterOperationVariables.d.ts.map +1 -1
  176. package/link/utils/filterOperationVariables.js.map +1 -1
  177. package/link/utils/throwServerError.d.ts +1 -1
  178. package/link/utils/throwServerError.d.ts.map +1 -1
  179. package/link/utils/throwServerError.js.map +1 -1
  180. package/link/utils/toPromise.d.ts +1 -1
  181. package/link/utils/toPromise.d.ts.map +1 -1
  182. package/link/utils/toPromise.js.map +1 -1
  183. package/link/utils/transformOperation.d.ts +1 -1
  184. package/link/utils/transformOperation.d.ts.map +1 -1
  185. package/link/utils/transformOperation.js.map +1 -1
  186. package/link/utils/validateOperation.d.ts +1 -1
  187. package/link/utils/validateOperation.d.ts.map +1 -1
  188. package/link/utils/validateOperation.js.map +1 -1
  189. package/link/ws/index.d.ts +5 -3
  190. package/link/ws/index.d.ts.map +1 -1
  191. package/link/ws/index.js.map +1 -1
  192. package/package.json +26 -22
  193. package/react/cache/{QuerySubscription.d.ts → QueryReference.d.ts} +15 -7
  194. package/react/cache/QueryReference.d.ts.map +1 -0
  195. package/react/cache/QueryReference.js +107 -0
  196. package/react/cache/QueryReference.js.map +1 -0
  197. package/react/cache/SuspenseCache.d.ts +5 -5
  198. package/react/cache/SuspenseCache.d.ts.map +1 -1
  199. package/react/cache/SuspenseCache.js +8 -7
  200. package/react/cache/SuspenseCache.js.map +1 -1
  201. package/react/cache/types.d.ts +2 -0
  202. package/react/cache/types.d.ts.map +1 -0
  203. package/react/cache/types.js +2 -0
  204. package/react/cache/types.js.map +1 -0
  205. package/react/components/Mutation.d.ts +2 -2
  206. package/react/components/Mutation.d.ts.map +1 -1
  207. package/react/components/Mutation.js.map +1 -1
  208. package/react/components/Query.d.ts +2 -2
  209. package/react/components/Query.d.ts.map +1 -1
  210. package/react/components/Query.js.map +1 -1
  211. package/react/components/Subscription.d.ts +2 -2
  212. package/react/components/Subscription.d.ts.map +1 -1
  213. package/react/components/Subscription.js.map +1 -1
  214. package/react/components/types.d.ts +4 -4
  215. package/react/components/types.d.ts.map +1 -1
  216. package/react/components/types.js.map +1 -1
  217. package/react/context/ApolloConsumer.d.ts +1 -1
  218. package/react/context/ApolloConsumer.d.ts.map +1 -1
  219. package/react/context/ApolloConsumer.js +1 -1
  220. package/react/context/ApolloConsumer.js.map +1 -1
  221. package/react/context/ApolloContext.d.ts +10 -3
  222. package/react/context/ApolloContext.d.ts.map +1 -1
  223. package/react/context/ApolloContext.js +13 -8
  224. package/react/context/ApolloContext.js.map +1 -1
  225. package/react/context/ApolloProvider.d.ts +2 -2
  226. package/react/context/ApolloProvider.d.ts.map +1 -1
  227. package/react/context/ApolloProvider.js +8 -12
  228. package/react/context/ApolloProvider.js.map +1 -1
  229. package/react/context/context.cjs +22 -21
  230. package/react/context/context.cjs.map +1 -1
  231. package/react/context/context.cjs.native.js +22 -21
  232. package/react/context/index.d.ts +1 -1
  233. package/react/context/index.d.ts.map +1 -1
  234. package/react/context/index.js +1 -1
  235. package/react/context/index.js.map +1 -1
  236. package/react/hoc/graphql.d.ts +3 -3
  237. package/react/hoc/graphql.d.ts.map +1 -1
  238. package/react/hoc/graphql.js.map +1 -1
  239. package/react/hoc/hoc-utils.d.ts +2 -2
  240. package/react/hoc/hoc-utils.d.ts.map +1 -1
  241. package/react/hoc/hoc-utils.js.map +1 -1
  242. package/react/hoc/mutation-hoc.d.ts +4 -4
  243. package/react/hoc/mutation-hoc.d.ts.map +1 -1
  244. package/react/hoc/mutation-hoc.js.map +1 -1
  245. package/react/hoc/query-hoc.d.ts +2 -2
  246. package/react/hoc/query-hoc.d.ts.map +1 -1
  247. package/react/hoc/query-hoc.js.map +1 -1
  248. package/react/hoc/subscription-hoc.d.ts +2 -2
  249. package/react/hoc/subscription-hoc.d.ts.map +1 -1
  250. package/react/hoc/subscription-hoc.js.map +1 -1
  251. package/react/hoc/types.d.ts +4 -4
  252. package/react/hoc/types.d.ts.map +1 -1
  253. package/react/hoc/types.js.map +1 -1
  254. package/react/hoc/withApollo.d.ts +1 -1
  255. package/react/hoc/withApollo.d.ts.map +1 -1
  256. package/react/hoc/withApollo.js.map +1 -1
  257. package/react/hooks/hooks.cjs +133 -69
  258. package/react/hooks/hooks.cjs.map +1 -1
  259. package/react/hooks/hooks.cjs.native.js +133 -69
  260. package/react/hooks/index.d.ts +2 -1
  261. package/react/hooks/index.d.ts.map +1 -1
  262. package/react/hooks/index.js +2 -1
  263. package/react/hooks/index.js.map +1 -1
  264. package/react/hooks/internal/useDeepMemo.d.ts +1 -1
  265. package/react/hooks/internal/useDeepMemo.d.ts.map +1 -1
  266. package/react/hooks/internal/useDeepMemo.js.map +1 -1
  267. package/react/hooks/useApolloClient.d.ts +1 -1
  268. package/react/hooks/useApolloClient.d.ts.map +1 -1
  269. package/react/hooks/useApolloClient.js.map +1 -1
  270. package/react/hooks/useBackgroundQuery.d.ts +18 -0
  271. package/react/hooks/useBackgroundQuery.d.ts.map +1 -0
  272. package/react/hooks/useBackgroundQuery.js +71 -0
  273. package/react/hooks/useBackgroundQuery.js.map +1 -0
  274. package/react/hooks/useFragment.d.ts +13 -8
  275. package/react/hooks/useFragment.d.ts.map +1 -1
  276. package/react/hooks/useFragment.js +1 -1
  277. package/react/hooks/useFragment.js.map +1 -1
  278. package/react/hooks/useLazyQuery.d.ts +4 -4
  279. package/react/hooks/useLazyQuery.d.ts.map +1 -1
  280. package/react/hooks/useLazyQuery.js.map +1 -1
  281. package/react/hooks/useMutation.d.ts +4 -4
  282. package/react/hooks/useMutation.d.ts.map +1 -1
  283. package/react/hooks/useMutation.js +1 -1
  284. package/react/hooks/useMutation.js.map +1 -1
  285. package/react/hooks/useQuery.d.ts +3 -3
  286. package/react/hooks/useQuery.d.ts.map +1 -1
  287. package/react/hooks/useQuery.js +2 -2
  288. package/react/hooks/useQuery.js.map +1 -1
  289. package/react/hooks/useReactiveVar.d.ts +1 -1
  290. package/react/hooks/useReactiveVar.d.ts.map +1 -1
  291. package/react/hooks/useReactiveVar.js.map +1 -1
  292. package/react/hooks/useSubscription.d.ts +4 -4
  293. package/react/hooks/useSubscription.d.ts.map +1 -1
  294. package/react/hooks/useSubscription.js +25 -13
  295. package/react/hooks/useSubscription.js.map +1 -1
  296. package/react/hooks/useSuspenseCache.d.ts +1 -1
  297. package/react/hooks/useSuspenseCache.d.ts.map +1 -1
  298. package/react/hooks/useSuspenseCache.js +1 -1
  299. package/react/hooks/useSuspenseCache.js.map +1 -1
  300. package/react/hooks/useSuspenseQuery.d.ts +29 -7
  301. package/react/hooks/useSuspenseQuery.d.ts.map +1 -1
  302. package/react/hooks/useSuspenseQuery.js +44 -59
  303. package/react/hooks/useSuspenseQuery.js.map +1 -1
  304. package/react/parser/index.d.ts +1 -1
  305. package/react/parser/index.d.ts.map +1 -1
  306. package/react/parser/index.js +5 -5
  307. package/react/parser/index.js.map +1 -1
  308. package/react/parser/parser.cjs +5 -5
  309. package/react/parser/parser.cjs.map +1 -1
  310. package/react/parser/parser.cjs.native.js +5 -5
  311. package/react/react.cjs +73 -51
  312. package/react/react.cjs.map +1 -1
  313. package/react/react.cjs.native.js +73 -51
  314. package/react/ssr/RenderPromises.d.ts +2 -2
  315. package/react/ssr/RenderPromises.d.ts.map +1 -1
  316. package/react/ssr/RenderPromises.js.map +1 -1
  317. package/react/ssr/renderToStringWithData.d.ts +1 -1
  318. package/react/ssr/renderToStringWithData.d.ts.map +1 -1
  319. package/react/ssr/renderToStringWithData.js.map +1 -1
  320. package/react/types/types.d.ts +9 -11
  321. package/react/types/types.d.ts.map +1 -1
  322. package/react/types/types.js.map +1 -1
  323. package/testing/core/core.cjs +1 -1
  324. package/testing/core/core.cjs.map +1 -1
  325. package/testing/core/core.cjs.native.js +1 -1
  326. package/testing/core/mocking/mockClient.d.ts +2 -2
  327. package/testing/core/mocking/mockClient.d.ts.map +1 -1
  328. package/testing/core/mocking/mockClient.js.map +1 -1
  329. package/testing/core/mocking/mockLink.d.ts +2 -1
  330. package/testing/core/mocking/mockLink.d.ts.map +1 -1
  331. package/testing/core/mocking/mockLink.js +2 -2
  332. package/testing/core/mocking/mockLink.js.map +1 -1
  333. package/testing/core/mocking/mockQueryManager.d.ts +1 -1
  334. package/testing/core/mocking/mockQueryManager.d.ts.map +1 -1
  335. package/testing/core/mocking/mockQueryManager.js.map +1 -1
  336. package/testing/core/mocking/mockSubscriptionLink.d.ts +2 -1
  337. package/testing/core/mocking/mockSubscriptionLink.d.ts.map +1 -1
  338. package/testing/core/mocking/mockSubscriptionLink.js.map +1 -1
  339. package/testing/core/mocking/mockWatchQuery.d.ts +2 -2
  340. package/testing/core/mocking/mockWatchQuery.d.ts.map +1 -1
  341. package/testing/core/mocking/mockWatchQuery.js.map +1 -1
  342. package/testing/core/observableToPromise.d.ts +2 -2
  343. package/testing/core/observableToPromise.d.ts.map +1 -1
  344. package/testing/core/observableToPromise.js.map +1 -1
  345. package/testing/core/subscribeAndCount.d.ts +1 -1
  346. package/testing/core/subscribeAndCount.d.ts.map +1 -1
  347. package/testing/core/subscribeAndCount.js.map +1 -1
  348. package/testing/react/MockedProvider.d.ts +7 -6
  349. package/testing/react/MockedProvider.d.ts.map +1 -1
  350. package/testing/react/MockedProvider.js.map +1 -1
  351. package/utilities/common/compact.d.ts +1 -1
  352. package/utilities/common/compact.d.ts.map +1 -1
  353. package/utilities/common/compact.js.map +1 -1
  354. package/utilities/common/errorHandling.d.ts +1 -1
  355. package/utilities/common/errorHandling.d.ts.map +1 -1
  356. package/utilities/common/errorHandling.js.map +1 -1
  357. package/utilities/common/incrementalResult.d.ts +1 -1
  358. package/utilities/common/incrementalResult.d.ts.map +1 -1
  359. package/utilities/common/incrementalResult.js.map +1 -1
  360. package/utilities/common/omitDeep.d.ts +10 -2
  361. package/utilities/common/omitDeep.d.ts.map +1 -1
  362. package/utilities/common/omitDeep.js +22 -10
  363. package/utilities/common/omitDeep.js.map +1 -1
  364. package/utilities/common/responseIterator.d.ts +2 -2
  365. package/utilities/common/responseIterator.d.ts.map +1 -1
  366. package/utilities/common/responseIterator.js.map +1 -1
  367. package/utilities/common/stripTypename.d.ts +9 -1
  368. package/utilities/common/stripTypename.d.ts.map +1 -1
  369. package/utilities/common/stripTypename.js +3 -2
  370. package/utilities/common/stripTypename.js.map +1 -1
  371. package/utilities/globals/global.d.ts +6 -3
  372. package/utilities/globals/global.d.ts.map +1 -1
  373. package/utilities/globals/global.js.map +1 -1
  374. package/utilities/graphql/directives.d.ts +1 -1
  375. package/utilities/graphql/directives.d.ts.map +1 -1
  376. package/utilities/graphql/directives.js +4 -4
  377. package/utilities/graphql/directives.js.map +1 -1
  378. package/utilities/graphql/fragments.d.ts +1 -1
  379. package/utilities/graphql/fragments.d.ts.map +1 -1
  380. package/utilities/graphql/fragments.js +3 -3
  381. package/utilities/graphql/fragments.js.map +1 -1
  382. package/utilities/graphql/getFromAST.d.ts +1 -1
  383. package/utilities/graphql/getFromAST.d.ts.map +1 -1
  384. package/utilities/graphql/getFromAST.js +8 -8
  385. package/utilities/graphql/getFromAST.js.map +1 -1
  386. package/utilities/graphql/storeUtils.d.ts +2 -2
  387. package/utilities/graphql/storeUtils.d.ts.map +1 -1
  388. package/utilities/graphql/storeUtils.js +14 -4
  389. package/utilities/graphql/storeUtils.js.map +1 -1
  390. package/utilities/graphql/transform.d.ts +1 -1
  391. package/utilities/graphql/transform.d.ts.map +1 -1
  392. package/utilities/graphql/transform.js +2 -2
  393. package/utilities/graphql/transform.js.map +1 -1
  394. package/utilities/index.d.ts +3 -2
  395. package/utilities/index.d.ts.map +1 -1
  396. package/utilities/index.js +1 -1
  397. package/utilities/index.js.map +1 -1
  398. package/utilities/observables/Concast.d.ts +2 -1
  399. package/utilities/observables/Concast.d.ts.map +1 -1
  400. package/utilities/observables/Concast.js.map +1 -1
  401. package/utilities/observables/Observable.d.ts +2 -1
  402. package/utilities/observables/Observable.d.ts.map +1 -1
  403. package/utilities/observables/Observable.js +1 -1
  404. package/utilities/observables/Observable.js.map +1 -1
  405. package/utilities/observables/asyncMap.d.ts.map +1 -1
  406. package/utilities/observables/asyncMap.js.map +1 -1
  407. package/utilities/observables/iteration.d.ts +1 -1
  408. package/utilities/observables/iteration.d.ts.map +1 -1
  409. package/utilities/observables/iteration.js.map +1 -1
  410. package/utilities/policies/pagination.d.ts +1 -1
  411. package/utilities/policies/pagination.d.ts.map +1 -1
  412. package/utilities/policies/pagination.js.map +1 -1
  413. package/utilities/promises/decoration.d.ts +2 -0
  414. package/utilities/promises/decoration.d.ts.map +1 -1
  415. package/utilities/promises/decoration.js +12 -0
  416. package/utilities/promises/decoration.js.map +1 -1
  417. package/utilities/types/DeepOmit.d.ts +4 -3
  418. package/utilities/types/DeepOmit.d.ts.map +1 -1
  419. package/utilities/types/DeepOmit.js.map +1 -1
  420. package/utilities/types/DeepPartial.d.ts +12 -0
  421. package/utilities/types/DeepPartial.d.ts.map +1 -0
  422. package/utilities/types/DeepPartial.js +2 -0
  423. package/utilities/types/DeepPartial.js.map +1 -0
  424. package/utilities/types/Primitive.d.ts +2 -0
  425. package/utilities/types/Primitive.d.ts.map +1 -0
  426. package/utilities/types/Primitive.js +2 -0
  427. package/utilities/types/Primitive.js.map +1 -0
  428. package/utilities/utilities.cjs +68 -31
  429. package/utilities/utilities.cjs.map +1 -1
  430. package/utilities/utilities.cjs.native.js +68 -31
  431. package/version.js +1 -1
  432. package/react/cache/QuerySubscription.d.ts.map +0 -1
  433. package/react/cache/QuerySubscription.js +0 -88
  434. package/react/cache/QuerySubscription.js.map +0 -1
@@ -1,9 +1,10 @@
1
- type Primitive = string | Function | number | boolean | Symbol | undefined | null;
1
+ import type { Primitive } from './Primitive';
2
+ type DeepOmitPrimitive = Primitive | Function;
2
3
  export type DeepOmitArray<T extends any[], K> = {
3
4
  [P in keyof T]: DeepOmit<T[P], K>;
4
5
  };
5
- export type DeepOmit<T, K> = T extends Primitive ? T : {
6
- [P in Exclude<keyof T, K>]: T[P] extends infer TP ? TP extends Primitive ? TP : TP extends any[] ? DeepOmitArray<TP, K> : DeepOmit<TP, K> : never;
6
+ export type DeepOmit<T, K> = T extends DeepOmitPrimitive ? T : {
7
+ [P in Exclude<keyof T, K>]: T[P] extends infer TP ? TP extends DeepOmitPrimitive ? TP : TP extends any[] ? DeepOmitArray<TP, K> : DeepOmit<TP, K> : never;
7
8
  };
8
9
  export {};
9
10
  //# sourceMappingURL=DeepOmit.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"DeepOmit.d.ts","sourceRoot":"","sources":["../../../src/utilities/types/DeepOmit.ts"],"names":[],"mappings":"AACA,KAAK,SAAS,GACV,MAAM,GACN,QAAQ,GACR,MAAM,GACN,OAAO,GACP,MAAM,GACN,SAAS,GACT,IAAI,CAAC;AAET,MAAM,MAAM,aAAa,CAAC,CAAC,SAAS,GAAG,EAAE,EAAE,CAAC,IAAI;KAC7C,CAAC,IAAI,MAAM,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;CAClC,CAAC;AAcF,MAAM,MAAM,QAAQ,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,SAAS,SAAS,GAC5C,CAAC,GACD;KACG,CAAC,IAAI,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,MAAM,EAAE,GAC7C,EAAE,SAAS,SAAS,GAClB,EAAE,GACF,EAAE,SAAS,GAAG,EAAE,GAChB,aAAa,CAAC,EAAE,EAAE,CAAC,CAAC,GACpB,QAAQ,CAAC,EAAE,EAAE,CAAC,CAAC,GACjB,KAAK;CACV,CAAC"}
1
+ {"version":3,"file":"DeepOmit.d.ts","sourceRoot":"","sources":["../../../src/utilities/types/DeepOmit.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAG7C,KAAK,iBAAiB,GAAG,SAAS,GAAG,QAAQ,CAAC;AAE9C,MAAM,MAAM,aAAa,CAAC,CAAC,SAAS,GAAG,EAAE,EAAE,CAAC,IAAI;KAC7C,CAAC,IAAI,MAAM,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;CAClC,CAAC;AAcF,MAAM,MAAM,QAAQ,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,SAAS,iBAAiB,GACpD,CAAC,GACD;KACG,CAAC,IAAI,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,MAAM,EAAE,GAC7C,EAAE,SAAS,iBAAiB,GAC1B,EAAE,GACF,EAAE,SAAS,GAAG,EAAE,GAChB,aAAa,CAAC,EAAE,EAAE,CAAC,CAAC,GACpB,QAAQ,CAAC,EAAE,EAAE,CAAC,CAAC,GACjB,KAAK;CACV,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"DeepOmit.js","sourceRoot":"","sources":["../../../src/utilities/types/DeepOmit.ts"],"names":[],"mappings":"","sourcesContent":["// DeepOmit primitives include functions and symbols since these are unmodified.\ntype Primitive =\n | string\n | Function\n | number\n | boolean\n | Symbol\n | undefined\n | null;\n\nexport type DeepOmitArray<T extends any[], K> = {\n [P in keyof T]: DeepOmit<T[P], K>;\n};\n\n// Unfortunately there is one major flaw in this type: This will omit properties\n// from class instances in the return type even though our omitDeep helper\n// ignores class instances, therefore resulting in a type mismatch between\n// the return value and the runtime value.\n//\n// It is not currently possible with TypeScript to distinguish between plain\n// objects and class instances.\n// https://github.com/microsoft/TypeScript/issues/29063\n//\n// This should be fine as of the time of this writing until omitDeep gets\n// broader use since this utility is only used to strip __typename from\n// `variables`; a case in which class instances are invalid anyways.\nexport type DeepOmit<T, K> = T extends Primitive\n ? T\n : {\n [P in Exclude<keyof T, K>]: T[P] extends infer TP\n ? TP extends Primitive\n ? TP\n : TP extends any[]\n ? DeepOmitArray<TP, K>\n : DeepOmit<TP, K>\n : never;\n };\n"]}
1
+ {"version":3,"file":"DeepOmit.js","sourceRoot":"","sources":["../../../src/utilities/types/DeepOmit.ts"],"names":[],"mappings":"","sourcesContent":["import type { Primitive } from './Primitive';\n\n// DeepOmit primitives include functions since these are unmodified.\ntype DeepOmitPrimitive = Primitive | Function;\n\nexport type DeepOmitArray<T extends any[], K> = {\n [P in keyof T]: DeepOmit<T[P], K>;\n};\n\n// Unfortunately there is one major flaw in this type: This will omit properties\n// from class instances in the return type even though our omitDeep helper\n// ignores class instances, therefore resulting in a type mismatch between\n// the return value and the runtime value.\n//\n// It is not currently possible with TypeScript to distinguish between plain\n// objects and class instances.\n// https://github.com/microsoft/TypeScript/issues/29063\n//\n// This should be fine as of the time of this writing until omitDeep gets\n// broader use since this utility is only used to strip __typename from\n// `variables`; a case in which class instances are invalid anyways.\nexport type DeepOmit<T, K> = T extends DeepOmitPrimitive\n ? T\n : {\n [P in Exclude<keyof T, K>]: T[P] extends infer TP\n ? TP extends DeepOmitPrimitive\n ? TP\n : TP extends any[]\n ? DeepOmitArray<TP, K>\n : DeepOmit<TP, K>\n : never;\n };\n"]}
@@ -0,0 +1,12 @@
1
+ import type { Primitive } from './Primitive';
2
+ type DeepPartialPrimitive = Primitive | Date | RegExp;
3
+ export type DeepPartial<T> = T extends DeepPartialPrimitive ? T : T extends Map<infer TKey, infer TValue> ? DeepPartialMap<TKey, TValue> : T extends ReadonlyMap<infer TKey, infer TValue> ? DeepPartialReadonlyMap<TKey, TValue> : T extends Set<infer TItem> ? DeepPartialSet<TItem> : T extends ReadonlySet<infer TItem> ? DeepPartialReadonlySet<TItem> : T extends (...args: any[]) => unknown ? T | undefined : T extends object ? T extends ReadonlyArray<infer TItem> ? TItem[] extends T ? readonly TItem[] extends T ? ReadonlyArray<DeepPartial<TItem | undefined>> : Array<DeepPartial<TItem | undefined>> : DeepPartialObject<T> : DeepPartialObject<T> : unknown;
4
+ type DeepPartialMap<TKey, TValue> = {} & Map<DeepPartial<TKey>, DeepPartial<TValue>>;
5
+ type DeepPartialReadonlyMap<TKey, TValue> = {} & ReadonlyMap<DeepPartial<TKey>, DeepPartial<TValue>>;
6
+ type DeepPartialSet<T> = {} & Set<DeepPartial<T>>;
7
+ type DeepPartialReadonlySet<T> = {} & ReadonlySet<DeepPartial<T>>;
8
+ type DeepPartialObject<T extends object> = {
9
+ [K in keyof T]?: DeepPartial<T[K]>;
10
+ };
11
+ export {};
12
+ //# sourceMappingURL=DeepPartial.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DeepPartial.d.ts","sourceRoot":"","sources":["../../../src/utilities/types/DeepPartial.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAE7C,KAAK,oBAAoB,GAAG,SAAS,GAAG,IAAI,GAAG,MAAM,CAAC;AAEtD,MAAM,MAAM,WAAW,CAAC,CAAC,IAAI,CAAC,SAAS,oBAAoB,GACvD,CAAC,GACD,CAAC,SAAS,GAAG,CAAC,MAAM,IAAI,EAAE,MAAM,MAAM,CAAC,GACvC,cAAc,CAAC,IAAI,EAAE,MAAM,CAAC,GAC5B,CAAC,SAAS,WAAW,CAAC,MAAM,IAAI,EAAE,MAAM,MAAM,CAAC,GAC/C,sBAAsB,CAAC,IAAI,EAAE,MAAM,CAAC,GACpC,CAAC,SAAS,GAAG,CAAC,MAAM,KAAK,CAAC,GAC1B,cAAc,CAAC,KAAK,CAAC,GACrB,CAAC,SAAS,WAAW,CAAC,MAAM,KAAK,CAAC,GAClC,sBAAsB,CAAC,KAAK,CAAC,GAC7B,CAAC,SAAS,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,OAAO,GACrC,CAAC,GAAG,SAAS,GACb,CAAC,SAAS,MAAM,GAChB,CAAC,SAAS,aAAa,CAAC,MAAM,KAAK,CAAC,GAClC,KAAK,EAAE,SAAS,CAAC,GACf,SAAS,KAAK,EAAE,SAAS,CAAC,GACxB,aAAa,CAAC,WAAW,CAAC,KAAK,GAAG,SAAS,CAAC,CAAC,GAC7C,KAAK,CAAC,WAAW,CAAC,KAAK,GAAG,SAAS,CAAC,CAAC,GACvC,iBAAiB,CAAC,CAAC,CAAC,GACtB,iBAAiB,CAAC,CAAC,CAAC,GACtB,OAAO,CAAC;AAEZ,KAAK,cAAc,CAAC,IAAI,EAAE,MAAM,IAAI,EAAE,GAAG,GAAG,CAC1C,WAAW,CAAC,IAAI,CAAC,EACjB,WAAW,CAAC,MAAM,CAAC,CACpB,CAAC;AAEF,KAAK,sBAAsB,CAAC,IAAI,EAAE,MAAM,IAAI,EAAE,GAAG,WAAW,CAC1D,WAAW,CAAC,IAAI,CAAC,EACjB,WAAW,CAAC,MAAM,CAAC,CACpB,CAAC;AAEF,KAAK,cAAc,CAAC,CAAC,IAAI,EAAE,GAAG,GAAG,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC;AAClD,KAAK,sBAAsB,CAAC,CAAC,IAAI,EAAE,GAAG,WAAW,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC;AAElE,KAAK,iBAAiB,CAAC,CAAC,SAAS,MAAM,IAAI;KACxC,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;CACnC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=DeepPartial.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DeepPartial.js","sourceRoot":"","sources":["../../../src/utilities/types/DeepPartial.ts"],"names":[],"mappings":"","sourcesContent":["// Inspired by type-fest PartialDeep: https://github.com/sindresorhus/type-fest/blob/9feb8c89be9a0f2f688bf2f497230298a8e2472e/source/partial-deep.d.ts\n//\n// We're including the license to give credit to the original implementation.\n// https://github.com/sindresorhus/type-fest/blob/main/license-mit\n\n/*\n * MIT License\n *\n * Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n */\nimport type { Primitive } from './Primitive';\n\ntype DeepPartialPrimitive = Primitive | Date | RegExp;\n\nexport type DeepPartial<T> = T extends DeepPartialPrimitive\n ? T\n : T extends Map<infer TKey, infer TValue>\n ? DeepPartialMap<TKey, TValue>\n : T extends ReadonlyMap<infer TKey, infer TValue>\n ? DeepPartialReadonlyMap<TKey, TValue>\n : T extends Set<infer TItem>\n ? DeepPartialSet<TItem>\n : T extends ReadonlySet<infer TItem>\n ? DeepPartialReadonlySet<TItem>\n : T extends (...args: any[]) => unknown\n ? T | undefined\n : T extends object\n ? T extends ReadonlyArray<infer TItem> // Test for arrays/tuples\n ? TItem[] extends T // Test for non-tuples\n ? readonly TItem[] extends T\n ? ReadonlyArray<DeepPartial<TItem | undefined>>\n : Array<DeepPartial<TItem | undefined>>\n : DeepPartialObject<T>\n : DeepPartialObject<T>\n : unknown;\n\ntype DeepPartialMap<TKey, TValue> = {} & Map<\n DeepPartial<TKey>,\n DeepPartial<TValue>\n>;\n\ntype DeepPartialReadonlyMap<TKey, TValue> = {} & ReadonlyMap<\n DeepPartial<TKey>,\n DeepPartial<TValue>\n>;\n\ntype DeepPartialSet<T> = {} & Set<DeepPartial<T>>;\ntype DeepPartialReadonlySet<T> = {} & ReadonlySet<DeepPartial<T>>;\n\ntype DeepPartialObject<T extends object> = {\n [K in keyof T]?: DeepPartial<T[K]>;\n};\n"]}
@@ -0,0 +1,2 @@
1
+ export type Primitive = null | undefined | string | number | boolean | symbol | bigint;
2
+ //# sourceMappingURL=Primitive.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Primitive.d.ts","sourceRoot":"","sources":["../../../src/utilities/types/Primitive.ts"],"names":[],"mappings":"AACA,MAAM,MAAM,SAAS,GACjB,IAAI,GACJ,SAAS,GACT,MAAM,GACN,MAAM,GACN,OAAO,GACP,MAAM,GACN,MAAM,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=Primitive.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Primitive.js","sourceRoot":"","sources":["../../../src/utilities/types/Primitive.ts"],"names":[],"mappings":"","sourcesContent":["// Matches any primitive value: https://developer.mozilla.org/en-US/docs/Glossary/Primitive.\nexport type Primitive =\n | null\n | undefined\n | string\n | number\n | boolean\n | symbol\n | bigint;\n"]}
@@ -18,7 +18,7 @@ function shouldInclude(_a, variables) {
18
18
  var evaledValue = false;
19
19
  if (ifArgument.value.kind === 'Variable') {
20
20
  evaledValue = variables && variables[ifArgument.value.name.value];
21
- globals.__DEV__ ? globals.invariant(evaledValue !== void 0, "Invalid variable referenced in @".concat(directive.name.value, " directive.")) : globals.invariant(evaledValue !== void 0, 42);
21
+ globals.__DEV__ ? globals.invariant(evaledValue !== void 0, "Invalid variable referenced in @".concat(directive.name.value, " directive.")) : globals.invariant(evaledValue !== void 0, 43);
22
22
  }
23
23
  else {
24
24
  evaledValue = ifArgument.value.value;
@@ -65,13 +65,13 @@ function getInclusionDirectives(directives) {
65
65
  return;
66
66
  var directiveArguments = directive.arguments;
67
67
  var directiveName = directive.name.value;
68
- globals.__DEV__ ? globals.invariant(directiveArguments && directiveArguments.length === 1, "Incorrect number of arguments for the @".concat(directiveName, " directive.")) : globals.invariant(directiveArguments && directiveArguments.length === 1, 43);
68
+ globals.__DEV__ ? globals.invariant(directiveArguments && directiveArguments.length === 1, "Incorrect number of arguments for the @".concat(directiveName, " directive.")) : globals.invariant(directiveArguments && directiveArguments.length === 1, 44);
69
69
  var ifArgument = directiveArguments[0];
70
- globals.__DEV__ ? globals.invariant(ifArgument.name && ifArgument.name.value === 'if', "Invalid argument for the @".concat(directiveName, " directive.")) : globals.invariant(ifArgument.name && ifArgument.name.value === 'if', 44);
70
+ globals.__DEV__ ? globals.invariant(ifArgument.name && ifArgument.name.value === 'if', "Invalid argument for the @".concat(directiveName, " directive.")) : globals.invariant(ifArgument.name && ifArgument.name.value === 'if', 45);
71
71
  var ifValue = ifArgument.value;
72
72
  globals.__DEV__ ? globals.invariant(ifValue &&
73
73
  (ifValue.kind === 'Variable' || ifValue.kind === 'BooleanValue'), "Argument for the @".concat(directiveName, " directive must be a variable or a boolean value.")) : globals.invariant(ifValue &&
74
- (ifValue.kind === 'Variable' || ifValue.kind === 'BooleanValue'), 45);
74
+ (ifValue.kind === 'Variable' || ifValue.kind === 'BooleanValue'), 46);
75
75
  result.push({ directive: directive, ifArgument: ifArgument });
76
76
  });
77
77
  }
@@ -84,14 +84,14 @@ function getFragmentQueryDocument(document, fragmentName) {
84
84
  document.definitions.forEach(function (definition) {
85
85
  if (definition.kind === 'OperationDefinition') {
86
86
  throw globals.__DEV__ ? new globals.InvariantError("Found a ".concat(definition.operation, " operation").concat(definition.name ? " named '".concat(definition.name.value, "'") : '', ". ") +
87
- 'No operations are allowed when using a fragment as a query. Only fragments are allowed.') : new globals.InvariantError(46);
87
+ 'No operations are allowed when using a fragment as a query. Only fragments are allowed.') : new globals.InvariantError(47);
88
88
  }
89
89
  if (definition.kind === 'FragmentDefinition') {
90
90
  fragments.push(definition);
91
91
  }
92
92
  });
93
93
  if (typeof actualFragmentName === 'undefined') {
94
- globals.__DEV__ ? globals.invariant(fragments.length === 1, "Found ".concat(fragments.length, " fragments. `fragmentName` must be provided when there is not exactly 1 fragment.")) : globals.invariant(fragments.length === 1, 47);
94
+ globals.__DEV__ ? globals.invariant(fragments.length === 1, "Found ".concat(fragments.length, " fragments. `fragmentName` must be provided when there is not exactly 1 fragment.")) : globals.invariant(fragments.length === 1, 48);
95
95
  actualFragmentName = fragments[0].name.value;
96
96
  }
97
97
  var query = tslib.__assign(tslib.__assign({}, document), { definitions: tslib.__spreadArray([
@@ -132,7 +132,7 @@ function getFragmentFromSelection(selection, fragmentMap) {
132
132
  return fragmentMap(fragmentName);
133
133
  }
134
134
  var fragment = fragmentMap && fragmentMap[fragmentName];
135
- globals.__DEV__ ? globals.invariant(fragment, "No fragment named ".concat(fragmentName)) : globals.invariant(fragment, 48);
135
+ globals.__DEV__ ? globals.invariant(fragment, "No fragment named ".concat(fragmentName)) : globals.invariant(fragment, 49);
136
136
  return fragment || null;
137
137
  }
138
138
  default:
@@ -222,7 +222,7 @@ function valueToObjectRepresentation(argObj, name, value, variables) {
222
222
  else {
223
223
  throw globals.__DEV__ ? new globals.InvariantError("The inline argument \"".concat(name.value, "\" of kind \"").concat(value.kind, "\"") +
224
224
  'is not supported. Use variables instead of inline arguments to ' +
225
- 'overcome this limitation.') : new globals.InvariantError(57);
225
+ 'overcome this limitation.') : new globals.InvariantError(58);
226
226
  }
227
227
  }
228
228
  function storeKeyNameFromField(field, variables) {
@@ -331,9 +331,7 @@ function resultKeyNameFromField(field) {
331
331
  return field.alias ? field.alias.value : field.name.value;
332
332
  }
333
333
  function getTypenameFromResult(result, selectionSet, fragmentMap) {
334
- if (typeof result.__typename === 'string') {
335
- return result.__typename;
336
- }
334
+ var fragments;
337
335
  for (var _i = 0, _a = selectionSet.selections; _i < _a.length; _i++) {
338
336
  var selection = _a[_i];
339
337
  if (isField(selection)) {
@@ -341,7 +339,19 @@ function getTypenameFromResult(result, selectionSet, fragmentMap) {
341
339
  return result[resultKeyNameFromField(selection)];
342
340
  }
343
341
  }
342
+ else if (fragments) {
343
+ fragments.push(selection);
344
+ }
344
345
  else {
346
+ fragments = [selection];
347
+ }
348
+ }
349
+ if (typeof result.__typename === 'string') {
350
+ return result.__typename;
351
+ }
352
+ if (fragments) {
353
+ for (var _b = 0, fragments_1 = fragments; _b < fragments_1.length; _b++) {
354
+ var selection = fragments_1[_b];
345
355
  var typename = getTypenameFromResult(result, getFragmentFromSelection(selection, fragmentMap).selectionSet, fragmentMap);
346
356
  if (typeof typename === 'string') {
347
357
  return typename;
@@ -357,16 +367,16 @@ function isInlineFragment(selection) {
357
367
  }
358
368
 
359
369
  function checkDocument(doc) {
360
- globals.__DEV__ ? globals.invariant(doc && doc.kind === 'Document', "Expecting a parsed GraphQL document. Perhaps you need to wrap the query string in a \"gql\" tag? http://docs.apollostack.com/apollo-client/core.html#gql") : globals.invariant(doc && doc.kind === 'Document', 49);
370
+ globals.__DEV__ ? globals.invariant(doc && doc.kind === 'Document', "Expecting a parsed GraphQL document. Perhaps you need to wrap the query string in a \"gql\" tag? http://docs.apollostack.com/apollo-client/core.html#gql") : globals.invariant(doc && doc.kind === 'Document', 50);
361
371
  var operations = doc.definitions
362
372
  .filter(function (d) { return d.kind !== 'FragmentDefinition'; })
363
373
  .map(function (definition) {
364
374
  if (definition.kind !== 'OperationDefinition') {
365
- throw globals.__DEV__ ? new globals.InvariantError("Schema type definitions not allowed in queries. Found: \"".concat(definition.kind, "\"")) : new globals.InvariantError(50);
375
+ throw globals.__DEV__ ? new globals.InvariantError("Schema type definitions not allowed in queries. Found: \"".concat(definition.kind, "\"")) : new globals.InvariantError(51);
366
376
  }
367
377
  return definition;
368
378
  });
369
- globals.__DEV__ ? globals.invariant(operations.length <= 1, "Ambiguous GraphQL document: contains ".concat(operations.length, " operations")) : globals.invariant(operations.length <= 1, 51);
379
+ globals.__DEV__ ? globals.invariant(operations.length <= 1, "Ambiguous GraphQL document: contains ".concat(operations.length, " operations")) : globals.invariant(operations.length <= 1, 52);
370
380
  return doc;
371
381
  }
372
382
  function getOperationDefinition(doc) {
@@ -389,14 +399,14 @@ function getFragmentDefinitions(doc) {
389
399
  }
390
400
  function getQueryDefinition(doc) {
391
401
  var queryDef = getOperationDefinition(doc);
392
- globals.__DEV__ ? globals.invariant(queryDef && queryDef.operation === 'query', 'Must contain a query definition.') : globals.invariant(queryDef && queryDef.operation === 'query', 52);
402
+ globals.__DEV__ ? globals.invariant(queryDef && queryDef.operation === 'query', 'Must contain a query definition.') : globals.invariant(queryDef && queryDef.operation === 'query', 53);
393
403
  return queryDef;
394
404
  }
395
405
  function getFragmentDefinition(doc) {
396
- globals.__DEV__ ? globals.invariant(doc.kind === 'Document', "Expecting a parsed GraphQL document. Perhaps you need to wrap the query string in a \"gql\" tag? http://docs.apollostack.com/apollo-client/core.html#gql") : globals.invariant(doc.kind === 'Document', 53);
397
- globals.__DEV__ ? globals.invariant(doc.definitions.length <= 1, 'Fragment must have exactly one definition.') : globals.invariant(doc.definitions.length <= 1, 54);
406
+ globals.__DEV__ ? globals.invariant(doc.kind === 'Document', "Expecting a parsed GraphQL document. Perhaps you need to wrap the query string in a \"gql\" tag? http://docs.apollostack.com/apollo-client/core.html#gql") : globals.invariant(doc.kind === 'Document', 54);
407
+ globals.__DEV__ ? globals.invariant(doc.definitions.length <= 1, 'Fragment must have exactly one definition.') : globals.invariant(doc.definitions.length <= 1, 55);
398
408
  var fragmentDef = doc.definitions[0];
399
- globals.__DEV__ ? globals.invariant(fragmentDef.kind === 'FragmentDefinition', 'Must be a fragment definition.') : globals.invariant(fragmentDef.kind === 'FragmentDefinition', 55);
409
+ globals.__DEV__ ? globals.invariant(fragmentDef.kind === 'FragmentDefinition', 'Must be a fragment definition.') : globals.invariant(fragmentDef.kind === 'FragmentDefinition', 56);
400
410
  return fragmentDef;
401
411
  }
402
412
  function getMainDefinition(queryDoc) {
@@ -419,7 +429,7 @@ function getMainDefinition(queryDoc) {
419
429
  if (fragmentDefinition) {
420
430
  return fragmentDefinition;
421
431
  }
422
- throw globals.__DEV__ ? new globals.InvariantError('Expected a parsed GraphQL query with a query, mutation, subscription, or a fragment.') : new globals.InvariantError(56);
432
+ throw globals.__DEV__ ? new globals.InvariantError('Expected a parsed GraphQL query with a query, mutation, subscription, or a fragment.') : new globals.InvariantError(57);
423
433
  }
424
434
  function getDefaultValues(definition) {
425
435
  var defaultValues = Object.create(null);
@@ -1001,6 +1011,18 @@ function makeEmptyData() {
1001
1011
  };
1002
1012
  }
1003
1013
 
1014
+ function createFulfilledPromise(value) {
1015
+ var promise = Promise.resolve(value);
1016
+ promise.status = 'fulfilled';
1017
+ promise.value = value;
1018
+ return promise;
1019
+ }
1020
+ function createRejectedPromise(reason) {
1021
+ var promise = Promise.reject(reason);
1022
+ promise.status = 'rejected';
1023
+ promise.reason = reason;
1024
+ return promise;
1025
+ }
1004
1026
  function isStatefulPromise(promise) {
1005
1027
  return 'status' in promise;
1006
1028
  }
@@ -1409,11 +1431,15 @@ function isNodeReadableStream(value) {
1409
1431
  return !!value.pipe;
1410
1432
  }
1411
1433
 
1412
- function omitDeep(value, key) {
1413
- return __omitDeep(value, key);
1434
+ var BREAK = Symbol('BREAK');
1435
+ function omitDeep(value, key, options) {
1436
+ if (options === void 0) { options = Object.create(null); }
1437
+ return __omitDeep(value, key, options);
1414
1438
  }
1415
- function __omitDeep(value, key, known) {
1439
+ omitDeep.BREAK = BREAK;
1440
+ function __omitDeep(value, key, options, known, path) {
1416
1441
  if (known === void 0) { known = new Map(); }
1442
+ if (path === void 0) { path = []; }
1417
1443
  if (known.has(value)) {
1418
1444
  return known.get(value);
1419
1445
  }
@@ -1422,7 +1448,11 @@ function __omitDeep(value, key, known) {
1422
1448
  var array_1 = [];
1423
1449
  known.set(value, array_1);
1424
1450
  value.forEach(function (value, index) {
1425
- var result = __omitDeep(value, key, known);
1451
+ var _a;
1452
+ var objectPath = path.concat(index);
1453
+ var result = ((_a = options.keep) === null || _a === void 0 ? void 0 : _a.call(options, objectPath)) === BREAK
1454
+ ? value
1455
+ : __omitDeep(value, key, options, known, objectPath);
1426
1456
  modified || (modified = result !== value);
1427
1457
  array_1[index] = result;
1428
1458
  });
@@ -1434,14 +1464,18 @@ function __omitDeep(value, key, known) {
1434
1464
  var obj_1 = Object.create(Object.getPrototypeOf(value));
1435
1465
  known.set(value, obj_1);
1436
1466
  Object.keys(value).forEach(function (k) {
1437
- if (k === key) {
1467
+ var _a;
1468
+ var objectPath = path.concat(k);
1469
+ var keep = (_a = options.keep) === null || _a === void 0 ? void 0 : _a.call(options, objectPath);
1470
+ if (k === key && keep !== true) {
1438
1471
  modified = true;
1472
+ return;
1439
1473
  }
1440
- else {
1441
- var result = __omitDeep(value[k], key, known);
1442
- modified || (modified = result !== value[k]);
1443
- obj_1[k] = result;
1444
- }
1474
+ var result = keep === BREAK
1475
+ ? value[k]
1476
+ : __omitDeep(value[k], key, options, known, objectPath);
1477
+ modified || (modified = result !== value[k]);
1478
+ obj_1[k] = result;
1445
1479
  });
1446
1480
  if (modified) {
1447
1481
  return obj_1;
@@ -1450,9 +1484,10 @@ function __omitDeep(value, key, known) {
1450
1484
  return value;
1451
1485
  }
1452
1486
 
1453
- function stripTypename(value) {
1454
- return omitDeep(value, '__typename');
1487
+ function stripTypename(value, options) {
1488
+ return omitDeep(value, '__typename', options);
1455
1489
  }
1490
+ stripTypename.BREAK = omitDeep.BREAK;
1456
1491
 
1457
1492
  exports.DEV = globals.DEV;
1458
1493
  exports.maybe = globals.maybe;
@@ -1474,6 +1509,8 @@ exports.cloneDeep = cloneDeep;
1474
1509
  exports.compact = compact;
1475
1510
  exports.concatPagination = concatPagination;
1476
1511
  exports.createFragmentMap = createFragmentMap;
1512
+ exports.createFulfilledPromise = createFulfilledPromise;
1513
+ exports.createRejectedPromise = createRejectedPromise;
1477
1514
  exports.fixObservableSubclass = fixObservableSubclass;
1478
1515
  exports.getDefaultValues = getDefaultValues;
1479
1516
  exports.getDirectiveNames = getDirectiveNames;