@apollo/client 3.4.0-rc.7 → 3.4.1

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 (234) hide show
  1. package/apollo-client.cjs.js +300 -263
  2. package/apollo-client.cjs.js.map +1 -1
  3. package/apollo-client.cjs.min.js +1 -1
  4. package/cache/cache.cjs.js +105 -41
  5. package/cache/cache.cjs.js.map +1 -1
  6. package/cache/core/types/DataProxy.js +1 -0
  7. package/cache/index.d.ts +0 -1
  8. package/cache/index.d.ts.map +1 -1
  9. package/cache/index.js +3 -1
  10. package/cache/index.js.map +1 -1
  11. package/cache/inmemory/entityStore.d.ts +3 -2
  12. package/cache/inmemory/entityStore.d.ts.map +1 -1
  13. package/cache/inmemory/entityStore.js +22 -10
  14. package/cache/inmemory/entityStore.js.map +1 -1
  15. package/cache/inmemory/fixPolyfills.native.js +1 -0
  16. package/cache/inmemory/helpers.d.ts +1 -1
  17. package/cache/inmemory/helpers.d.ts.map +1 -1
  18. package/cache/inmemory/inMemoryCache.d.ts +5 -1
  19. package/cache/inmemory/inMemoryCache.d.ts.map +1 -1
  20. package/cache/inmemory/inMemoryCache.js +24 -3
  21. package/cache/inmemory/inMemoryCache.js.map +1 -1
  22. package/cache/inmemory/object-canon.d.ts +3 -1
  23. package/cache/inmemory/object-canon.d.ts.map +1 -1
  24. package/cache/inmemory/object-canon.js +12 -7
  25. package/cache/inmemory/object-canon.js.map +1 -1
  26. package/cache/inmemory/policies.d.ts.map +1 -1
  27. package/cache/inmemory/policies.js +23 -10
  28. package/cache/inmemory/policies.js.map +1 -1
  29. package/cache/inmemory/readFromStore.d.ts +5 -2
  30. package/cache/inmemory/readFromStore.d.ts.map +1 -1
  31. package/cache/inmemory/readFromStore.js +9 -6
  32. package/cache/inmemory/readFromStore.js.map +1 -1
  33. package/cache/inmemory/types.js +1 -0
  34. package/cache/inmemory/writeToStore.d.ts +1 -0
  35. package/cache/inmemory/writeToStore.d.ts.map +1 -1
  36. package/cache/inmemory/writeToStore.js +16 -7
  37. package/cache/inmemory/writeToStore.js.map +1 -1
  38. package/core/ApolloClient.d.ts.map +1 -1
  39. package/core/ApolloClient.js +3 -0
  40. package/core/ApolloClient.js.map +1 -1
  41. package/core/LocalState.js +2 -4
  42. package/core/LocalState.js.map +1 -1
  43. package/core/ObservableQuery.d.ts +7 -6
  44. package/core/ObservableQuery.d.ts.map +1 -1
  45. package/core/ObservableQuery.js +116 -78
  46. package/core/ObservableQuery.js.map +1 -1
  47. package/core/QueryInfo.d.ts +0 -1
  48. package/core/QueryInfo.d.ts.map +1 -1
  49. package/core/QueryInfo.js +3 -6
  50. package/core/QueryInfo.js.map +1 -1
  51. package/core/QueryManager.d.ts +3 -3
  52. package/core/QueryManager.d.ts.map +1 -1
  53. package/core/QueryManager.js +13 -10
  54. package/core/QueryManager.js.map +1 -1
  55. package/core/core.cjs.js +137 -181
  56. package/core/core.cjs.js.map +1 -1
  57. package/core/index.d.ts +0 -1
  58. package/core/index.d.ts.map +1 -1
  59. package/core/index.js +2 -2
  60. package/core/index.js.map +1 -1
  61. package/core/types.d.ts +4 -1
  62. package/core/types.d.ts.map +1 -1
  63. package/core/types.js +1 -0
  64. package/core/types.js.map +1 -1
  65. package/core/watchQueryOptions.js +1 -0
  66. package/errors/errors.cjs.js +2 -0
  67. package/errors/errors.cjs.js.map +1 -1
  68. package/errors/index.d.ts.map +1 -1
  69. package/errors/index.js +3 -0
  70. package/errors/index.js.map +1 -1
  71. package/invariantErrorCodes.js +82 -57
  72. package/link/context/context.cjs.js +4 -0
  73. package/link/context/context.cjs.js.map +1 -1
  74. package/link/context/index.d.ts.map +1 -1
  75. package/link/context/index.js +4 -0
  76. package/link/context/index.js.map +1 -1
  77. package/link/core/ApolloLink.js +1 -1
  78. package/link/core/core.cjs.js +4 -2
  79. package/link/core/core.cjs.js.map +1 -1
  80. package/link/core/index.d.ts.map +1 -1
  81. package/link/core/index.js +3 -0
  82. package/link/core/index.js.map +1 -1
  83. package/link/core/types.js +1 -0
  84. package/link/http/checkFetcher.js +1 -1
  85. package/link/http/http.cjs.js +13 -3
  86. package/link/http/http.cjs.js.map +1 -1
  87. package/link/http/selectHttpOptionsAndBody.d.ts.map +1 -1
  88. package/link/http/selectHttpOptionsAndBody.js +11 -1
  89. package/link/http/selectHttpOptionsAndBody.js.map +1 -1
  90. package/link/http/serializeFetchParameter.js +1 -1
  91. package/link/persisted-queries/index.d.ts.map +1 -1
  92. package/link/persisted-queries/index.js +2 -2
  93. package/link/persisted-queries/persisted-queries.cjs.js +2 -2
  94. package/link/persisted-queries/persisted-queries.cjs.js.map +1 -1
  95. package/link/utils/utils.cjs.js +1 -1
  96. package/link/utils/utils.cjs.js.map +1 -1
  97. package/link/utils/validateOperation.js +1 -1
  98. package/package.json +20 -20
  99. package/react/components/Mutation.d.ts +1 -1
  100. package/react/components/Query.js +1 -1
  101. package/react/components/Query.js.map +1 -1
  102. package/react/components/components.cjs.js +45 -31
  103. package/react/components/components.cjs.js.map +1 -1
  104. package/react/components/types.js +1 -0
  105. package/react/context/ApolloConsumer.js +1 -1
  106. package/react/context/ApolloProvider.js +1 -1
  107. package/react/context/context.cjs.js +22 -8
  108. package/react/context/context.cjs.js.map +1 -1
  109. package/react/data/OperationData.js +2 -2
  110. package/react/data/QueryData.d.ts +1 -2
  111. package/react/data/QueryData.d.ts.map +1 -1
  112. package/react/data/QueryData.js +65 -72
  113. package/react/data/QueryData.js.map +1 -1
  114. package/react/data/data.cjs.js +65 -71
  115. package/react/data/data.cjs.js.map +1 -1
  116. package/react/hoc/hoc-utils.d.ts +2 -1
  117. package/react/hoc/hoc-utils.d.ts.map +1 -1
  118. package/react/hoc/hoc-utils.js +1 -1
  119. package/react/hoc/hoc.cjs.js +35 -18
  120. package/react/hoc/hoc.cjs.js.map +1 -1
  121. package/react/hoc/mutation-hoc.d.ts.map +1 -1
  122. package/react/hoc/query-hoc.d.ts.map +1 -1
  123. package/react/hoc/subscription-hoc.d.ts.map +1 -1
  124. package/react/hoc/types.js +1 -0
  125. package/react/hoc/withApollo.js +1 -1
  126. package/react/hooks/hooks.cjs.js +56 -10
  127. package/react/hooks/hooks.cjs.js.map +1 -1
  128. package/react/hooks/useApolloClient.js +1 -1
  129. package/react/hooks/useSubscription.d.ts.map +1 -1
  130. package/react/hooks/useSubscription.js +16 -6
  131. package/react/hooks/useSubscription.js.map +1 -1
  132. package/react/hooks/utils/useAfterFastRefresh.d.ts +2 -0
  133. package/react/hooks/utils/useAfterFastRefresh.d.ts.map +1 -0
  134. package/react/hooks/utils/useAfterFastRefresh.js +18 -0
  135. package/react/hooks/utils/useAfterFastRefresh.js.map +1 -0
  136. package/react/hooks/utils/useBaseQuery.d.ts.map +1 -1
  137. package/react/hooks/utils/useBaseQuery.js +10 -3
  138. package/react/hooks/utils/useBaseQuery.js.map +1 -1
  139. package/react/index.d.ts +0 -1
  140. package/react/index.d.ts.map +1 -1
  141. package/react/index.js +3 -1
  142. package/react/index.js.map +1 -1
  143. package/react/parser/index.js +4 -4
  144. package/react/parser/parser.cjs.js +4 -4
  145. package/react/parser/parser.cjs.js.map +1 -1
  146. package/react/react.cjs.js +2 -2
  147. package/react/react.cjs.js.map +1 -1
  148. package/react/ssr/ssr.cjs.js +15 -1
  149. package/react/ssr/ssr.cjs.js.map +1 -1
  150. package/react/types/types.d.ts +9 -3
  151. package/react/types/types.d.ts.map +1 -1
  152. package/react/types/types.js +1 -0
  153. package/react/types/types.js.map +1 -1
  154. package/testing/index.d.ts.map +1 -1
  155. package/testing/index.js +3 -0
  156. package/testing/index.js.map +1 -1
  157. package/testing/testing.cjs.js +68 -17
  158. package/testing/testing.cjs.js.map +1 -1
  159. package/utilities/common/canUse.d.ts +1 -0
  160. package/utilities/common/canUse.d.ts.map +1 -1
  161. package/utilities/common/canUse.js +1 -0
  162. package/utilities/common/canUse.js.map +1 -1
  163. package/utilities/common/global.d.ts.map +1 -1
  164. package/utilities/common/mergeDeep.js +2 -2
  165. package/utilities/common/mergeDeep.js.map +1 -1
  166. package/utilities/common/stringifyForDisplay.d.ts +2 -0
  167. package/utilities/common/stringifyForDisplay.d.ts.map +1 -0
  168. package/utilities/common/stringifyForDisplay.js +8 -0
  169. package/utilities/common/stringifyForDisplay.js.map +1 -0
  170. package/utilities/globals/DEV.d.ts +3 -0
  171. package/utilities/globals/DEV.d.ts.map +1 -0
  172. package/utilities/globals/DEV.js +20 -0
  173. package/utilities/globals/DEV.js.map +1 -0
  174. package/utilities/globals/graphql.d.ts +1 -1
  175. package/utilities/globals/graphql.d.ts.map +1 -1
  176. package/utilities/globals/graphql.js +3 -3
  177. package/utilities/globals/graphql.js.map +1 -1
  178. package/utilities/globals/index.d.ts +4 -2
  179. package/utilities/globals/index.d.ts.map +1 -1
  180. package/utilities/globals/index.js +5 -4
  181. package/utilities/globals/index.js.map +1 -1
  182. package/utilities/graphql/directives.js +4 -4
  183. package/utilities/graphql/fragments.js +5 -5
  184. package/utilities/graphql/getFromAST.js +8 -8
  185. package/utilities/graphql/storeUtils.d.ts.map +1 -1
  186. package/utilities/graphql/storeUtils.js +1 -1
  187. package/utilities/graphql/transform.js +2 -2
  188. package/utilities/graphql/transform.js.map +1 -1
  189. package/utilities/index.d.ts +3 -1
  190. package/utilities/index.d.ts.map +1 -1
  191. package/utilities/index.js +5 -1
  192. package/utilities/index.js.map +1 -1
  193. package/utilities/package.json +3 -1
  194. package/utilities/policies/pagination.d.ts.map +1 -1
  195. package/utilities/policies/pagination.js +10 -11
  196. package/utilities/policies/pagination.js.map +1 -1
  197. package/utilities/testing/index.d.ts +1 -0
  198. package/utilities/testing/index.d.ts.map +1 -1
  199. package/utilities/testing/index.js +1 -0
  200. package/utilities/testing/index.js.map +1 -1
  201. package/utilities/testing/itAsync.d.ts +5 -8
  202. package/utilities/testing/itAsync.d.ts.map +1 -1
  203. package/utilities/testing/itAsync.js +6 -7
  204. package/utilities/testing/itAsync.js.map +1 -1
  205. package/utilities/testing/mocking/mockFetch.js +2 -2
  206. package/utilities/testing/mocking/mockFetch.js.map +1 -1
  207. package/utilities/testing/mocking/mockLink.d.ts.map +1 -1
  208. package/utilities/testing/mocking/mockLink.js +2 -8
  209. package/utilities/testing/mocking/mockLink.js.map +1 -1
  210. package/utilities/testing/mocking/mockWatchQuery.d.ts.map +1 -1
  211. package/utilities/testing/mocking/mockWatchQuery.js +2 -2
  212. package/utilities/testing/mocking/mockWatchQuery.js.map +1 -1
  213. package/utilities/testing/observableToPromise.js +2 -2
  214. package/utilities/testing/observableToPromise.js.map +1 -1
  215. package/utilities/testing/withConsoleSpy.d.ts +4 -0
  216. package/utilities/testing/withConsoleSpy.d.ts.map +1 -0
  217. package/utilities/testing/withConsoleSpy.js +39 -0
  218. package/utilities/testing/withConsoleSpy.js.map +1 -0
  219. package/utilities/types/IsStrictlyAny.js +1 -0
  220. package/utilities/utilities.cjs.js +56 -48
  221. package/utilities/utilities.cjs.js.map +1 -1
  222. package/version.js +1 -1
  223. package/core/Reobserver.d.ts +0 -18
  224. package/core/Reobserver.d.ts.map +0 -1
  225. package/core/Reobserver.js +0 -87
  226. package/core/Reobserver.js.map +0 -1
  227. package/utilities/globals/__DEV__.d.ts +0 -3
  228. package/utilities/globals/__DEV__.d.ts.map +0 -1
  229. package/utilities/globals/__DEV__.js +0 -32
  230. package/utilities/globals/__DEV__.js.map +0 -1
  231. package/utilities/globals/process.d.ts +0 -2
  232. package/utilities/globals/process.d.ts.map +0 -1
  233. package/utilities/globals/process.js +0 -31
  234. package/utilities/globals/process.js.map +0 -1
@@ -35,7 +35,7 @@ var GraphQLBase = (function (_super) {
35
35
  }
36
36
  GraphQLBase.prototype.getWrappedInstance = function () {
37
37
  __DEV__ ? invariant(this.withRef, "To access the wrapped instance, you need to specify " +
38
- "{ withRef: true } in the options") : invariant(this.withRef, 32);
38
+ "{ withRef: true } in the options") : invariant(this.withRef, 34);
39
39
  return this.wrappedInstance;
40
40
  };
41
41
  GraphQLBase.prototype.setWrappedInstance = function (ref) {
@@ -10,6 +10,23 @@ var components = require('../components');
10
10
  var tsInvariant = require('ts-invariant');
11
11
  var context = require('../context');
12
12
 
13
+ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e['default'] : e; }
14
+
15
+ function _interopNamespace(e) {
16
+ if (e && e.__esModule) return e;
17
+ var n = Object.create(null);
18
+ if (e) {
19
+ Object.keys(e).forEach(function (k) {
20
+ n[k] = e[k];
21
+ });
22
+ }
23
+ n['default'] = e;
24
+ return Object.freeze(n);
25
+ }
26
+
27
+ var React__namespace = /*#__PURE__*/_interopNamespace(React);
28
+ var hoistNonReactStatics__default = /*#__PURE__*/_interopDefaultLegacy(hoistNonReactStatics);
29
+
13
30
  var defaultMapPropsToOptions = function () { return ({}); };
14
31
  var defaultMapPropsToSkip = function () { return false; };
15
32
  function getDisplayName$1(WrappedComponent) {
@@ -43,14 +60,14 @@ var GraphQLBase = (function (_super) {
43
60
  }
44
61
  GraphQLBase.prototype.getWrappedInstance = function () {
45
62
  __DEV__ ? tsInvariant.invariant(this.withRef, "To access the wrapped instance, you need to specify " +
46
- "{ withRef: true } in the options") : tsInvariant.invariant(this.withRef, 32);
63
+ "{ withRef: true } in the options") : tsInvariant.invariant(this.withRef, 34);
47
64
  return this.wrappedInstance;
48
65
  };
49
66
  GraphQLBase.prototype.setWrappedInstance = function (ref) {
50
67
  this.wrappedInstance = ref;
51
68
  };
52
69
  return GraphQLBase;
53
- }(React.Component));
70
+ }(React__namespace.Component));
54
71
 
55
72
  function withQuery(document, operationOptions) {
56
73
  if (operationOptions === void 0) { operationOptions = {}; }
@@ -82,7 +99,7 @@ function withQuery(document, operationOptions) {
82
99
  if (!shouldSkip && !opts.variables && operation.variables.length > 0) {
83
100
  opts.variables = calculateVariablesFromProps(operation, props);
84
101
  }
85
- return (React.createElement(components.Query, tslib.__assign({}, opts, { displayName: graphQLDisplayName, skip: shouldSkip, query: document }), function (_a) {
102
+ return (React__namespace.createElement(components.Query, tslib.__assign({}, opts, { displayName: graphQLDisplayName, skip: shouldSkip, query: document }), function (_a) {
86
103
  var _b, _c;
87
104
  _a.client; var data = _a.data, r = tslib.__rest(_a, ["client", "data"]);
88
105
  if (operationOptions.withRef) {
@@ -92,7 +109,7 @@ function withQuery(document, operationOptions) {
92
109
  });
93
110
  }
94
111
  if (shouldSkip) {
95
- return (React.createElement(WrappedComponent, tslib.__assign({}, props, {})));
112
+ return (React__namespace.createElement(WrappedComponent, tslib.__assign({}, props, {})));
96
113
  }
97
114
  var result = Object.assign(r, data || {});
98
115
  var name = operationOptions.name || 'data';
@@ -105,14 +122,14 @@ function withQuery(document, operationOptions) {
105
122
  lastResultProps = operationOptions.props(newResult, lastResultProps);
106
123
  childProps = lastResultProps;
107
124
  }
108
- return (React.createElement(WrappedComponent, tslib.__assign({}, props, childProps)));
125
+ return (React__namespace.createElement(WrappedComponent, tslib.__assign({}, props, childProps)));
109
126
  }));
110
127
  };
111
128
  GraphQL.displayName = graphQLDisplayName;
112
129
  GraphQL.WrappedComponent = WrappedComponent;
113
130
  return GraphQL;
114
131
  }(GraphQLBase));
115
- return hoistNonReactStatics['default'](GraphQL, WrappedComponent, {});
132
+ return hoistNonReactStatics__default(GraphQL, WrappedComponent, {});
116
133
  };
117
134
  }
118
135
 
@@ -142,7 +159,7 @@ function withMutation(document, operationOptions) {
142
159
  if (!opts.variables && operation.variables.length > 0) {
143
160
  opts.variables = calculateVariablesFromProps(operation, props);
144
161
  }
145
- return (React.createElement(components.Mutation, tslib.__assign({ ignoreResults: true }, opts, { mutation: document }), function (mutate, _a) {
162
+ return (React__namespace.createElement(components.Mutation, tslib.__assign({ ignoreResults: true }, opts, { mutation: document }), function (mutate, _a) {
146
163
  var _b, _c;
147
164
  var data = _a.data, r = tslib.__rest(_a, ["data"]);
148
165
  var result = Object.assign(r, data || {});
@@ -162,14 +179,14 @@ function withMutation(document, operationOptions) {
162
179
  _c);
163
180
  childProps = operationOptions.props(newResult);
164
181
  }
165
- return React.createElement(WrappedComponent, tslib.__assign({}, props, childProps));
182
+ return React__namespace.createElement(WrappedComponent, tslib.__assign({}, props, childProps));
166
183
  }));
167
184
  };
168
185
  GraphQL.displayName = graphQLDisplayName;
169
186
  GraphQL.WrappedComponent = WrappedComponent;
170
187
  return GraphQL;
171
188
  }(GraphQLBase));
172
- return hoistNonReactStatics['default'](GraphQL, WrappedComponent, {});
189
+ return hoistNonReactStatics__default(GraphQL, WrappedComponent, {});
173
190
  };
174
191
  }
175
192
 
@@ -210,7 +227,7 @@ function withSubscription(document, operationOptions) {
210
227
  if (!shouldSkip && !opts.variables && operation.variables.length > 0) {
211
228
  opts.variables = calculateVariablesFromProps(operation, props);
212
229
  }
213
- return (React.createElement(components.Subscription, tslib.__assign({}, opts, { displayName: graphQLDisplayName, skip: shouldSkip, subscription: document, shouldResubscribe: this.state.resubscribe }), function (_a) {
230
+ return (React__namespace.createElement(components.Subscription, tslib.__assign({}, opts, { displayName: graphQLDisplayName, skip: shouldSkip, subscription: document, shouldResubscribe: this.state.resubscribe }), function (_a) {
214
231
  var _b, _c;
215
232
  var data = _a.data, r = tslib.__rest(_a, ["data"]);
216
233
  if (operationOptions.withRef) {
@@ -220,7 +237,7 @@ function withSubscription(document, operationOptions) {
220
237
  });
221
238
  }
222
239
  if (shouldSkip) {
223
- return (React.createElement(WrappedComponent, tslib.__assign({}, props, {})));
240
+ return (React__namespace.createElement(WrappedComponent, tslib.__assign({}, props, {})));
224
241
  }
225
242
  var result = Object.assign(r, data || {});
226
243
  var name = operationOptions.name || 'data';
@@ -233,14 +250,14 @@ function withSubscription(document, operationOptions) {
233
250
  lastResultProps = operationOptions.props(newResult, lastResultProps);
234
251
  childProps = lastResultProps;
235
252
  }
236
- return (React.createElement(WrappedComponent, tslib.__assign({}, props, childProps)));
253
+ return (React__namespace.createElement(WrappedComponent, tslib.__assign({}, props, childProps)));
237
254
  }));
238
255
  };
239
256
  GraphQL.displayName = graphQLDisplayName;
240
257
  GraphQL.WrappedComponent = WrappedComponent;
241
258
  return GraphQL;
242
259
  }(GraphQLBase));
243
- return hoistNonReactStatics['default'](GraphQL, WrappedComponent, {});
260
+ return hoistNonReactStatics__default(GraphQL, WrappedComponent, {});
244
261
  };
245
262
  }
246
263
 
@@ -272,7 +289,7 @@ function withApollo(WrappedComponent, operationOptions) {
272
289
  }
273
290
  WithApollo.prototype.getWrappedInstance = function () {
274
291
  __DEV__ ? tsInvariant.invariant(operationOptions.withRef, "To access the wrapped instance, you need to specify " +
275
- "{ withRef: true } in the options") : tsInvariant.invariant(operationOptions.withRef, 33);
292
+ "{ withRef: true } in the options") : tsInvariant.invariant(operationOptions.withRef, 35);
276
293
  return this.wrappedInstance;
277
294
  };
278
295
  WithApollo.prototype.setWrappedInstance = function (ref) {
@@ -280,21 +297,21 @@ function withApollo(WrappedComponent, operationOptions) {
280
297
  };
281
298
  WithApollo.prototype.render = function () {
282
299
  var _this = this;
283
- return (React.createElement(context.ApolloConsumer, null, function (client) {
300
+ return (React__namespace.createElement(context.ApolloConsumer, null, function (client) {
284
301
  var props = Object.assign({}, _this.props, {
285
302
  client: client,
286
303
  ref: operationOptions.withRef
287
304
  ? _this.setWrappedInstance
288
305
  : undefined
289
306
  });
290
- return React.createElement(WrappedComponent, tslib.__assign({}, props));
307
+ return React__namespace.createElement(WrappedComponent, tslib.__assign({}, props));
291
308
  }));
292
309
  };
293
310
  WithApollo.displayName = withDisplayName;
294
311
  WithApollo.WrappedComponent = WrappedComponent;
295
312
  return WithApollo;
296
- }(React.Component));
297
- return hoistNonReactStatics['default'](WithApollo, WrappedComponent, {});
313
+ }(React__namespace.Component));
314
+ return hoistNonReactStatics__default(WithApollo, WrappedComponent, {});
298
315
  }
299
316
 
300
317
  exports.graphql = graphql;
@@ -1 +1 @@
1
- {"version":3,"file":"hoc.cjs.js","sources":["hoc-utils.js","query-hoc.js","mutation-hoc.js","subscription-hoc.js","graphql.js","withApollo.js"],"sourcesContent":["import { __extends } from \"tslib\";\nimport * as React from 'react';\nimport { invariant } from 'ts-invariant';\nexport var defaultMapPropsToOptions = function () { return ({}); };\nexport var defaultMapResultToProps = function (props) { return props; };\nexport var defaultMapPropsToSkip = function () { return false; };\nexport function getDisplayName(WrappedComponent) {\n return WrappedComponent.displayName || WrappedComponent.name || 'Component';\n}\nexport function calculateVariablesFromProps(operation, props) {\n var variables = {};\n for (var _i = 0, _a = operation.variables; _i < _a.length; _i++) {\n var _b = _a[_i], variable = _b.variable, type = _b.type;\n if (!variable.name || !variable.name.value)\n continue;\n var variableName = variable.name.value;\n var variableProp = props[variableName];\n if (typeof variableProp !== 'undefined') {\n variables[variableName] = variableProp;\n continue;\n }\n if (type.kind !== 'NonNullType') {\n variables[variableName] = undefined;\n }\n }\n return variables;\n}\nvar GraphQLBase = (function (_super) {\n __extends(GraphQLBase, _super);\n function GraphQLBase(props) {\n var _this = _super.call(this, props) || this;\n _this.withRef = false;\n _this.setWrappedInstance = _this.setWrappedInstance.bind(_this);\n return _this;\n }\n GraphQLBase.prototype.getWrappedInstance = function () {\n __DEV__ ? invariant(this.withRef, \"To access the wrapped instance, you need to specify \" +\n \"{ withRef: true } in the options\") : invariant(this.withRef, 32);\n return this.wrappedInstance;\n };\n GraphQLBase.prototype.setWrappedInstance = function (ref) {\n this.wrappedInstance = ref;\n };\n return GraphQLBase;\n}(React.Component));\nexport { GraphQLBase };\n//# sourceMappingURL=hoc-utils.js.map","import { __assign, __extends, __rest } from \"tslib\";\nimport * as React from 'react';\nimport hoistNonReactStatics from 'hoist-non-react-statics';\nimport { parser } from '../parser';\nimport { Query } from '../components';\nimport { getDisplayName, GraphQLBase, calculateVariablesFromProps, defaultMapPropsToOptions, defaultMapPropsToSkip } from './hoc-utils';\nexport function withQuery(document, operationOptions) {\n if (operationOptions === void 0) { operationOptions = {}; }\n var operation = parser(document);\n var _a = operationOptions.options, options = _a === void 0 ? defaultMapPropsToOptions : _a, _b = operationOptions.skip, skip = _b === void 0 ? defaultMapPropsToSkip : _b, _c = operationOptions.alias, alias = _c === void 0 ? 'Apollo' : _c;\n var mapPropsToOptions = options;\n if (typeof mapPropsToOptions !== 'function') {\n mapPropsToOptions = function () { return options; };\n }\n var mapPropsToSkip = skip;\n if (typeof mapPropsToSkip !== 'function') {\n mapPropsToSkip = function () { return skip; };\n }\n var lastResultProps;\n return function (WrappedComponent) {\n var graphQLDisplayName = alias + \"(\" + getDisplayName(WrappedComponent) + \")\";\n var GraphQL = (function (_super) {\n __extends(GraphQL, _super);\n function GraphQL() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n GraphQL.prototype.render = function () {\n var _this = this;\n var props = this.props;\n var shouldSkip = mapPropsToSkip(props);\n var opts = shouldSkip\n ? Object.create(null)\n : __assign({}, mapPropsToOptions(props));\n if (!shouldSkip && !opts.variables && operation.variables.length > 0) {\n opts.variables = calculateVariablesFromProps(operation, props);\n }\n return (React.createElement(Query, __assign({}, opts, { displayName: graphQLDisplayName, skip: shouldSkip, query: document }), function (_a) {\n var _b, _c;\n var _ = _a.client, data = _a.data, r = __rest(_a, [\"client\", \"data\"]);\n if (operationOptions.withRef) {\n _this.withRef = true;\n props = Object.assign({}, props, {\n ref: _this.setWrappedInstance\n });\n }\n if (shouldSkip) {\n return (React.createElement(WrappedComponent, __assign({}, props, {})));\n }\n var result = Object.assign(r, data || {});\n var name = operationOptions.name || 'data';\n var childProps = (_b = {}, _b[name] = result, _b);\n if (operationOptions.props) {\n var newResult = (_c = {},\n _c[name] = result,\n _c.ownProps = props,\n _c);\n lastResultProps = operationOptions.props(newResult, lastResultProps);\n childProps = lastResultProps;\n }\n return (React.createElement(WrappedComponent, __assign({}, props, childProps)));\n }));\n };\n GraphQL.displayName = graphQLDisplayName;\n GraphQL.WrappedComponent = WrappedComponent;\n return GraphQL;\n }(GraphQLBase));\n return hoistNonReactStatics(GraphQL, WrappedComponent, {});\n };\n}\n//# sourceMappingURL=query-hoc.js.map","import { __assign, __extends, __rest } from \"tslib\";\nimport * as React from 'react';\nimport hoistNonReactStatics from 'hoist-non-react-statics';\nimport { parser } from '../parser';\nimport { Mutation } from '../components';\nimport { defaultMapPropsToOptions, getDisplayName, calculateVariablesFromProps, GraphQLBase } from './hoc-utils';\nexport function withMutation(document, operationOptions) {\n if (operationOptions === void 0) { operationOptions = {}; }\n var operation = parser(document);\n var _a = operationOptions.options, options = _a === void 0 ? defaultMapPropsToOptions : _a, _b = operationOptions.alias, alias = _b === void 0 ? 'Apollo' : _b;\n var mapPropsToOptions = options;\n if (typeof mapPropsToOptions !== 'function')\n mapPropsToOptions = function () { return options; };\n return function (WrappedComponent) {\n var graphQLDisplayName = alias + \"(\" + getDisplayName(WrappedComponent) + \")\";\n var GraphQL = (function (_super) {\n __extends(GraphQL, _super);\n function GraphQL() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n GraphQL.prototype.render = function () {\n var props = this.props;\n var opts = mapPropsToOptions(props);\n if (operationOptions.withRef) {\n this.withRef = true;\n props = Object.assign({}, props, {\n ref: this.setWrappedInstance\n });\n }\n if (!opts.variables && operation.variables.length > 0) {\n opts.variables = calculateVariablesFromProps(operation, props);\n }\n return (React.createElement(Mutation, __assign({ ignoreResults: true }, opts, { mutation: document }), function (mutate, _a) {\n var _b, _c;\n var data = _a.data, r = __rest(_a, [\"data\"]);\n var result = Object.assign(r, data || {});\n var name = operationOptions.name || 'mutate';\n var resultName = operationOptions.name\n ? name + \"Result\"\n : 'result';\n var childProps = (_b = {},\n _b[name] = mutate,\n _b[resultName] = result,\n _b);\n if (operationOptions.props) {\n var newResult = (_c = {},\n _c[name] = mutate,\n _c[resultName] = result,\n _c.ownProps = props,\n _c);\n childProps = operationOptions.props(newResult);\n }\n return React.createElement(WrappedComponent, __assign({}, props, childProps));\n }));\n };\n GraphQL.displayName = graphQLDisplayName;\n GraphQL.WrappedComponent = WrappedComponent;\n return GraphQL;\n }(GraphQLBase));\n return hoistNonReactStatics(GraphQL, WrappedComponent, {});\n };\n}\n//# sourceMappingURL=mutation-hoc.js.map","import { __assign, __extends, __rest } from \"tslib\";\nimport * as React from 'react';\nimport hoistNonReactStatics from 'hoist-non-react-statics';\nimport { parser } from '../parser';\nimport { Subscription } from '../components';\nimport { getDisplayName, GraphQLBase, calculateVariablesFromProps, defaultMapPropsToOptions, defaultMapPropsToSkip } from './hoc-utils';\nexport function withSubscription(document, operationOptions) {\n if (operationOptions === void 0) { operationOptions = {}; }\n var operation = parser(document);\n var _a = operationOptions.options, options = _a === void 0 ? defaultMapPropsToOptions : _a, _b = operationOptions.skip, skip = _b === void 0 ? defaultMapPropsToSkip : _b, _c = operationOptions.alias, alias = _c === void 0 ? 'Apollo' : _c, shouldResubscribe = operationOptions.shouldResubscribe;\n var mapPropsToOptions = options;\n if (typeof mapPropsToOptions !== 'function')\n mapPropsToOptions = function () { return options; };\n var mapPropsToSkip = skip;\n if (typeof mapPropsToSkip !== 'function')\n mapPropsToSkip = function () { return skip; };\n var lastResultProps;\n return function (WrappedComponent) {\n var graphQLDisplayName = alias + \"(\" + getDisplayName(WrappedComponent) + \")\";\n var GraphQL = (function (_super) {\n __extends(GraphQL, _super);\n function GraphQL(props) {\n var _this = _super.call(this, props) || this;\n _this.state = { resubscribe: false };\n return _this;\n }\n GraphQL.prototype.componentDidUpate = function (prevProps) {\n if (shouldResubscribe) {\n this.setState({\n resubscribe: shouldResubscribe(prevProps, this.props)\n });\n }\n };\n GraphQL.prototype.render = function () {\n var _this = this;\n var props = this.props;\n var shouldSkip = mapPropsToSkip(props);\n var opts = shouldSkip\n ? Object.create(null)\n : mapPropsToOptions(props);\n if (!shouldSkip && !opts.variables && operation.variables.length > 0) {\n opts.variables = calculateVariablesFromProps(operation, props);\n }\n return (React.createElement(Subscription, __assign({}, opts, { displayName: graphQLDisplayName, skip: shouldSkip, subscription: document, shouldResubscribe: this.state.resubscribe }), function (_a) {\n var _b, _c;\n var data = _a.data, r = __rest(_a, [\"data\"]);\n if (operationOptions.withRef) {\n _this.withRef = true;\n props = Object.assign({}, props, {\n ref: _this.setWrappedInstance\n });\n }\n if (shouldSkip) {\n return (React.createElement(WrappedComponent, __assign({}, props, {})));\n }\n var result = Object.assign(r, data || {});\n var name = operationOptions.name || 'data';\n var childProps = (_b = {}, _b[name] = result, _b);\n if (operationOptions.props) {\n var newResult = (_c = {},\n _c[name] = result,\n _c.ownProps = props,\n _c);\n lastResultProps = operationOptions.props(newResult, lastResultProps);\n childProps = lastResultProps;\n }\n return (React.createElement(WrappedComponent, __assign({}, props, childProps)));\n }));\n };\n GraphQL.displayName = graphQLDisplayName;\n GraphQL.WrappedComponent = WrappedComponent;\n return GraphQL;\n }(GraphQLBase));\n return hoistNonReactStatics(GraphQL, WrappedComponent, {});\n };\n}\n//# sourceMappingURL=subscription-hoc.js.map","import { parser, DocumentType } from '../parser';\nimport { withQuery } from './query-hoc';\nimport { withMutation } from './mutation-hoc';\nimport { withSubscription } from './subscription-hoc';\nexport function graphql(document, operationOptions) {\n if (operationOptions === void 0) { operationOptions = {}; }\n switch (parser(document).type) {\n case DocumentType.Mutation:\n return withMutation(document, operationOptions);\n case DocumentType.Subscription:\n return withSubscription(document, operationOptions);\n case DocumentType.Query:\n default:\n return withQuery(document, operationOptions);\n }\n}\n//# sourceMappingURL=graphql.js.map","import { __assign, __extends } from \"tslib\";\nimport * as React from 'react';\nimport hoistNonReactStatics from 'hoist-non-react-statics';\nimport { invariant } from 'ts-invariant';\nimport { ApolloConsumer } from '../context';\nfunction getDisplayName(WrappedComponent) {\n return WrappedComponent.displayName || WrappedComponent.name || 'Component';\n}\nexport function withApollo(WrappedComponent, operationOptions) {\n if (operationOptions === void 0) { operationOptions = {}; }\n var withDisplayName = \"withApollo(\" + getDisplayName(WrappedComponent) + \")\";\n var WithApollo = (function (_super) {\n __extends(WithApollo, _super);\n function WithApollo(props) {\n var _this = _super.call(this, props) || this;\n _this.setWrappedInstance = _this.setWrappedInstance.bind(_this);\n return _this;\n }\n WithApollo.prototype.getWrappedInstance = function () {\n __DEV__ ? invariant(operationOptions.withRef, \"To access the wrapped instance, you need to specify \" +\n \"{ withRef: true } in the options\") : invariant(operationOptions.withRef, 33);\n return this.wrappedInstance;\n };\n WithApollo.prototype.setWrappedInstance = function (ref) {\n this.wrappedInstance = ref;\n };\n WithApollo.prototype.render = function () {\n var _this = this;\n return (React.createElement(ApolloConsumer, null, function (client) {\n var props = Object.assign({}, _this.props, {\n client: client,\n ref: operationOptions.withRef\n ? _this.setWrappedInstance\n : undefined\n });\n return React.createElement(WrappedComponent, __assign({}, props));\n }));\n };\n WithApollo.displayName = withDisplayName;\n WithApollo.WrappedComponent = WrappedComponent;\n return WithApollo;\n }(React.Component));\n return hoistNonReactStatics(WithApollo, WrappedComponent, {});\n}\n//# sourceMappingURL=withApollo.js.map"],"names":["getDisplayName","__extends","invariant","parser","__assign","Query","__rest","hoistNonReactStatics","Mutation","Subscription","DocumentType","ApolloConsumer"],"mappings":";;;;;;;;;;;;AAGO,IAAI,wBAAwB,GAAG,YAAY,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC;AAE5D,IAAI,qBAAqB,GAAG,YAAY,EAAE,OAAO,KAAK,CAAC,EAAE,CAAC;AAC1D,SAASA,gBAAc,CAAC,gBAAgB,EAAE;AACjD,IAAI,OAAO,gBAAgB,CAAC,WAAW,IAAI,gBAAgB,CAAC,IAAI,IAAI,WAAW,CAAC;AAChF,CAAC;AACM,SAAS,2BAA2B,CAAC,SAAS,EAAE,KAAK,EAAE;AAC9D,IAAI,IAAI,SAAS,GAAG,EAAE,CAAC;AACvB,IAAI,KAAK,IAAI,EAAE,GAAG,CAAC,EAAE,EAAE,GAAG,SAAS,CAAC,SAAS,EAAE,EAAE,GAAG,EAAE,CAAC,MAAM,EAAE,EAAE,EAAE,EAAE;AACrE,QAAQ,IAAI,EAAE,GAAG,EAAE,CAAC,EAAE,CAAC,EAAE,QAAQ,GAAG,EAAE,CAAC,QAAQ,EAAE,IAAI,GAAG,EAAE,CAAC,IAAI,CAAC;AAChE,QAAQ,IAAI,CAAC,QAAQ,CAAC,IAAI,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK;AA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,EAAE;AAC3D,oBAAoB,MAAM,EAAE,MAAM;AAClC,oBAAoB,GAAG,EAAE,gBAAgB,CAAC,OAAO;AACjD,0BAA0B,KAAK,CAAC,kBAAkB;AAClD,0BAA0B,SAAS;AACnC,iBAAiB,CAAC,CAAC;AACnB,gBAAgB,OAAO,KAAK,CAAC,aAAa,CAAC,gBAAgB,EAAEP,cAAQ,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC,CAAC;AAClF,aAAa,CAAC,EAAE;AAChB,SAAS,CAAC;AACV,QAAQ,UAAU,CAAC,WAAW,GAAG,eAAe,CAAC;AACjD,QAAQ,UAAU,CAAC,gBAAgB,GAAG,gBAAgB,CAAC;AACvD,QAAQ,OAAO,UAAU,CAAC;AAC1B,KAAK,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC;AACxB,IAAI,OAAOG,+BAAoB,CAAC,UAAU,EAAE,gBAAgB,EAAE,EAAE,CAAC,CAAC;AAClE;;;;;;;;"}
1
+ {"version":3,"file":"hoc.cjs.js","sources":["hoc-utils.js","query-hoc.js","mutation-hoc.js","subscription-hoc.js","graphql.js","withApollo.js"],"sourcesContent":["import { __extends } from \"tslib\";\nimport * as React from 'react';\nimport { invariant } from 'ts-invariant';\nexport var defaultMapPropsToOptions = function () { return ({}); };\nexport var defaultMapResultToProps = function (props) { return props; };\nexport var defaultMapPropsToSkip = function () { return false; };\nexport function getDisplayName(WrappedComponent) {\n return WrappedComponent.displayName || WrappedComponent.name || 'Component';\n}\nexport function calculateVariablesFromProps(operation, props) {\n var variables = {};\n for (var _i = 0, _a = operation.variables; _i < _a.length; _i++) {\n var _b = _a[_i], variable = _b.variable, type = _b.type;\n if (!variable.name || !variable.name.value)\n continue;\n var variableName = variable.name.value;\n var variableProp = props[variableName];\n if (typeof variableProp !== 'undefined') {\n variables[variableName] = variableProp;\n continue;\n }\n if (type.kind !== 'NonNullType') {\n variables[variableName] = undefined;\n }\n }\n return variables;\n}\nvar GraphQLBase = (function (_super) {\n __extends(GraphQLBase, _super);\n function GraphQLBase(props) {\n var _this = _super.call(this, props) || this;\n _this.withRef = false;\n _this.setWrappedInstance = _this.setWrappedInstance.bind(_this);\n return _this;\n }\n GraphQLBase.prototype.getWrappedInstance = function () {\n __DEV__ ? invariant(this.withRef, \"To access the wrapped instance, you need to specify \" +\n \"{ withRef: true } in the options\") : invariant(this.withRef, 34);\n return this.wrappedInstance;\n };\n GraphQLBase.prototype.setWrappedInstance = function (ref) {\n this.wrappedInstance = ref;\n };\n return GraphQLBase;\n}(React.Component));\nexport { GraphQLBase };\n//# sourceMappingURL=hoc-utils.js.map","import { __assign, __extends, __rest } from \"tslib\";\nimport * as React from 'react';\nimport hoistNonReactStatics from 'hoist-non-react-statics';\nimport { parser } from '../parser';\nimport { Query } from '../components';\nimport { getDisplayName, GraphQLBase, calculateVariablesFromProps, defaultMapPropsToOptions, defaultMapPropsToSkip } from './hoc-utils';\nexport function withQuery(document, operationOptions) {\n if (operationOptions === void 0) { operationOptions = {}; }\n var operation = parser(document);\n var _a = operationOptions.options, options = _a === void 0 ? defaultMapPropsToOptions : _a, _b = operationOptions.skip, skip = _b === void 0 ? defaultMapPropsToSkip : _b, _c = operationOptions.alias, alias = _c === void 0 ? 'Apollo' : _c;\n var mapPropsToOptions = options;\n if (typeof mapPropsToOptions !== 'function') {\n mapPropsToOptions = function () { return options; };\n }\n var mapPropsToSkip = skip;\n if (typeof mapPropsToSkip !== 'function') {\n mapPropsToSkip = function () { return skip; };\n }\n var lastResultProps;\n return function (WrappedComponent) {\n var graphQLDisplayName = alias + \"(\" + getDisplayName(WrappedComponent) + \")\";\n var GraphQL = (function (_super) {\n __extends(GraphQL, _super);\n function GraphQL() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n GraphQL.prototype.render = function () {\n var _this = this;\n var props = this.props;\n var shouldSkip = mapPropsToSkip(props);\n var opts = shouldSkip\n ? Object.create(null)\n : __assign({}, mapPropsToOptions(props));\n if (!shouldSkip && !opts.variables && operation.variables.length > 0) {\n opts.variables = calculateVariablesFromProps(operation, props);\n }\n return (React.createElement(Query, __assign({}, opts, { displayName: graphQLDisplayName, skip: shouldSkip, query: document }), function (_a) {\n var _b, _c;\n var _ = _a.client, data = _a.data, r = __rest(_a, [\"client\", \"data\"]);\n if (operationOptions.withRef) {\n _this.withRef = true;\n props = Object.assign({}, props, {\n ref: _this.setWrappedInstance\n });\n }\n if (shouldSkip) {\n return (React.createElement(WrappedComponent, __assign({}, props, {})));\n }\n var result = Object.assign(r, data || {});\n var name = operationOptions.name || 'data';\n var childProps = (_b = {}, _b[name] = result, _b);\n if (operationOptions.props) {\n var newResult = (_c = {},\n _c[name] = result,\n _c.ownProps = props,\n _c);\n lastResultProps = operationOptions.props(newResult, lastResultProps);\n childProps = lastResultProps;\n }\n return (React.createElement(WrappedComponent, __assign({}, props, childProps)));\n }));\n };\n GraphQL.displayName = graphQLDisplayName;\n GraphQL.WrappedComponent = WrappedComponent;\n return GraphQL;\n }(GraphQLBase));\n return hoistNonReactStatics(GraphQL, WrappedComponent, {});\n };\n}\n//# sourceMappingURL=query-hoc.js.map","import { __assign, __extends, __rest } from \"tslib\";\nimport * as React from 'react';\nimport hoistNonReactStatics from 'hoist-non-react-statics';\nimport { parser } from '../parser';\nimport { Mutation } from '../components';\nimport { defaultMapPropsToOptions, getDisplayName, calculateVariablesFromProps, GraphQLBase } from './hoc-utils';\nexport function withMutation(document, operationOptions) {\n if (operationOptions === void 0) { operationOptions = {}; }\n var operation = parser(document);\n var _a = operationOptions.options, options = _a === void 0 ? defaultMapPropsToOptions : _a, _b = operationOptions.alias, alias = _b === void 0 ? 'Apollo' : _b;\n var mapPropsToOptions = options;\n if (typeof mapPropsToOptions !== 'function')\n mapPropsToOptions = function () { return options; };\n return function (WrappedComponent) {\n var graphQLDisplayName = alias + \"(\" + getDisplayName(WrappedComponent) + \")\";\n var GraphQL = (function (_super) {\n __extends(GraphQL, _super);\n function GraphQL() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n GraphQL.prototype.render = function () {\n var props = this.props;\n var opts = mapPropsToOptions(props);\n if (operationOptions.withRef) {\n this.withRef = true;\n props = Object.assign({}, props, {\n ref: this.setWrappedInstance\n });\n }\n if (!opts.variables && operation.variables.length > 0) {\n opts.variables = calculateVariablesFromProps(operation, props);\n }\n return (React.createElement(Mutation, __assign({ ignoreResults: true }, opts, { mutation: document }), function (mutate, _a) {\n var _b, _c;\n var data = _a.data, r = __rest(_a, [\"data\"]);\n var result = Object.assign(r, data || {});\n var name = operationOptions.name || 'mutate';\n var resultName = operationOptions.name\n ? name + \"Result\"\n : 'result';\n var childProps = (_b = {},\n _b[name] = mutate,\n _b[resultName] = result,\n _b);\n if (operationOptions.props) {\n var newResult = (_c = {},\n _c[name] = mutate,\n _c[resultName] = result,\n _c.ownProps = props,\n _c);\n childProps = operationOptions.props(newResult);\n }\n return React.createElement(WrappedComponent, __assign({}, props, childProps));\n }));\n };\n GraphQL.displayName = graphQLDisplayName;\n GraphQL.WrappedComponent = WrappedComponent;\n return GraphQL;\n }(GraphQLBase));\n return hoistNonReactStatics(GraphQL, WrappedComponent, {});\n };\n}\n//# sourceMappingURL=mutation-hoc.js.map","import { __assign, __extends, __rest } from \"tslib\";\nimport * as React from 'react';\nimport hoistNonReactStatics from 'hoist-non-react-statics';\nimport { parser } from '../parser';\nimport { Subscription } from '../components';\nimport { getDisplayName, GraphQLBase, calculateVariablesFromProps, defaultMapPropsToOptions, defaultMapPropsToSkip } from './hoc-utils';\nexport function withSubscription(document, operationOptions) {\n if (operationOptions === void 0) { operationOptions = {}; }\n var operation = parser(document);\n var _a = operationOptions.options, options = _a === void 0 ? defaultMapPropsToOptions : _a, _b = operationOptions.skip, skip = _b === void 0 ? defaultMapPropsToSkip : _b, _c = operationOptions.alias, alias = _c === void 0 ? 'Apollo' : _c, shouldResubscribe = operationOptions.shouldResubscribe;\n var mapPropsToOptions = options;\n if (typeof mapPropsToOptions !== 'function')\n mapPropsToOptions = function () { return options; };\n var mapPropsToSkip = skip;\n if (typeof mapPropsToSkip !== 'function')\n mapPropsToSkip = function () { return skip; };\n var lastResultProps;\n return function (WrappedComponent) {\n var graphQLDisplayName = alias + \"(\" + getDisplayName(WrappedComponent) + \")\";\n var GraphQL = (function (_super) {\n __extends(GraphQL, _super);\n function GraphQL(props) {\n var _this = _super.call(this, props) || this;\n _this.state = { resubscribe: false };\n return _this;\n }\n GraphQL.prototype.componentDidUpate = function (prevProps) {\n if (shouldResubscribe) {\n this.setState({\n resubscribe: shouldResubscribe(prevProps, this.props)\n });\n }\n };\n GraphQL.prototype.render = function () {\n var _this = this;\n var props = this.props;\n var shouldSkip = mapPropsToSkip(props);\n var opts = shouldSkip\n ? Object.create(null)\n : mapPropsToOptions(props);\n if (!shouldSkip && !opts.variables && operation.variables.length > 0) {\n opts.variables = calculateVariablesFromProps(operation, props);\n }\n return (React.createElement(Subscription, __assign({}, opts, { displayName: graphQLDisplayName, skip: shouldSkip, subscription: document, shouldResubscribe: this.state.resubscribe }), function (_a) {\n var _b, _c;\n var data = _a.data, r = __rest(_a, [\"data\"]);\n if (operationOptions.withRef) {\n _this.withRef = true;\n props = Object.assign({}, props, {\n ref: _this.setWrappedInstance\n });\n }\n if (shouldSkip) {\n return (React.createElement(WrappedComponent, __assign({}, props, {})));\n }\n var result = Object.assign(r, data || {});\n var name = operationOptions.name || 'data';\n var childProps = (_b = {}, _b[name] = result, _b);\n if (operationOptions.props) {\n var newResult = (_c = {},\n _c[name] = result,\n _c.ownProps = props,\n _c);\n lastResultProps = operationOptions.props(newResult, lastResultProps);\n childProps = lastResultProps;\n }\n return (React.createElement(WrappedComponent, __assign({}, props, childProps)));\n }));\n };\n GraphQL.displayName = graphQLDisplayName;\n GraphQL.WrappedComponent = WrappedComponent;\n return GraphQL;\n }(GraphQLBase));\n return hoistNonReactStatics(GraphQL, WrappedComponent, {});\n };\n}\n//# sourceMappingURL=subscription-hoc.js.map","import { parser, DocumentType } from '../parser';\nimport { withQuery } from './query-hoc';\nimport { withMutation } from './mutation-hoc';\nimport { withSubscription } from './subscription-hoc';\nexport function graphql(document, operationOptions) {\n if (operationOptions === void 0) { operationOptions = {}; }\n switch (parser(document).type) {\n case DocumentType.Mutation:\n return withMutation(document, operationOptions);\n case DocumentType.Subscription:\n return withSubscription(document, operationOptions);\n case DocumentType.Query:\n default:\n return withQuery(document, operationOptions);\n }\n}\n//# sourceMappingURL=graphql.js.map","import { __assign, __extends } from \"tslib\";\nimport * as React from 'react';\nimport hoistNonReactStatics from 'hoist-non-react-statics';\nimport { invariant } from 'ts-invariant';\nimport { ApolloConsumer } from '../context';\nfunction getDisplayName(WrappedComponent) {\n return WrappedComponent.displayName || WrappedComponent.name || 'Component';\n}\nexport function withApollo(WrappedComponent, operationOptions) {\n if (operationOptions === void 0) { operationOptions = {}; }\n var withDisplayName = \"withApollo(\" + getDisplayName(WrappedComponent) + \")\";\n var WithApollo = (function (_super) {\n __extends(WithApollo, _super);\n function WithApollo(props) {\n var _this = _super.call(this, props) || this;\n _this.setWrappedInstance = _this.setWrappedInstance.bind(_this);\n return _this;\n }\n WithApollo.prototype.getWrappedInstance = function () {\n __DEV__ ? invariant(operationOptions.withRef, \"To access the wrapped instance, you need to specify \" +\n \"{ withRef: true } in the options\") : invariant(operationOptions.withRef, 35);\n return this.wrappedInstance;\n };\n WithApollo.prototype.setWrappedInstance = function (ref) {\n this.wrappedInstance = ref;\n };\n WithApollo.prototype.render = function () {\n var _this = this;\n return (React.createElement(ApolloConsumer, null, function (client) {\n var props = Object.assign({}, _this.props, {\n client: client,\n ref: operationOptions.withRef\n ? _this.setWrappedInstance\n : undefined\n });\n return React.createElement(WrappedComponent, __assign({}, props));\n }));\n };\n WithApollo.displayName = withDisplayName;\n WithApollo.WrappedComponent = WrappedComponent;\n return WithApollo;\n }(React.Component));\n return hoistNonReactStatics(WithApollo, WrappedComponent, {});\n}\n//# sourceMappingURL=withApollo.js.map"],"names":["getDisplayName","__extends","invariant","React","parser","__assign","Query","__rest","hoistNonReactSt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,GAAG,gBAAgB,CAAC;AACvD,QAAQ,OAAO,UAAU,CAAC;AAC1B,KAAK,CAACF,gBAAK,CAAC,SAAS,CAAC,CAAC,CAAC;AACxB,IAAI,OAAOK,6BAAoB,CAAC,UAAU,EAAE,gBAAgB,EAAE,EAAE,CAAC,CAAC;AAClE;;;;;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"mutation-hoc.d.ts","sourceRoot":"","sources":["../../../src/react/hoc/mutation-hoc.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAIvC,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAclD,OAAO,EAAE,eAAe,EAAe,WAAW,EAAE,MAAM,SAAS,CAAC;AACpE,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAEzC,wBAAgB,YAAY,CAC1B,MAAM,SAAS,iBAAiB,GAAG,EAAE,GAAG,EAAE,EAC1C,KAAK,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,EAAE,EACtC,iBAAiB,GAAG,EAAE,EACtB,WAAW,GAAG,WAAW,CAAC,KAAK,EAAE,iBAAiB,CAAC,EACnD,QAAQ,GAAG,cAAc,EACzB,MAAM,SAAS,WAAW,CAAC,GAAG,CAAC,GAAG,WAAW,CAAC,GAAG,CAAC,EAElD,QAAQ,EAAE,YAAY,EACtB,gBAAgB,GAAE,eAAe,CAC/B,MAAM,EACN,KAAK,EACL,iBAAiB,EACjB,WAAW,CACP,sBAgBc,KAAK,CAAC,aAAa,CAAC,MAAM,GAAG,WAAW,CAAC,KAC1D,KAAK,CAAC,cAAc,CAAC,MAAM,CAAC,CA6DhC"}
1
+ {"version":3,"file":"mutation-hoc.d.ts","sourceRoot":"","sources":["../../../src/react/hoc/mutation-hoc.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;A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,KAAK,EACL,iBAAiB,EACjB,WAAW,CACP,sBAwBc,KAAK,CAAC,aAAa,CAAC,MAAM,GAAG,WAAW,CAAC,KAC1D,KAAK,CAAC,cAAc,CAAC,MAAM,CAAC,CA+EhC"}
1
+ {"version":3,"file":"query-hoc.d.ts","sourceRoot":"","sources":["../../../src/react/hoc/query-hoc.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAavC,OAAO,EAAE,eAAe,EAAe,SAAS,EAAE,MAAM,SAAS,CAAC;AAElE,wBAAgB,SAAS,CACvB,MAAM,SAAS,iBAAiB,GAAG,EAAE,GAAG,EAAE,EAC1C,KAAK,GAAG,EAAE,EACV,iBAAiB,GAAG,EAAE,EACtB,WAAW,GAAG,SAAS,CAAC,KAAK,EAAE,iBAAiB,CAAC,EAEjD,QAAQ,EAAE,YAAY,EACtB,gBAAgB,GAAE,eAAe,CAC/B,MAAM,EACN,KAAK,EACL,iBAAiB,EACjB,WAAW,CACP,sBAwBc,MAAM,aAAa,CAAC,MAAM,GAAG,WAAW,CAAC,KAC1D,MAAM,cAAc,CAAC,MAAM,CAAC,CA+EhC"}
@@ -1 +1 @@
1
- {"version":3,"file":"subscription-hoc.d.ts","sourceRoot":"","sources":["../../../src/react/hoc/subscription-hoc.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAavC,OAAO,EAAE,eAAe,EAAe,SAAS,EAAE,MAAM,SAAS,CAAC;AAElE,wBAAgB,gBAAgB,CAC9B,MAAM,SAAS,iBAAiB,GAAG,EAAE,GAAG,EAAE,EAC1C,KAAK,GAAG,EAAE,EACV,iBAAiB,GAAG,EAAE,EACtB,WAAW,GAAG,SAAS,CAAC,KAAK,EAAE,iBAAiB,CAAC,EAEjD,QAAQ,EAAE,YAAY,EACtB,gBAAgB,GAAE,eAAe,CAC/B,MAAM,EACN,KAAK,EACL,iBAAiB,EACjB,WAAW,CACP,sBAsBc,KAAK,CAAC,aAAa,CAAC,MAAM,GAAG,WAAW,CAAC,KAC1D,KAAK,CAAC,cAAc,CAAC,MAAM,CAAC,CA8FhC"}
1
+ {"version":3,"file":"subscription-hoc.d.ts","sourceRoot":"","sources":["../../../src/react/hoc/subscription-hoc.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAavC,OAAO,EAAE,eAAe,EAAe,SAAS,EAAE,MAAM,SAAS,CAAC;AAElE,wBAAgB,gBAAgB,CAC9B,MAAM,SAAS,iBAAiB,GAAG,EAAE,GAAG,EAAE,EAC1C,KAAK,GAAG,EAAE,EACV,iBAAiB,GAAG,EAAE,EACtB,WAAW,GAAG,SAAS,CAAC,KAAK,EAAE,iBAAiB,CAAC,EAEjD,QAAQ,EAAE,YAAY,EACtB,gBAAgB,GAAE,eAAe,CAC/B,MAAM,EACN,KAAK,EACL,iBAAiB,EACjB,WAAW,CACP,sBAsBc,MAAM,aAAa,CAAC,MAAM,GAAG,WAAW,CAAC,KAC1D,MAAM,cAAc,CAAC,MAAM,CAAC,CA8FhC"}
@@ -1 +1,2 @@
1
+ export {};
1
2
  //# sourceMappingURL=types.js.map
@@ -18,7 +18,7 @@ export function withApollo(WrappedComponent, operationOptions) {
18
18
  }
19
19
  WithApollo.prototype.getWrappedInstance = function () {
20
20
  __DEV__ ? invariant(operationOptions.withRef, "To access the wrapped instance, you need to specify " +
21
- "{ withRef: true } in the options") : invariant(operationOptions.withRef, 33);
21
+ "{ withRef: true } in the options") : invariant(operationOptions.withRef, 35);
22
22
  return this.wrappedInstance;
23
23
  };
24
24
  WithApollo.prototype.setWrappedInstance = function (ref) {
@@ -9,10 +9,24 @@ var tslib = require('tslib');
9
9
  var data = require('../data');
10
10
  var equality = require('@wry/equality');
11
11
 
12
+ function _interopNamespace(e) {
13
+ if (e && e.__esModule) return e;
14
+ var n = Object.create(null);
15
+ if (e) {
16
+ Object.keys(e).forEach(function (k) {
17
+ n[k] = e[k];
18
+ });
19
+ }
20
+ n['default'] = e;
21
+ return Object.freeze(n);
22
+ }
23
+
24
+ var React__namespace = /*#__PURE__*/_interopNamespace(React);
25
+
12
26
  function useApolloClient() {
13
- var client = React.useContext(context.getApolloContext()).client;
27
+ var client = React__namespace.useContext(context.getApolloContext()).client;
14
28
  __DEV__ ? tsInvariant.invariant(client, 'No Apollo Client instance can be found. Please ensure that you ' +
15
- 'have called `ApolloProvider` higher up in your tree.') : tsInvariant.invariant(client, 34);
29
+ 'have called `ApolloProvider` higher up in your tree.') : tsInvariant.invariant(client, 36);
16
30
  return client;
17
31
  }
18
32
 
@@ -24,6 +38,23 @@ function useDeepMemo(memoFn, key) {
24
38
  return ref.current.value;
25
39
  }
26
40
 
41
+ function useAfterFastRefresh(effectFn) {
42
+ if (__DEV__) {
43
+ var didRefresh_1 = React.useRef(false);
44
+ React.useEffect(function () {
45
+ return function () {
46
+ didRefresh_1.current = true;
47
+ };
48
+ }, []);
49
+ React.useEffect(function () {
50
+ if (didRefresh_1.current === true) {
51
+ didRefresh_1.current = false;
52
+ effectFn();
53
+ }
54
+ }, []);
55
+ }
56
+ }
57
+
27
58
  function useBaseQuery(query, options, lazy) {
28
59
  if (lazy === void 0) { lazy = false; }
29
60
  var context$1 = React.useContext(context.getApolloContext());
@@ -35,7 +66,7 @@ function useBaseQuery(query, options, lazy) {
35
66
  context: context$1,
36
67
  onNewData: function () {
37
68
  if (!queryData.ssrInitiated()) {
38
- Promise.resolve().then(function () { return queryDataRef.current && forceUpdate(); });
69
+ Promise.resolve().then(function () { return queryDataRef.current && queryDataRef.current.isMounted && forceUpdate(); });
39
70
  }
40
71
  else {
41
72
  forceUpdate();
@@ -45,7 +76,7 @@ function useBaseQuery(query, options, lazy) {
45
76
  queryData.setOptions(updatedOptions);
46
77
  queryData.context = context$1;
47
78
  var memo = {
48
- options: tslib.__assign(tslib.__assign({}, updatedOptions), { onError: undefined, onCompleted: undefined }),
79
+ options: tslib.__assign(tslib.__assign({}, updatedOptions), { onError: void 0, onCompleted: void 0 }),
49
80
  context: context$1,
50
81
  tick: tick
51
82
  };
@@ -53,8 +84,14 @@ function useBaseQuery(query, options, lazy) {
53
84
  var queryResult = lazy
54
85
  ? result[1]
55
86
  : result;
87
+ if (__DEV__) {
88
+ useAfterFastRefresh(forceUpdate);
89
+ }
56
90
  React.useEffect(function () {
57
- return function () { return queryData.cleanup(); };
91
+ return function () {
92
+ queryData.cleanup();
93
+ queryDataRef.current = void 0;
94
+ };
58
95
  }, []);
59
96
  React.useEffect(function () { return queryData.afterExecute({ lazy: lazy }); }, [
60
97
  queryResult.loading,
@@ -97,14 +134,15 @@ function useQuery(query, options) {
97
134
  }
98
135
 
99
136
  function useSubscription(subscription, options) {
137
+ var _a = React.useReducer(function (x) { return x + 1; }, 0), forceUpdate = _a[1];
100
138
  var context$1 = React.useContext(context.getApolloContext());
101
139
  var updatedOptions = options
102
140
  ? tslib.__assign(tslib.__assign({}, options), { subscription: subscription }) : { subscription: subscription };
103
- var _a = React.useState({
141
+ var _b = React.useState({
104
142
  loading: !updatedOptions.skip,
105
- error: undefined,
106
- data: undefined
107
- }), result = _a[0], setResult = _a[1];
143
+ error: void 0,
144
+ data: void 0,
145
+ }), result = _b[0], setResult = _b[1];
108
146
  var subscriptionDataRef = React.useRef();
109
147
  function getSubscriptionDataRef() {
110
148
  if (!subscriptionDataRef.current) {
@@ -119,8 +157,16 @@ function useSubscription(subscription, options) {
119
157
  var subscriptionData = getSubscriptionDataRef();
120
158
  subscriptionData.setOptions(updatedOptions, true);
121
159
  subscriptionData.context = context$1;
160
+ if (__DEV__) {
161
+ useAfterFastRefresh(forceUpdate);
162
+ }
122
163
  React.useEffect(function () { return subscriptionData.afterExecute(); });
123
- React.useEffect(function () { return subscriptionData.cleanup.bind(subscriptionData); }, []);
164
+ React.useEffect(function () {
165
+ return function () {
166
+ subscriptionData.cleanup();
167
+ subscriptionDataRef.current = void 0;
168
+ };
169
+ }, []);
124
170
  return subscriptionData.execute(result);
125
171
  }
126
172
 
@@ -1 +1 @@
1
- {"version":3,"file":"hooks.cjs.js","sources":["useApolloClient.js","utils/useDeepMemo.js","utils/useBaseQuery.js","useLazyQuery.js","useMutation.js","useQuery.js","useSubscription.js","useReactiveVar.js"],"sourcesContent":["import * as React from 'react';\nimport { invariant } from 'ts-invariant';\nimport { getApolloContext } from '../context';\nexport function useApolloClient() {\n var client = React.useContext(getApolloContext()).client;\n __DEV__ ? invariant(client, 'No Apollo Client instance can be found. Please ensure that you ' +\n 'have called `ApolloProvider` higher up in your tree.') : invariant(client, 34);\n return client;\n}\n//# sourceMappingURL=useApolloClient.js.map","import { useRef } from 'react';\nimport { equal } from '@wry/equality';\nexport function useDeepMemo(memoFn, key) {\n var ref = useRef();\n if (!ref.current || !equal(key, ref.current.key)) {\n ref.current = { key: key, value: memoFn() };\n }\n return ref.current.value;\n}\n//# sourceMappingURL=useDeepMemo.js.map","import { __assign } from \"tslib\";\nimport { useContext, useEffect, useReducer, useRef } from 'react';\nimport { QueryData } from '../../data';\nimport { useDeepMemo } from './useDeepMemo';\nimport { getApolloContext } from '../../context';\nexport function useBaseQuery(query, options, lazy) {\n if (lazy === void 0) { lazy = false; }\n var context = useContext(getApolloContext());\n var _a = useReducer(function (x) { return x + 1; }, 0), tick = _a[0], forceUpdate = _a[1];\n var updatedOptions = options ? __assign(__assign({}, options), { query: query }) : { query: query };\n var queryDataRef = useRef();\n var queryData = queryDataRef.current || (queryDataRef.current = new QueryData({\n options: updatedOptions,\n context: context,\n onNewData: function () {\n if (!queryData.ssrInitiated()) {\n Promise.resolve().then(function () { return queryDataRef.current && forceUpdate(); });\n }\n else {\n forceUpdate();\n }\n }\n }));\n queryData.setOptions(updatedOptions);\n queryData.context = context;\n var memo = {\n options: __assign(__assign({}, updatedOptions), { onError: undefined, onCompleted: undefined }),\n context: context,\n tick: tick\n };\n var result = useDeepMemo(function () { return (lazy ? queryData.executeLazy() : queryData.execute()); }, memo);\n var queryResult = lazy\n ? result[1]\n : result;\n useEffect(function () {\n return function () { return queryData.cleanup(); };\n }, []);\n useEffect(function () { return queryData.afterExecute({ lazy: lazy }); }, [\n queryResult.loading,\n queryResult.networkStatus,\n queryResult.error,\n queryResult.data,\n ]);\n return result;\n}\n//# sourceMappingURL=useBaseQuery.js.map","import { useBaseQuery } from './utils/useBaseQuery';\nexport function useLazyQuery(query, options) {\n return useBaseQuery(query, options, true);\n}\n//# sourceMappingURL=useLazyQuery.js.map","import { __assign } from \"tslib\";\nimport { useContext, useState, useRef, useEffect } from 'react';\nimport { MutationData } from '../data';\nimport { getApolloContext } from '../context';\nexport function useMutation(mutation, options) {\n var context = useContext(getApolloContext());\n var _a = useState({ called: false, loading: false }), result = _a[0], setResult = _a[1];\n var updatedOptions = options ? __assign(__assign({}, options), { mutation: mutation }) : { mutation: mutation };\n var mutationDataRef = useRef();\n function getMutationDataRef() {\n if (!mutationDataRef.current) {\n mutationDataRef.current = new MutationData({\n options: updatedOptions,\n context: context,\n result: result,\n setResult: setResult\n });\n }\n return mutationDataRef.current;\n }\n var mutationData = getMutationDataRef();\n mutationData.setOptions(updatedOptions);\n mutationData.context = context;\n useEffect(function () { return mutationData.afterExecute(); });\n return mutationData.execute(result);\n}\n//# sourceMappingURL=useMutation.js.map","import { useBaseQuery } from './utils/useBaseQuery';\nexport function useQuery(query, options) {\n return useBaseQuery(query, options, false);\n}\n//# sourceMappingURL=useQuery.js.map","import { __assign } from \"tslib\";\nimport { useContext, useState, useRef, useEffect } from 'react';\nimport { SubscriptionData } from '../data';\nimport { getApolloContext } from '../context';\nexport function useSubscription(subscription, options) {\n var context = useContext(getApolloContext());\n var updatedOptions = options\n ? __assign(__assign({}, options), { subscription: subscription }) : { subscription: subscription };\n var _a = useState({\n loading: !updatedOptions.skip,\n error: undefined,\n data: undefined\n }), result = _a[0], setResult = _a[1];\n var subscriptionDataRef = useRef();\n function getSubscriptionDataRef() {\n if (!subscriptionDataRef.current) {\n subscriptionDataRef.current = new SubscriptionData({\n options: updatedOptions,\n context: context,\n setResult: setResult\n });\n }\n return subscriptionDataRef.current;\n }\n var subscriptionData = getSubscriptionDataRef();\n subscriptionData.setOptions(updatedOptions, true);\n subscriptionData.context = context;\n useEffect(function () { return subscriptionData.afterExecute(); });\n useEffect(function () { return subscriptionData.cleanup.bind(subscriptionData); }, []);\n return subscriptionData.execute(result);\n}\n//# sourceMappingURL=useSubscription.js.map","import { useEffect, useState } from 'react';\nexport function useReactiveVar(rv) {\n var value = rv();\n var setValue = useState(value)[1];\n useEffect(function () {\n var probablySameValue = rv();\n if (value !== probablySameValue) {\n setValue(probablySameValue);\n }\n else {\n return rv.onNextChange(setValue);\n }\n }, [value]);\n return value;\n}\n//# sourceMappingURL=useReactiveVar.js.map"],"names":["getApolloContext","invariant","useRef","equal","context","useContext","useReducer","__assign","QueryData","useEffect","useState","MutationData","SubscriptionData"],"mappings":";;;;;;;;;;;AAGO,SAAS,eAAe,GAAG;AAClC,IAAI,IAAI,MAAM,GAAG,KAAK,CAAC,UAAU,CAACA,wBAAgB,EAAE,CAAC,CAAC,MAAM,CAAC;AAC7D,IAAI,OAAO,GAAGC,qBAAS,CAAC,MAAM,EAAE,iEAAiE;AACjG,QAAQ,sDAAsD,CAAC,GAAGA,qBAAS,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;AACxF,IAAI,OAAO,MAAM,CAAC;AAClB;;ACNO,SAAS,WAAW,CAAC,MAAM,EAAE,GAAG,EAAE;AACzC,IAAI,IAAI,GAAG,GAAGC,YAAM,EAAE,CAAC;AACvB,IAAI,IAAI,CAAC,GAAG,CAAC,OAAO,IAAI,CAACC,cAAK,CAAC,GAAG,EAAE,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE;AACtD,QAAQ,GAAG,CAAC,OAAO,GAAG,EA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CAAC;AACtD,IAAI,gBAAgB,CAAC,OAAO,GAAGA,SAAO,CAAC;AACvC,IAAIK,eAAS,CAAC,YAAY,EAAE,OAAO,gBAAgB,CAAC,YAAY,EAAE,CAAC,EAAE,CAAC,CAAC;AACvE,IAAIA,eAAS,CAAC,YAAY,EAAE,OAAO,gBAAgB,CAAC,OAAO,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;AAC3F,IAAI,OAAO,gBAAgB,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;AAC5C;;AC7BO,SAAS,cAAc,CAAC,EAAE,EAAE;AACnC,IAAI,IAAI,KAAK,GAAG,EAAE,EAAE,CAAC;AACrB,IAAI,IAAI,QAAQ,GAAGC,cAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;AACtC,IAAID,eAAS,CAAC,YAAY;AAC1B,QAAQ,IAAI,iBAAiB,GAAG,EAAE,EAAE,CAAC;AACrC,QAAQ,IAAI,KAAK,KAAK,iBAAiB,EAAE;AACzC,YAAY,QAAQ,CAAC,iBAAiB,CAAC,CAAC;AACxC,SAAS;AACT,aAAa;AACb,YAAY,OAAO,EAAE,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC;AAC7C,SAAS;AACT,KAAK,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC;AAChB,IAAI,OAAO,KAAK,CAAC;AACjB;;;;;;;;;"}
1
+ {"version":3,"file":"hooks.cjs.js","sources":["useApolloClient.js","utils/useDeepMemo.js","utils/useAfterFastRefresh.js","utils/useBaseQuery.js","useLazyQuery.js","useMutation.js","useQuery.js","useSubscription.js","useReactiveVar.js"],"sourcesContent":["import * as React from 'react';\nimport { invariant } from 'ts-invariant';\nimport { getApolloContext } from '../context';\nexport function useApolloClient() {\n var client = React.useContext(getApolloContext()).client;\n __DEV__ ? invariant(client, 'No Apollo Client instance can be found. Please ensure that you ' +\n 'have called `ApolloProvider` higher up in your tree.') : invariant(client, 36);\n return client;\n}\n//# sourceMappingURL=useApolloClient.js.map","import { useRef } from 'react';\nimport { equal } from '@wry/equality';\nexport function useDeepMemo(memoFn, key) {\n var ref = useRef();\n if (!ref.current || !equal(key, ref.current.key)) {\n ref.current = { key: key, value: memoFn() };\n }\n return ref.current.value;\n}\n//# sourceMappingURL=useDeepMemo.js.map","import { useEffect, useRef } from \"react\";\nexport function useAfterFastRefresh(effectFn) {\n if (__DEV__) {\n var didRefresh_1 = useRef(false);\n useEffect(function () {\n return function () {\n didRefresh_1.current = true;\n };\n }, []);\n useEffect(function () {\n if (didRefresh_1.current === true) {\n didRefresh_1.current = false;\n effectFn();\n }\n }, []);\n }\n}\n//# sourceMappingURL=useAfterFastRefresh.js.map","import { __assign } from \"tslib\";\nimport { useContext, useEffect, useReducer, useRef } from 'react';\nimport { QueryData } from '../../data';\nimport { useDeepMemo } from './useDeepMemo';\nimport { getApolloContext } from '../../context';\nimport { useAfterFastRefresh } from './useAfterFastRefresh';\nexport function useBaseQuery(query, options, lazy) {\n if (lazy === void 0) { lazy = false; }\n var context = useContext(getApolloContext());\n var _a = useReducer(function (x) { return x + 1; }, 0), tick = _a[0], forceUpdate = _a[1];\n var updatedOptions = options ? __assign(__assign({}, options), { query: query }) : { query: query };\n var queryDataRef = useRef();\n var queryData = queryDataRef.current || (queryDataRef.current = new QueryData({\n options: updatedOptions,\n context: context,\n onNewData: function () {\n if (!queryData.ssrInitiated()) {\n Promise.resolve().then(function () { return queryDataRef.current && queryDataRef.current.isMounted && forceUpdate(); });\n }\n else {\n forceUpdate();\n }\n }\n }));\n queryData.setOptions(updatedOptions);\n queryData.context = context;\n var memo = {\n options: __assign(__assign({}, updatedOptions), { onError: void 0, onCompleted: void 0 }),\n context: context,\n tick: tick\n };\n var result = useDeepMemo(function () { return (lazy ? queryData.executeLazy() : queryData.execute()); }, memo);\n var queryResult = lazy\n ? result[1]\n : result;\n if (__DEV__) {\n useAfterFastRefresh(forceUpdate);\n }\n useEffect(function () {\n return function () {\n queryData.cleanup();\n queryDataRef.current = void 0;\n };\n }, []);\n useEffect(function () { return queryData.afterExecute({ lazy: lazy }); }, [\n queryResult.loading,\n queryResult.networkStatus,\n queryResult.error,\n queryResult.data,\n ]);\n return result;\n}\n//# sourceMappingURL=useBaseQuery.js.map","import { useBaseQuery } from './utils/useBaseQuery';\nexport function useLazyQuery(query, options) {\n return useBaseQuery(query, options, true);\n}\n//# sourceMappingURL=useLazyQuery.js.map","import { __assign } from \"tslib\";\nimport { useContext, useState, useRef, useEffect } from 'react';\nimport { MutationData } from '../data';\nimport { getApolloContext } from '../context';\nexport function useMutation(mutation, options) {\n var context = useContext(getApolloContext());\n var _a = useState({ called: false, loading: false }), result = _a[0], setResult = _a[1];\n var updatedOptions = options ? __assign(__assign({}, options), { mutation: mutation }) : { mutation: mutation };\n var mutationDataRef = useRef();\n function getMutationDataRef() {\n if (!mutationDataRef.current) {\n mutationDataRef.current = new MutationData({\n options: updatedOptions,\n context: context,\n result: result,\n setResult: setResult\n });\n }\n return mutationDataRef.current;\n }\n var mutationData = getMutationDataRef();\n mutationData.setOptions(updatedOptions);\n mutationData.context = context;\n useEffect(function () { return mutationData.afterExecute(); });\n return mutationData.execute(result);\n}\n//# sourceMappingURL=useMutation.js.map","import { useBaseQuery } from './utils/useBaseQuery';\nexport function useQuery(query, options) {\n return useBaseQuery(query, options, false);\n}\n//# sourceMappingURL=useQuery.js.map","import { __assign } from \"tslib\";\nimport { useContext, useState, useRef, useEffect, useReducer } from 'react';\nimport { SubscriptionData } from '../data';\nimport { getApolloContext } from '../context';\nimport { useAfterFastRefresh } from './utils/useAfterFastRefresh';\nexport function useSubscription(subscription, options) {\n var _a = useReducer(function (x) { return x + 1; }, 0), forceUpdate = _a[1];\n var context = useContext(getApolloContext());\n var updatedOptions = options\n ? __assign(__assign({}, options), { subscription: subscription }) : { subscription: subscription };\n var _b = useState({\n loading: !updatedOptions.skip,\n error: void 0,\n data: void 0,\n }), result = _b[0], setResult = _b[1];\n var subscriptionDataRef = useRef();\n function getSubscriptionDataRef() {\n if (!subscriptionDataRef.current) {\n subscriptionDataRef.current = new SubscriptionData({\n options: updatedOptions,\n context: context,\n setResult: setResult\n });\n }\n return subscriptionDataRef.current;\n }\n var subscriptionData = getSubscriptionDataRef();\n subscriptionData.setOptions(updatedOptions, true);\n subscriptionData.context = context;\n if (__DEV__) {\n useAfterFastRefresh(forceUpdate);\n }\n useEffect(function () { return subscriptionData.afterExecute(); });\n useEffect(function () {\n return function () {\n subscriptionData.cleanup();\n subscriptionDataRef.current = void 0;\n };\n }, []);\n return subscriptionData.execute(result);\n}\n//# sourceMappingURL=useSubscription.js.map","import { useEffect, useState } from 'react';\nexport function useReactiveVar(rv) {\n var value = rv();\n var setValue = useState(value)[1];\n useEffect(function () {\n var probablySameValue = rv();\n if (value !== probablySameValue) {\n setValue(probablySameValue);\n }\n else {\n return rv.onNextChange(setValue);\n }\n }, [value]);\n return value;\n}\n//# sourceMappingURL=useReactiveVar.js.map"],"names":["React","getApolloContext","invariant","useRef","equal","useEffect","context","useContext","useReducer","__assign","QueryData","useState","MutationData","SubscriptionData"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAGO,SAAS,eAAe,GAAG;AAClC,IAAI,IAAI,MAAM,GAAGA,gBAAK,CAAC,UAAU,CAACC,wBAAgB,EAAE,CAAC,CAAC,MAAM,CAAC;AAC7D,IAAI,OAAO,GAAGC,qBAAS,CAAC,MAAM,EAAE,iEAAiE;AACjG,QAAQ,sDAAsD,CAAC,GAAGA,qBAAS,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;AACxF,IAAI,OAAO,MAAM,CAAC;AAClB;;ACNO,SAAS,WAAW,CAAC,MAAM,EAAE,GAAG,EAAE;AACzC,IAAI,IAAI,GAAG,GAAGC,YAAM,EAAE,CAAC;AACvB,IAAI,IAAI,CAAC,GAAG,CAAC,OAAO,IAAI,CAACC,cAAK,CAAC,GAAG,EAAE,GAAG,CAAC,OAAO,CAAC,GAAG,CAA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,QAAQ,OAAO,YAAY;AAC3B,YAAY,gBAAgB,CAAC,OAAO,EAAE,CAAC;AACvC,YAAY,mBAAmB,CAAC,OAAO,GAAG,KAAK,CAAC,CAAC;AACjD,SAAS,CAAC;AACV,KAAK,EAAE,EAAE,CAAC,CAAC;AACX,IAAI,OAAO,gBAAgB,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;AAC5C;;ACvCO,SAAS,cAAc,CAAC,EAAE,EAAE;AACnC,IAAI,IAAI,KAAK,GAAG,EAAE,EAAE,CAAC;AACrB,IAAI,IAAI,QAAQ,GAAGM,cAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;AACtC,IAAIN,eAAS,CAAC,YAAY;AAC1B,QAAQ,IAAI,iBAAiB,GAAG,EAAE,EAAE,CAAC;AACrC,QAAQ,IAAI,KAAK,KAAK,iBAAiB,EAAE;AACzC,YAAY,QAAQ,CAAC,iBAAiB,CAAC,CAAC;AACxC,SAAS;AACT,aAAa;AACb,YAAY,OAAO,EAAE,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC;AAC7C,SAAS;AACT,KAAK,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC;AAChB,IAAI,OAAO,KAAK,CAAC;AACjB;;;;;;;;;"}
@@ -4,7 +4,7 @@ import { getApolloContext } from "../context/index.js";
4
4
  export function useApolloClient() {
5
5
  var client = React.useContext(getApolloContext()).client;
6
6
  __DEV__ ? invariant(client, 'No Apollo Client instance can be found. Please ensure that you ' +
7
- 'have called `ApolloProvider` higher up in your tree.') : invariant(client, 34);
7
+ 'have called `ApolloProvider` higher up in your tree.') : invariant(client, 36);
8
8
  return client;
9
9
  }
10
10
  //# sourceMappingURL=useApolloClient.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useSubscription.d.ts","sourceRoot":"","sources":["../../../src/react/hooks/useSubscription.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AAEtE,OAAO,EAAE,uBAAuB,EAAE,MAAM,gBAAgB,CAAC;AAEzD,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAGhD,wBAAgB,eAAe,CAAC,KAAK,GAAG,GAAG,EAAE,UAAU,GAAG,kBAAkB,EAC1E,YAAY,EAAE,YAAY,GAAG,iBAAiB,CAAC,KAAK,EAAE,UAAU,CAAC,EACjE,OAAO,CAAC,EAAE,uBAAuB,CAAC,KAAK,EAAE,UAAU,CAAC;;;;;EAgCrD"}
1
+ {"version":3,"file":"useSubscription.d.ts","sourceRoot":"","sources":["../../../src/react/hooks/useSubscription.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AAEtE,OAAO,EAAE,uBAAuB,EAAE,MAAM,gBAAgB,CAAC;AAEzD,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAIhD,wBAAgB,eAAe,CAAC,KAAK,GAAG,GAAG,EAAE,UAAU,GAAG,kBAAkB,EAC1E,YAAY,EAAE,YAAY,GAAG,iBAAiB,CAAC,KAAK,EAAE,UAAU,CAAC,EACjE,OAAO,CAAC,EAAE,uBAAuB,CAAC,KAAK,EAAE,UAAU,CAAC;;;;;EA2CrD"}
@@ -1,16 +1,18 @@
1
1
  import { __assign } from "tslib";
2
- import { useContext, useState, useRef, useEffect } from 'react';
2
+ import { useContext, useState, useRef, useEffect, useReducer } from 'react';
3
3
  import { SubscriptionData } from "../data/index.js";
4
4
  import { getApolloContext } from "../context/index.js";
5
+ import { useAfterFastRefresh } from "./utils/useAfterFastRefresh.js";
5
6
  export function useSubscription(subscription, options) {
7
+ var _a = useReducer(function (x) { return x + 1; }, 0), forceUpdate = _a[1];
6
8
  var context = useContext(getApolloContext());
7
9
  var updatedOptions = options
8
10
  ? __assign(__assign({}, options), { subscription: subscription }) : { subscription: subscription };
9
- var _a = useState({
11
+ var _b = useState({
10
12
  loading: !updatedOptions.skip,
11
- error: undefined,
12
- data: undefined
13
- }), result = _a[0], setResult = _a[1];
13
+ error: void 0,
14
+ data: void 0,
15
+ }), result = _b[0], setResult = _b[1];
14
16
  var subscriptionDataRef = useRef();
15
17
  function getSubscriptionDataRef() {
16
18
  if (!subscriptionDataRef.current) {
@@ -25,8 +27,16 @@ export function useSubscription(subscription, options) {
25
27
  var subscriptionData = getSubscriptionDataRef();
26
28
  subscriptionData.setOptions(updatedOptions, true);
27
29
  subscriptionData.context = context;
30
+ if (__DEV__) {
31
+ useAfterFastRefresh(forceUpdate);
32
+ }
28
33
  useEffect(function () { return subscriptionData.afterExecute(); });
29
- useEffect(function () { return subscriptionData.cleanup.bind(subscriptionData); }, []);
34
+ useEffect(function () {
35
+ return function () {
36
+ subscriptionData.cleanup();
37
+ subscriptionDataRef.current = void 0;
38
+ };
39
+ }, []);
30
40
  return subscriptionData.execute(result);
31
41
  }
32
42
  //# sourceMappingURL=useSubscription.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useSubscription.js","sourceRoot":"","sources":["../../../src/react/hooks/useSubscription.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAKhE,OAAO,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAE3C,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAE9C,MAAM,UAAU,eAAe,CAC7B,YAAiE,EACjE,OAAoD;IAEpD,IAAM,OAAO,GAAG,UAAU,CAAC,gBAAgB,EAAE,CAAC,CAAC;IAC/C,IAAM,cAAc,GAAG,OAAO;QAC5B,CAAC,uBAAM,OAAO,KAAE,YAAY,cAAA,IAC5B,CAAC,CAAC,EAAE,YAAY,cAAA,EAAE,CAAC;IACf,IAAA,KAAsB,QAAQ,CAAC;QACnC,OAAO,EAAE,CAAC,cAAc,CAAC,IAAI;QAC7B,KAAK,EAAE,SAAS;QAChB,IAAI,EAAE,SAAS;KAChB,CAAC,EAJK,MAAM,QAAA,EAAE,SAAS,QAItB,CAAC;IAEH,IAAM,mBAAmB,GAAG,MAAM,EAAuC,CAAC;IAC1E,SAAS,sBAAsB;QAC7B,IAAI,CAAC,mBAAmB,CAAC,OAAO,EAAE;YAChC,mBAAmB,CAAC,OAAO,GAAG,IAAI,gBAAgB,CAAoB;gBACpE,OAAO,EAAE,cAAc;gBACvB,OAAO,SAAA;gBACP,SAAS,WAAA;aACV,CAAC,CAAC;SACJ;QACD,OAAO,mBAAmB,CAAC,OAAO,CAAC;IACrC,CAAC;IAED,IAAM,gBAAgB,GAAG,sBAAsB,EAAE,CAAC;IAClD,gBAAgB,CAAC,UAAU,CAAC,cAAc,EAAE,IAAI,CAAC,CAAC;IAClD,gBAAgB,CAAC,OAAO,GAAG,OAAO,CAAC;IAEnC,SAAS,CAAC,cAAM,OAAA,gBAAgB,CAAC,YAAY,EAAE,EAA/B,CAA+B,CAAC,CAAC;IACjD,SAAS,CAAC,cAAM,OAAA,gBAAgB,CAAC,OAAO,CAAC,IAAI,CAAC,gBAAgB,CAAC,EAA/C,CAA+C,EAAE,EAAE,CAAC,CAAC;IAErE,OAAO,gBAAgB,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;AAC1C,CAAC","sourcesContent":["import { useContext, useState, useRef, useEffect } from 'react';\nimport { DocumentNode } from 'graphql';\nimport { TypedDocumentNode } from '@graphql-typed-document-node/core';\n\nimport { SubscriptionHookOptions } from '../types/types';\nimport { SubscriptionData } from '../data';\nimport { OperationVariables } from '../../core';\nimport { getApolloContext } from '../context';\n\nexport function useSubscription<TData = any, TVariables = OperationVariables>(\n subscription: DocumentNode | TypedDocumentNode<TData, TVariables>,\n options?: SubscriptionHookOptions<TData, TVariables>\n) {\n const context = useContext(getApolloContext());\n const updatedOptions = options\n ? { ...options, subscription }\n : { subscription };\n const [result, setResult] = useState({\n loading: !updatedOptions.skip,\n error: undefined,\n data: undefined\n });\n\n const subscriptionDataRef = useRef<SubscriptionData<TData, TVariables>>();\n function getSubscriptionDataRef() {\n if (!subscriptionDataRef.current) {\n subscriptionDataRef.current = new SubscriptionData<TData, TVariables>({\n options: updatedOptions,\n context,\n setResult\n });\n }\n return subscriptionDataRef.current;\n }\n\n const subscriptionData = getSubscriptionDataRef();\n subscriptionData.setOptions(updatedOptions, true);\n subscriptionData.context = context;\n\n useEffect(() => subscriptionData.afterExecute());\n useEffect(() => subscriptionData.cleanup.bind(subscriptionData), []);\n\n return subscriptionData.execute(result);\n}\n"]}
1
+ {"version":3,"file":"useSubscription.js","sourceRoot":"","sources":["../../../src/react/hooks/useSubscription.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAK5E,OAAO,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAE3C,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAC9C,OAAO,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AAElE,MAAM,UAAU,eAAe,CAC7B,YAAiE,EACjE,OAAoD;IAE9C,IAAA,KAAkB,UAAU,CAAC,UAAA,CAAC,IAAI,OAAA,CAAC,GAAG,CAAC,EAAL,CAAK,EAAE,CAAC,CAAC,EAAxC,WAAW,QAA6B,CAAC;IAClD,IAAM,OAAO,GAAG,UAAU,CAAC,gBAAgB,EAAE,CAAC,CAAC;IAC/C,IAAM,cAAc,GAAG,OAAO;QAC5B,CAAC,uBAAM,OAAO,KAAE,YAAY,cAAA,IAC5B,CAAC,CAAC,EAAE,YAAY,cAAA,EAAE,CAAC;IACf,IAAA,KAAsB,QAAQ,CAAC;QACnC,OAAO,EAAE,CAAC,cAAc,CAAC,IAAI;QAC7B,KAAK,EAAE,KAAK,CAAC;QACb,IAAI,EAAE,KAAK,CAAC;KACb,CAAC,EAJK,MAAM,QAAA,EAAE,SAAS,QAItB,CAAC;IAEH,IAAM,mBAAmB,GAAG,MAAM,EAAuC,CAAC;IAC1E,SAAS,sBAAsB;QAC7B,IAAI,CAAC,mBAAmB,CAAC,OAAO,EAAE;YAChC,mBAAmB,CAAC,OAAO,GAAG,IAAI,gBAAgB,CAAoB;gBACpE,OAAO,EAAE,cAAc;gBACvB,OAAO,SAAA;gBACP,SAAS,WAAA;aACV,CAAC,CAAC;SACJ;QACD,OAAO,mBAAmB,CAAC,OAAO,CAAC;IACrC,CAAC;IAED,IAAM,gBAAgB,GAAG,sBAAsB,EAAE,CAAC;IAClD,gBAAgB,CAAC,UAAU,CAAC,cAAc,EAAE,IAAI,CAAC,CAAC;IAClD,gBAAgB,CAAC,OAAO,GAAG,OAAO,CAAC;IAEnC,IAAI,OAAO,EAAE;QAEX,mBAAmB,CAAC,WAAW,CAAC,CAAC;KAClC;IAED,SAAS,CAAC,cAAM,OAAA,gBAAgB,CAAC,YAAY,EAAE,EAA/B,CAA+B,CAAC,CAAC;IACjD,SAAS,CAAC;QACR,OAAO;YACL,gBAAgB,CAAC,OAAO,EAAE,CAAC;YAC3B,mBAAmB,CAAC,OAAO,GAAG,KAAK,CAAC,CAAC;QACvC,CAAC,CAAC;IACJ,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,OAAO,gBAAgB,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;AAC1C,CAAC","sourcesContent":["import { useContext, useState, useRef, useEffect, useReducer } from 'react';\nimport { DocumentNode } from 'graphql';\nimport { TypedDocumentNode } from '@graphql-typed-document-node/core';\n\nimport { SubscriptionHookOptions } from '../types/types';\nimport { SubscriptionData } from '../data';\nimport { OperationVariables } from '../../core';\nimport { getApolloContext } from '../context';\nimport { useAfterFastRefresh } from './utils/useAfterFastRefresh';\n\nexport function useSubscription<TData = any, TVariables = OperationVariables>(\n subscription: DocumentNode | TypedDocumentNode<TData, TVariables>,\n options?: SubscriptionHookOptions<TData, TVariables>\n) {\n const [, forceUpdate] = useReducer(x => x + 1, 0);\n const context = useContext(getApolloContext());\n const updatedOptions = options\n ? { ...options, subscription }\n : { subscription };\n const [result, setResult] = useState({\n loading: !updatedOptions.skip,\n error: void 0,\n data: void 0,\n });\n\n const subscriptionDataRef = useRef<SubscriptionData<TData, TVariables>>();\n function getSubscriptionDataRef() {\n if (!subscriptionDataRef.current) {\n subscriptionDataRef.current = new SubscriptionData<TData, TVariables>({\n options: updatedOptions,\n context,\n setResult\n });\n }\n return subscriptionDataRef.current;\n }\n\n const subscriptionData = getSubscriptionDataRef();\n subscriptionData.setOptions(updatedOptions, true);\n subscriptionData.context = context;\n\n if (__DEV__) {\n // ensure we run an update after refreshing so that we can resubscribe\n useAfterFastRefresh(forceUpdate);\n }\n\n useEffect(() => subscriptionData.afterExecute());\n useEffect(() => {\n return () => {\n subscriptionData.cleanup();\n subscriptionDataRef.current = void 0;\n };\n }, []);\n\n return subscriptionData.execute(result);\n}\n"]}