@apollo/client 3.8.0-alpha.5 → 3.8.0-alpha.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 (307) hide show
  1. package/README.md +1 -0
  2. package/apollo-client.cjs +151 -72
  3. package/apollo-client.cjs.map +1 -1
  4. package/apollo-client.min.cjs +1 -1
  5. package/cache/cache.cjs +20 -20
  6. package/cache/cache.cjs.map +1 -1
  7. package/cache/cache.cjs.native.js +20 -20
  8. package/cache/core/cache.d.ts +1 -1
  9. package/cache/core/cache.d.ts.map +1 -1
  10. package/cache/core/cache.js.map +1 -1
  11. package/cache/core/types/common.d.ts +7 -7
  12. package/cache/core/types/common.d.ts.map +1 -1
  13. package/cache/inmemory/entityStore.d.ts +1 -1
  14. package/cache/inmemory/entityStore.d.ts.map +1 -1
  15. package/cache/inmemory/entityStore.js +1 -1
  16. package/cache/inmemory/helpers.js.map +1 -1
  17. package/cache/inmemory/inMemoryCache.d.ts +3 -2
  18. package/cache/inmemory/inMemoryCache.d.ts.map +1 -1
  19. package/cache/inmemory/inMemoryCache.js +1 -1
  20. package/cache/inmemory/inMemoryCache.js.map +1 -1
  21. package/cache/inmemory/key-extractor.js +1 -1
  22. package/cache/inmemory/object-canon.d.ts +0 -1
  23. package/cache/inmemory/object-canon.d.ts.map +1 -1
  24. package/cache/inmemory/object-canon.js +1 -1
  25. package/cache/inmemory/object-canon.js.map +1 -1
  26. package/cache/inmemory/policies.d.ts +12 -12
  27. package/cache/inmemory/policies.d.ts.map +1 -1
  28. package/cache/inmemory/policies.js +1 -1
  29. package/cache/inmemory/policies.js.map +1 -1
  30. package/cache/inmemory/reactiveVars.d.ts +1 -1
  31. package/cache/inmemory/reactiveVars.d.ts.map +1 -1
  32. package/cache/inmemory/readFromStore.d.ts +2 -2
  33. package/cache/inmemory/readFromStore.d.ts.map +1 -1
  34. package/cache/inmemory/readFromStore.js +1 -1
  35. package/cache/inmemory/readFromStore.js.map +1 -1
  36. package/cache/inmemory/types.d.ts +4 -4
  37. package/cache/inmemory/types.d.ts.map +1 -1
  38. package/cache/inmemory/writeToStore.d.ts +1 -1
  39. package/cache/inmemory/writeToStore.d.ts.map +1 -1
  40. package/cache/inmemory/writeToStore.js +1 -1
  41. package/cache/inmemory/writeToStore.js.map +1 -1
  42. package/core/ApolloClient.d.ts +5 -5
  43. package/core/ApolloClient.d.ts.map +1 -1
  44. package/core/ApolloClient.js +1 -1
  45. package/core/ApolloClient.js.map +1 -1
  46. package/core/LocalState.d.ts +9 -6
  47. package/core/LocalState.d.ts.map +1 -1
  48. package/core/LocalState.js +65 -15
  49. package/core/LocalState.js.map +1 -1
  50. package/core/ObservableQuery.d.ts +5 -5
  51. package/core/ObservableQuery.d.ts.map +1 -1
  52. package/core/ObservableQuery.js +2 -2
  53. package/core/ObservableQuery.js.map +1 -1
  54. package/core/QueryInfo.d.ts +1 -1
  55. package/core/QueryInfo.d.ts.map +1 -1
  56. package/core/QueryInfo.js +1 -1
  57. package/core/QueryInfo.js.map +1 -1
  58. package/core/QueryManager.d.ts +7 -7
  59. package/core/QueryManager.d.ts.map +1 -1
  60. package/core/QueryManager.js +19 -11
  61. package/core/QueryManager.js.map +1 -1
  62. package/core/core.cjs +113 -62
  63. package/core/core.cjs.map +1 -1
  64. package/core/core.cjs.native.js +113 -62
  65. package/core/index.js +2 -2
  66. package/core/index.js.map +1 -1
  67. package/core/types.d.ts +18 -17
  68. package/core/types.d.ts.map +1 -1
  69. package/core/types.js +1 -0
  70. package/core/types.js.map +1 -1
  71. package/core/watchQueryOptions.d.ts +11 -11
  72. package/core/watchQueryOptions.d.ts.map +1 -1
  73. package/core/watchQueryOptions.js.map +1 -1
  74. package/errors/index.d.ts +2 -2
  75. package/errors/index.d.ts.map +1 -1
  76. package/invariantErrorCodes.js +33 -33
  77. package/link/batch/batch.cjs +5 -3
  78. package/link/batch/batch.cjs.map +1 -1
  79. package/link/batch/batch.cjs.native.js +5 -3
  80. package/link/batch/batching.d.ts +2 -2
  81. package/link/batch/batching.d.ts.map +1 -1
  82. package/link/batch/batching.js +5 -3
  83. package/link/batch/batching.js.map +1 -1
  84. package/link/context/index.d.ts +2 -1
  85. package/link/context/index.d.ts.map +1 -1
  86. package/link/context/index.js.map +1 -1
  87. package/link/core/ApolloLink.js +2 -2
  88. package/link/core/core.cjs +2 -2
  89. package/link/core/core.cjs.map +1 -1
  90. package/link/core/core.cjs.native.js +2 -2
  91. package/link/core/types.d.ts +13 -12
  92. package/link/core/types.d.ts.map +1 -1
  93. package/link/core/types.js.map +1 -1
  94. package/link/http/checkFetcher.js +2 -2
  95. package/link/http/createHttpLink.d.ts +0 -1
  96. package/link/http/createHttpLink.d.ts.map +1 -1
  97. package/link/http/createHttpLink.js +2 -1
  98. package/link/http/createHttpLink.js.map +1 -1
  99. package/link/http/http.cjs +13 -38
  100. package/link/http/http.cjs.map +1 -1
  101. package/link/http/http.cjs.native.js +13 -38
  102. package/link/http/iterators/async.js.map +1 -1
  103. package/link/http/iterators/nodeStream.js.map +1 -1
  104. package/link/http/iterators/promise.js.map +1 -1
  105. package/link/http/iterators/reader.js.map +1 -1
  106. package/link/http/parseAndCheckHttpResponse.d.ts +2 -2
  107. package/link/http/parseAndCheckHttpResponse.d.ts.map +1 -1
  108. package/link/http/parseAndCheckHttpResponse.js.map +1 -1
  109. package/link/http/responseIterator.js +1 -1
  110. package/link/http/responseIterator.js.map +1 -1
  111. package/link/http/selectHttpOptionsAndBody.d.ts +2 -2
  112. package/link/http/selectHttpOptionsAndBody.d.ts.map +1 -1
  113. package/link/http/selectHttpOptionsAndBody.js +3 -1
  114. package/link/http/selectHttpOptionsAndBody.js.map +1 -1
  115. package/link/http/serializeFetchParameter.d.ts +1 -1
  116. package/link/http/serializeFetchParameter.d.ts.map +1 -1
  117. package/link/http/serializeFetchParameter.js +2 -2
  118. package/link/persisted-queries/index.d.ts +2 -2
  119. package/link/persisted-queries/index.d.ts.map +1 -1
  120. package/link/persisted-queries/index.js +3 -3
  121. package/link/persisted-queries/persisted-queries.cjs +3 -3
  122. package/link/persisted-queries/persisted-queries.cjs.map +1 -1
  123. package/link/persisted-queries/persisted-queries.cjs.native.js +3 -3
  124. package/link/utils/throwServerError.d.ts +1 -1
  125. package/link/utils/throwServerError.d.ts.map +1 -1
  126. package/link/utils/toPromise.js +1 -1
  127. package/link/utils/utils.cjs +2 -2
  128. package/link/utils/utils.cjs.map +1 -1
  129. package/link/utils/utils.cjs.native.js +2 -2
  130. package/link/utils/validateOperation.js +2 -2
  131. package/package.json +15 -15
  132. package/react/cache/SuspenseCache.d.ts +1 -1
  133. package/react/cache/SuspenseCache.d.ts.map +1 -1
  134. package/react/cache/SuspenseCache.js.map +1 -1
  135. package/react/components/Query.d.ts +2 -2
  136. package/react/components/Query.d.ts.map +1 -1
  137. package/react/components/Query.js.map +1 -1
  138. package/react/components/Subscription.d.ts +2 -2
  139. package/react/components/Subscription.d.ts.map +1 -1
  140. package/react/components/Subscription.js.map +1 -1
  141. package/react/components/types.d.ts +2 -2
  142. package/react/components/types.d.ts.map +1 -1
  143. package/react/components/types.js.map +1 -1
  144. package/react/context/ApolloConsumer.js +2 -2
  145. package/react/context/ApolloProvider.js +2 -2
  146. package/react/context/context.cjs +4 -4
  147. package/react/context/context.cjs.map +1 -1
  148. package/react/context/context.cjs.native.js +4 -4
  149. package/react/hoc/graphql.d.ts +2 -1
  150. package/react/hoc/graphql.d.ts.map +1 -1
  151. package/react/hoc/graphql.js.map +1 -1
  152. package/react/hoc/hoc-utils.d.ts +1 -1
  153. package/react/hoc/hoc-utils.d.ts.map +1 -1
  154. package/react/hoc/hoc-utils.js +2 -2
  155. package/react/hoc/hoc.cjs +4 -4
  156. package/react/hoc/hoc.cjs.map +1 -1
  157. package/react/hoc/hoc.cjs.native.js +4 -4
  158. package/react/hoc/mutation-hoc.d.ts +2 -2
  159. package/react/hoc/mutation-hoc.d.ts.map +1 -1
  160. package/react/hoc/mutation-hoc.js.map +1 -1
  161. package/react/hoc/query-hoc.d.ts +1 -1
  162. package/react/hoc/query-hoc.d.ts.map +1 -1
  163. package/react/hoc/query-hoc.js.map +1 -1
  164. package/react/hoc/subscription-hoc.d.ts +1 -1
  165. package/react/hoc/subscription-hoc.d.ts.map +1 -1
  166. package/react/hoc/subscription-hoc.js.map +1 -1
  167. package/react/hoc/types.d.ts +6 -6
  168. package/react/hoc/types.d.ts.map +1 -1
  169. package/react/hoc/types.js.map +1 -1
  170. package/react/hoc/withApollo.js +2 -2
  171. package/react/hooks/hooks.cjs +26 -32
  172. package/react/hooks/hooks.cjs.map +1 -1
  173. package/react/hooks/hooks.cjs.native.js +26 -32
  174. package/react/hooks/internal/useIsomorphicLayoutEffect.js +1 -1
  175. package/react/hooks/internal/useIsomorphicLayoutEffect.js.map +1 -1
  176. package/react/hooks/useApolloClient.js +2 -2
  177. package/react/hooks/useFragment.d.ts +4 -2
  178. package/react/hooks/useFragment.d.ts.map +1 -1
  179. package/react/hooks/useFragment.js +9 -8
  180. package/react/hooks/useFragment.js.map +1 -1
  181. package/react/hooks/useLazyQuery.d.ts +2 -2
  182. package/react/hooks/useLazyQuery.d.ts.map +1 -1
  183. package/react/hooks/useLazyQuery.js +3 -4
  184. package/react/hooks/useLazyQuery.js.map +1 -1
  185. package/react/hooks/useMutation.d.ts +2 -2
  186. package/react/hooks/useMutation.d.ts.map +1 -1
  187. package/react/hooks/useMutation.js.map +1 -1
  188. package/react/hooks/useQuery.d.ts +4 -4
  189. package/react/hooks/useQuery.d.ts.map +1 -1
  190. package/react/hooks/useQuery.js +1 -1
  191. package/react/hooks/useQuery.js.map +1 -1
  192. package/react/hooks/useSubscription.d.ts +2 -3
  193. package/react/hooks/useSubscription.d.ts.map +1 -1
  194. package/react/hooks/useSubscription.js +1 -2
  195. package/react/hooks/useSubscription.js.map +1 -1
  196. package/react/hooks/useSuspenseCache.js +2 -2
  197. package/react/hooks/useSuspenseQuery.d.ts +1 -1
  198. package/react/hooks/useSuspenseQuery.d.ts.map +1 -1
  199. package/react/hooks/useSuspenseQuery.js +2 -2
  200. package/react/hooks/useSuspenseQuery.js.map +1 -1
  201. package/react/hooks/useSyncExternalStore.d.ts +1 -1
  202. package/react/hooks/useSyncExternalStore.d.ts.map +1 -1
  203. package/react/hooks/useSyncExternalStore.js +1 -1
  204. package/react/hooks/useSyncExternalStore.js.map +1 -1
  205. package/react/parser/index.js +6 -6
  206. package/react/parser/parser.cjs +10 -10
  207. package/react/parser/parser.cjs.map +1 -1
  208. package/react/parser/parser.cjs.native.js +10 -10
  209. package/react/ssr/RenderPromises.d.ts +4 -4
  210. package/react/ssr/RenderPromises.d.ts.map +1 -1
  211. package/react/ssr/RenderPromises.js.map +1 -1
  212. package/react/ssr/getDataFromTree.d.ts +1 -1
  213. package/react/ssr/getDataFromTree.d.ts.map +1 -1
  214. package/react/types/types.d.ts +24 -23
  215. package/react/types/types.d.ts.map +1 -1
  216. package/react/types/types.js.map +1 -1
  217. package/testing/core/core.cjs +13 -3
  218. package/testing/core/core.cjs.map +1 -1
  219. package/testing/core/core.cjs.native.js +13 -3
  220. package/testing/core/index.d.ts +1 -1
  221. package/testing/core/index.d.ts.map +1 -1
  222. package/testing/core/index.js.map +1 -1
  223. package/testing/core/mocking/mockFetch.js.map +1 -1
  224. package/testing/core/mocking/mockLink.d.ts +8 -4
  225. package/testing/core/mocking/mockLink.d.ts.map +1 -1
  226. package/testing/core/mocking/mockLink.js +14 -4
  227. package/testing/core/mocking/mockLink.js.map +1 -1
  228. package/testing/core/mocking/mockQueryManager.d.ts +1 -1
  229. package/testing/core/mocking/mockQueryManager.d.ts.map +1 -1
  230. package/testing/core/mocking/mockQueryManager.js +3 -3
  231. package/testing/core/mocking/mockQueryManager.js.map +1 -1
  232. package/testing/core/mocking/mockWatchQuery.d.ts +1 -1
  233. package/testing/core/mocking/mockWatchQuery.d.ts.map +1 -1
  234. package/testing/core/mocking/mockWatchQuery.js +4 -5
  235. package/testing/core/mocking/mockWatchQuery.js.map +1 -1
  236. package/testing/core/observableToPromise.d.ts +2 -2
  237. package/testing/core/observableToPromise.d.ts.map +1 -1
  238. package/testing/core/observableToPromise.js.map +1 -1
  239. package/testing/react/MockedProvider.d.ts +1 -0
  240. package/testing/react/MockedProvider.d.ts.map +1 -1
  241. package/testing/react/MockedProvider.js +2 -2
  242. package/testing/react/MockedProvider.js.map +1 -1
  243. package/testing/testing.cjs +2 -2
  244. package/testing/testing.cjs.map +1 -1
  245. package/testing/testing.cjs.native.js +2 -2
  246. package/utilities/common/cloneDeep.js.map +1 -1
  247. package/utilities/common/errorHandling.d.ts +2 -2
  248. package/utilities/common/errorHandling.d.ts.map +1 -1
  249. package/utilities/common/errorHandling.js.map +1 -1
  250. package/utilities/common/incrementalResult.d.ts +4 -4
  251. package/utilities/common/incrementalResult.d.ts.map +1 -1
  252. package/utilities/common/incrementalResult.js.map +1 -1
  253. package/utilities/common/maybeDeepFreeze.d.ts +0 -1
  254. package/utilities/common/maybeDeepFreeze.d.ts.map +1 -1
  255. package/utilities/common/maybeDeepFreeze.js +1 -1
  256. package/utilities/common/maybeDeepFreeze.js.map +1 -1
  257. package/utilities/common/mergeDeep.d.ts +2 -2
  258. package/utilities/common/mergeDeep.d.ts.map +1 -1
  259. package/utilities/common/mergeOptions.d.ts +3 -3
  260. package/utilities/common/mergeOptions.d.ts.map +1 -1
  261. package/utilities/common/mergeOptions.js.map +1 -1
  262. package/utilities/globals/DEV.d.ts +1 -1
  263. package/utilities/globals/DEV.d.ts.map +1 -1
  264. package/utilities/globals/DEV.js +1 -17
  265. package/utilities/globals/DEV.js.map +1 -1
  266. package/utilities/globals/global.d.ts +5 -2
  267. package/utilities/globals/global.d.ts.map +1 -1
  268. package/utilities/globals/global.js.map +1 -1
  269. package/utilities/globals/globals.cjs +5 -22
  270. package/utilities/globals/globals.cjs.map +1 -1
  271. package/utilities/globals/globals.cjs.native.js +5 -22
  272. package/utilities/globals/index.d.ts +1 -1
  273. package/utilities/globals/index.d.ts.map +1 -1
  274. package/utilities/globals/index.js +1 -4
  275. package/utilities/globals/index.js.map +1 -1
  276. package/utilities/graphql/directives.d.ts +2 -2
  277. package/utilities/graphql/directives.d.ts.map +1 -1
  278. package/utilities/graphql/directives.js +1 -1
  279. package/utilities/graphql/directives.js.map +1 -1
  280. package/utilities/graphql/fragments.d.ts +1 -1
  281. package/utilities/graphql/fragments.d.ts.map +1 -1
  282. package/utilities/graphql/fragments.js +1 -1
  283. package/utilities/graphql/getFromAST.js +1 -1
  284. package/utilities/graphql/storeUtils.d.ts +3 -3
  285. package/utilities/graphql/storeUtils.d.ts.map +1 -1
  286. package/utilities/graphql/storeUtils.js +1 -1
  287. package/utilities/graphql/storeUtils.js.map +1 -1
  288. package/utilities/graphql/transform.d.ts +9 -9
  289. package/utilities/graphql/transform.d.ts.map +1 -1
  290. package/utilities/graphql/transform.js +1 -1
  291. package/utilities/graphql/transform.js.map +1 -1
  292. package/utilities/index.d.ts +2 -0
  293. package/utilities/index.d.ts.map +1 -1
  294. package/utilities/index.js +2 -0
  295. package/utilities/index.js.map +1 -1
  296. package/utilities/observables/Concast.d.ts +5 -5
  297. package/utilities/observables/Concast.d.ts.map +1 -1
  298. package/utilities/observables/asyncMap.js.map +1 -1
  299. package/utilities/policies/pagination.d.ts +7 -7
  300. package/utilities/policies/pagination.d.ts.map +1 -1
  301. package/utilities/policies/pagination.js.map +1 -1
  302. package/utilities/types/IsStrictlyAny.d.ts +3 -3
  303. package/utilities/types/IsStrictlyAny.d.ts.map +1 -1
  304. package/utilities/utilities.cjs +75 -19
  305. package/utilities/utilities.cjs.map +1 -1
  306. package/utilities/utilities.cjs.native.js +75 -19
  307. package/version.js +1 -1
@@ -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
- __DEV__ ? globals.invariant(evaledValue !== void 0, "Invalid variable referenced in @".concat(directive.name.value, " directive.")) : globals.invariant(evaledValue !== void 0, 41);
21
+ globals.__DEV__ ? globals.invariant(evaledValue !== void 0, "Invalid variable referenced in @".concat(directive.name.value, " directive.")) : globals.invariant(evaledValue !== void 0, 41);
22
22
  }
23
23
  else {
24
24
  evaledValue = ifArgument.value.value;
@@ -65,11 +65,11 @@ function getInclusionDirectives(directives) {
65
65
  return;
66
66
  var directiveArguments = directive.arguments;
67
67
  var directiveName = directive.name.value;
68
- __DEV__ ? globals.invariant(directiveArguments && directiveArguments.length === 1, "Incorrect number of arguments for the @".concat(directiveName, " directive.")) : globals.invariant(directiveArguments && directiveArguments.length === 1, 42);
68
+ globals.__DEV__ ? globals.invariant(directiveArguments && directiveArguments.length === 1, "Incorrect number of arguments for the @".concat(directiveName, " directive.")) : globals.invariant(directiveArguments && directiveArguments.length === 1, 42);
69
69
  var ifArgument = directiveArguments[0];
70
- __DEV__ ? globals.invariant(ifArgument.name && ifArgument.name.value === 'if', "Invalid argument for the @".concat(directiveName, " directive.")) : globals.invariant(ifArgument.name && ifArgument.name.value === 'if', 43);
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', 43);
71
71
  var ifValue = ifArgument.value;
72
- __DEV__ ? globals.invariant(ifValue &&
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
74
  (ifValue.kind === 'Variable' || ifValue.kind === 'BooleanValue'), 44);
75
75
  result.push({ directive: directive, ifArgument: ifArgument });
@@ -83,7 +83,7 @@ function getFragmentQueryDocument(document, fragmentName) {
83
83
  var fragments = [];
84
84
  document.definitions.forEach(function (definition) {
85
85
  if (definition.kind === 'OperationDefinition') {
86
- throw __DEV__ ? new globals.InvariantError("Found a ".concat(definition.operation, " operation").concat(definition.name ? " named '".concat(definition.name.value, "'") : '', ". ") +
86
+ throw globals.__DEV__ ? new globals.InvariantError("Found a ".concat(definition.operation, " operation").concat(definition.name ? " named '".concat(definition.name.value, "'") : '', ". ") +
87
87
  'No operations are allowed when using a fragment as a query. Only fragments are allowed.') : new globals.InvariantError(45);
88
88
  }
89
89
  if (definition.kind === 'FragmentDefinition') {
@@ -91,7 +91,7 @@ function getFragmentQueryDocument(document, fragmentName) {
91
91
  }
92
92
  });
93
93
  if (typeof actualFragmentName === 'undefined') {
94
- __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, 46);
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, 46);
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
- __DEV__ ? globals.invariant(fragment, "No fragment named ".concat(fragmentName)) : globals.invariant(fragment, 47);
135
+ globals.__DEV__ ? globals.invariant(fragment, "No fragment named ".concat(fragmentName)) : globals.invariant(fragment, 47);
136
136
  return fragment || null;
137
137
  }
138
138
  default:
@@ -214,7 +214,7 @@ function valueToObjectRepresentation(argObj, name, value, variables) {
214
214
  argObj[name.value] = null;
215
215
  }
216
216
  else {
217
- throw __DEV__ ? new globals.InvariantError("The inline argument \"".concat(name.value, "\" of kind \"").concat(value.kind, "\"") +
217
+ throw globals.__DEV__ ? new globals.InvariantError("The inline argument \"".concat(name.value, "\" of kind \"").concat(value.kind, "\"") +
218
218
  'is not supported. Use variables instead of inline arguments to ' +
219
219
  'overcome this limitation.') : new globals.InvariantError(56);
220
220
  }
@@ -350,16 +350,16 @@ function isInlineFragment(selection) {
350
350
  }
351
351
 
352
352
  function checkDocument(doc) {
353
- __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', 48);
353
+ 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', 48);
354
354
  var operations = doc.definitions
355
355
  .filter(function (d) { return d.kind !== 'FragmentDefinition'; })
356
356
  .map(function (definition) {
357
357
  if (definition.kind !== 'OperationDefinition') {
358
- throw __DEV__ ? new globals.InvariantError("Schema type definitions not allowed in queries. Found: \"".concat(definition.kind, "\"")) : new globals.InvariantError(49);
358
+ throw globals.__DEV__ ? new globals.InvariantError("Schema type definitions not allowed in queries. Found: \"".concat(definition.kind, "\"")) : new globals.InvariantError(49);
359
359
  }
360
360
  return definition;
361
361
  });
362
- __DEV__ ? globals.invariant(operations.length <= 1, "Ambiguous GraphQL document: contains ".concat(operations.length, " operations")) : globals.invariant(operations.length <= 1, 50);
362
+ globals.__DEV__ ? globals.invariant(operations.length <= 1, "Ambiguous GraphQL document: contains ".concat(operations.length, " operations")) : globals.invariant(operations.length <= 1, 50);
363
363
  return doc;
364
364
  }
365
365
  function getOperationDefinition(doc) {
@@ -378,14 +378,14 @@ function getFragmentDefinitions(doc) {
378
378
  }
379
379
  function getQueryDefinition(doc) {
380
380
  var queryDef = getOperationDefinition(doc);
381
- __DEV__ ? globals.invariant(queryDef && queryDef.operation === 'query', 'Must contain a query definition.') : globals.invariant(queryDef && queryDef.operation === 'query', 51);
381
+ globals.__DEV__ ? globals.invariant(queryDef && queryDef.operation === 'query', 'Must contain a query definition.') : globals.invariant(queryDef && queryDef.operation === 'query', 51);
382
382
  return queryDef;
383
383
  }
384
384
  function getFragmentDefinition(doc) {
385
- __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', 52);
386
- __DEV__ ? globals.invariant(doc.definitions.length <= 1, 'Fragment must have exactly one definition.') : globals.invariant(doc.definitions.length <= 1, 53);
385
+ 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', 52);
386
+ globals.__DEV__ ? globals.invariant(doc.definitions.length <= 1, 'Fragment must have exactly one definition.') : globals.invariant(doc.definitions.length <= 1, 53);
387
387
  var fragmentDef = doc.definitions[0];
388
- __DEV__ ? globals.invariant(fragmentDef.kind === 'FragmentDefinition', 'Must be a fragment definition.') : globals.invariant(fragmentDef.kind === 'FragmentDefinition', 54);
388
+ globals.__DEV__ ? globals.invariant(fragmentDef.kind === 'FragmentDefinition', 'Must be a fragment definition.') : globals.invariant(fragmentDef.kind === 'FragmentDefinition', 54);
389
389
  return fragmentDef;
390
390
  }
391
391
  function getMainDefinition(queryDoc) {
@@ -408,7 +408,7 @@ function getMainDefinition(queryDoc) {
408
408
  if (fragmentDefinition) {
409
409
  return fragmentDefinition;
410
410
  }
411
- throw __DEV__ ? new globals.InvariantError('Expected a parsed GraphQL query with a query, mutation, subscription, or a fragment.') : new globals.InvariantError(55);
411
+ throw globals.__DEV__ ? new globals.InvariantError('Expected a parsed GraphQL query with a query, mutation, subscription, or a fragment.') : new globals.InvariantError(55);
412
412
  }
413
413
  function getDefaultValues(definition) {
414
414
  var defaultValues = Object.create(null);
@@ -564,7 +564,7 @@ var connectionRemoveConfig = {
564
564
  if (willRemove) {
565
565
  if (!directive.arguments ||
566
566
  !directive.arguments.some(function (arg) { return arg.name.value === 'key'; })) {
567
- __DEV__ && globals.invariant.warn('Removing an @connection directive even though it does not have a key. ' +
567
+ globals.__DEV__ && globals.invariant.warn('Removing an @connection directive even though it does not have a key. ' +
568
568
  'You may want to use the key parameter to specify a store key.');
569
569
  }
570
570
  }
@@ -955,7 +955,7 @@ function deepFreeze(value) {
955
955
  return value;
956
956
  }
957
957
  function shallowFreeze(obj) {
958
- if (__DEV__ && !Object.isFrozen(obj)) {
958
+ if (globals.__DEV__ && !Object.isFrozen(obj)) {
959
959
  try {
960
960
  Object.freeze(obj);
961
961
  }
@@ -968,7 +968,7 @@ function shallowFreeze(obj) {
968
968
  return obj;
969
969
  }
970
970
  function maybeDeepFreeze(obj) {
971
- if (__DEV__) {
971
+ if (globals.__DEV__) {
972
972
  deepFreeze(obj);
973
973
  }
974
974
  return obj;
@@ -1188,6 +1188,32 @@ function isNonEmptyArray(value) {
1188
1188
  function isExecutionPatchIncrementalResult(value) {
1189
1189
  return "incremental" in value;
1190
1190
  }
1191
+ function isExecutionPatchInitialResult(value) {
1192
+ return "hasNext" in value && "data" in value;
1193
+ }
1194
+ function isExecutionPatchResult(value) {
1195
+ return (isExecutionPatchIncrementalResult(value) ||
1196
+ isExecutionPatchInitialResult(value));
1197
+ }
1198
+ function mergeIncrementalData(prevResult, result) {
1199
+ var mergedData = prevResult;
1200
+ var merger = new DeepMerger();
1201
+ if (isExecutionPatchIncrementalResult(result) &&
1202
+ isNonEmptyArray(result.incremental)) {
1203
+ result.incremental.forEach(function (_a) {
1204
+ var data = _a.data, path = _a.path;
1205
+ for (var i = path.length - 1; i >= 0; --i) {
1206
+ var key = path[i];
1207
+ var isNumericKey = !isNaN(+key);
1208
+ var parent_1 = isNumericKey ? [] : {};
1209
+ parent_1[key] = data;
1210
+ data = parent_1;
1211
+ }
1212
+ mergedData = merger.merge(mergedData, data);
1213
+ });
1214
+ }
1215
+ return mergedData;
1216
+ }
1191
1217
 
1192
1218
  function graphQLResultHasError(result) {
1193
1219
  var errors = getGraphQLErrorsFromResult(result);
@@ -1247,6 +1273,26 @@ function mergeOptions(defaults, options) {
1247
1273
  });
1248
1274
  }
1249
1275
 
1276
+ function isNodeResponse(value) {
1277
+ return !!value.body;
1278
+ }
1279
+ function isReadableStream(value) {
1280
+ return !!value.getReader;
1281
+ }
1282
+ function isAsyncIterableIterator(value) {
1283
+ return !!(canUseAsyncIteratorSymbol &&
1284
+ value[Symbol.asyncIterator]);
1285
+ }
1286
+ function isStreamableBlob(value) {
1287
+ return !!value.stream;
1288
+ }
1289
+ function isBlob(value) {
1290
+ return !!value.arrayBuffer;
1291
+ }
1292
+ function isNodeReadableStream(value) {
1293
+ return !!value.pipe;
1294
+ }
1295
+
1250
1296
  exports.DEV = globals.DEV;
1251
1297
  exports.maybe = globals.maybe;
1252
1298
  exports.Observable = zenObservableTs.Observable;
@@ -1287,18 +1333,28 @@ exports.hasAllDirectives = hasAllDirectives;
1287
1333
  exports.hasAnyDirectives = hasAnyDirectives;
1288
1334
  exports.hasClientExports = hasClientExports;
1289
1335
  exports.hasDirectives = hasDirectives;
1336
+ exports.isAsyncIterableIterator = isAsyncIterableIterator;
1337
+ exports.isBlob = isBlob;
1290
1338
  exports.isDocumentNode = isDocumentNode;
1339
+ exports.isExecutionPatchIncrementalResult = isExecutionPatchIncrementalResult;
1340
+ exports.isExecutionPatchInitialResult = isExecutionPatchInitialResult;
1341
+ exports.isExecutionPatchResult = isExecutionPatchResult;
1291
1342
  exports.isField = isField;
1292
1343
  exports.isInlineFragment = isInlineFragment;
1344
+ exports.isNodeReadableStream = isNodeReadableStream;
1345
+ exports.isNodeResponse = isNodeResponse;
1293
1346
  exports.isNonEmptyArray = isNonEmptyArray;
1294
1347
  exports.isNonNullObject = isNonNullObject;
1348
+ exports.isReadableStream = isReadableStream;
1295
1349
  exports.isReference = isReference;
1350
+ exports.isStreamableBlob = isStreamableBlob;
1296
1351
  exports.iterateObserversSafely = iterateObserversSafely;
1297
1352
  exports.makeReference = makeReference;
1298
1353
  exports.makeUniqueId = makeUniqueId;
1299
1354
  exports.maybeDeepFreeze = maybeDeepFreeze;
1300
1355
  exports.mergeDeep = mergeDeep;
1301
1356
  exports.mergeDeepArray = mergeDeepArray;
1357
+ exports.mergeIncrementalData = mergeIncrementalData;
1302
1358
  exports.mergeOptions = mergeOptions;
1303
1359
  exports.offsetLimitPagination = offsetLimitPagination;
1304
1360
  exports.relayStylePagination = relayStylePagination;
package/version.js CHANGED
@@ -1,2 +1,2 @@
1
- export var version = '3.8.0-alpha.5';
1
+ export var version = '3.8.0-alpha.7';
2
2
  //# sourceMappingURL=version.js.map