@apollo/client 3.4.7 → 3.4.11

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 (227) hide show
  1. package/README.md +2 -2
  2. package/apollo-client.cjs.js +155 -156
  3. package/apollo-client.cjs.js.map +1 -1
  4. package/apollo-core.cjs.js +140 -103
  5. package/apollo-core.cjs.js.map +1 -1
  6. package/apollo-core.cjs.min.js +1 -1
  7. package/cache/cache.cjs.js +29 -28
  8. package/cache/cache.cjs.js.map +1 -1
  9. package/cache/index.d.ts +1 -0
  10. package/cache/index.d.ts.map +1 -1
  11. package/cache/index.js +1 -3
  12. package/cache/index.js.map +1 -1
  13. package/cache/inmemory/entityStore.js +2 -2
  14. package/cache/inmemory/entityStore.js.map +1 -1
  15. package/cache/inmemory/object-canon.d.ts +1 -0
  16. package/cache/inmemory/object-canon.d.ts.map +1 -1
  17. package/cache/inmemory/object-canon.js +1 -0
  18. package/cache/inmemory/object-canon.js.map +1 -1
  19. package/cache/inmemory/policies.d.ts.map +1 -1
  20. package/cache/inmemory/policies.js +13 -10
  21. package/cache/inmemory/policies.js.map +1 -1
  22. package/cache/inmemory/readFromStore.d.ts.map +1 -1
  23. package/cache/inmemory/readFromStore.js +4 -4
  24. package/cache/inmemory/readFromStore.js.map +1 -1
  25. package/cache/inmemory/writeToStore.d.ts.map +1 -1
  26. package/cache/inmemory/writeToStore.js +2 -2
  27. package/cache/inmemory/writeToStore.js.map +1 -1
  28. package/core/ApolloClient.d.ts.map +1 -1
  29. package/core/ApolloClient.js +3 -3
  30. package/core/ApolloClient.js.map +1 -1
  31. package/core/LocalState.d.ts.map +1 -1
  32. package/core/LocalState.js +2 -2
  33. package/core/LocalState.js.map +1 -1
  34. package/core/ObservableQuery.d.ts +7 -6
  35. package/core/ObservableQuery.d.ts.map +1 -1
  36. package/core/ObservableQuery.js +79 -46
  37. package/core/ObservableQuery.js.map +1 -1
  38. package/core/QueryManager.d.ts.map +1 -1
  39. package/core/QueryManager.js +10 -10
  40. package/core/QueryManager.js.map +1 -1
  41. package/core/core.cjs.js +109 -75
  42. package/core/core.cjs.js.map +1 -1
  43. package/core/index.js +1 -1
  44. package/core/index.js.map +1 -1
  45. package/errors/errors.cjs.js +1 -2
  46. package/errors/errors.cjs.js.map +1 -1
  47. package/errors/index.d.ts +1 -0
  48. package/errors/index.d.ts.map +1 -1
  49. package/errors/index.js +1 -3
  50. package/errors/index.js.map +1 -1
  51. package/invariantErrorCodes.js +56 -81
  52. package/link/core/ApolloLink.js +2 -2
  53. package/link/core/ApolloLink.js.map +1 -1
  54. package/link/core/core.cjs.js +4 -6
  55. package/link/core/core.cjs.js.map +1 -1
  56. package/link/core/index.d.ts +1 -0
  57. package/link/core/index.d.ts.map +1 -1
  58. package/link/core/index.js +1 -3
  59. package/link/core/index.js.map +1 -1
  60. package/link/http/checkFetcher.js +2 -2
  61. package/link/http/checkFetcher.js.map +1 -1
  62. package/link/http/createHttpLink.d.ts +1 -0
  63. package/link/http/createHttpLink.d.ts.map +1 -1
  64. package/link/http/createHttpLink.js +1 -0
  65. package/link/http/createHttpLink.js.map +1 -1
  66. package/link/http/http.cjs.js +3 -3
  67. package/link/http/http.cjs.js.map +1 -1
  68. package/link/http/index.d.ts +1 -0
  69. package/link/http/index.d.ts.map +1 -1
  70. package/link/http/index.js +1 -0
  71. package/link/http/index.js.map +1 -1
  72. package/link/http/serializeFetchParameter.d.ts +1 -1
  73. package/link/http/serializeFetchParameter.d.ts.map +1 -1
  74. package/link/http/serializeFetchParameter.js +2 -2
  75. package/link/http/serializeFetchParameter.js.map +1 -1
  76. package/link/persisted-queries/index.d.ts +1 -1
  77. package/link/persisted-queries/index.d.ts.map +1 -1
  78. package/link/persisted-queries/index.js +4 -4
  79. package/link/persisted-queries/index.js.map +1 -1
  80. package/link/persisted-queries/persisted-queries.cjs.js +8 -5
  81. package/link/persisted-queries/persisted-queries.cjs.js.map +1 -1
  82. package/link/utils/index.d.ts +1 -0
  83. package/link/utils/index.d.ts.map +1 -1
  84. package/link/utils/index.js +1 -0
  85. package/link/utils/index.js.map +1 -1
  86. package/link/utils/toPromise.d.ts.map +1 -1
  87. package/link/utils/toPromise.js +1 -1
  88. package/link/utils/toPromise.js.map +1 -1
  89. package/link/utils/utils.cjs.js +3 -3
  90. package/link/utils/utils.cjs.js.map +1 -1
  91. package/link/utils/validateOperation.d.ts.map +1 -1
  92. package/link/utils/validateOperation.js +2 -2
  93. package/link/utils/validateOperation.js.map +1 -1
  94. package/package.json +11 -11
  95. package/react/context/ApolloConsumer.d.ts.map +1 -1
  96. package/react/context/ApolloConsumer.js +2 -2
  97. package/react/context/ApolloConsumer.js.map +1 -1
  98. package/react/context/ApolloProvider.d.ts.map +1 -1
  99. package/react/context/ApolloProvider.js +2 -2
  100. package/react/context/ApolloProvider.js.map +1 -1
  101. package/react/context/context.cjs.js +5 -5
  102. package/react/context/context.cjs.js.map +1 -1
  103. package/react/context/index.d.ts +1 -0
  104. package/react/context/index.d.ts.map +1 -1
  105. package/react/context/index.js +1 -0
  106. package/react/context/index.js.map +1 -1
  107. package/react/data/OperationData.d.ts.map +1 -1
  108. package/react/data/OperationData.js +3 -3
  109. package/react/data/OperationData.js.map +1 -1
  110. package/react/data/QueryData.d.ts.map +1 -1
  111. package/react/data/QueryData.js +9 -11
  112. package/react/data/QueryData.js.map +1 -1
  113. package/react/data/data.cjs.js +14 -16
  114. package/react/data/data.cjs.js.map +1 -1
  115. package/react/data/index.d.ts +1 -0
  116. package/react/data/index.d.ts.map +1 -1
  117. package/react/data/index.js +1 -0
  118. package/react/data/index.js.map +1 -1
  119. package/react/hoc/hoc-utils.d.ts.map +1 -1
  120. package/react/hoc/hoc-utils.js +2 -2
  121. package/react/hoc/hoc-utils.js.map +1 -1
  122. package/react/hoc/hoc.cjs.js +5 -5
  123. package/react/hoc/hoc.cjs.js.map +1 -1
  124. package/react/hoc/index.d.ts +1 -0
  125. package/react/hoc/index.d.ts.map +1 -1
  126. package/react/hoc/index.js +1 -0
  127. package/react/hoc/index.js.map +1 -1
  128. package/react/hoc/withApollo.d.ts.map +1 -1
  129. package/react/hoc/withApollo.js +2 -2
  130. package/react/hoc/withApollo.js.map +1 -1
  131. package/react/hooks/hooks.cjs.js +3 -3
  132. package/react/hooks/hooks.cjs.js.map +1 -1
  133. package/react/hooks/index.d.ts +1 -0
  134. package/react/hooks/index.d.ts.map +1 -1
  135. package/react/hooks/index.js +1 -0
  136. package/react/hooks/index.js.map +1 -1
  137. package/react/hooks/useApolloClient.d.ts.map +1 -1
  138. package/react/hooks/useApolloClient.js +2 -2
  139. package/react/hooks/useApolloClient.js.map +1 -1
  140. package/react/hooks/useSubscription.d.ts +1 -0
  141. package/react/hooks/useSubscription.d.ts.map +1 -1
  142. package/react/hooks/useSubscription.js +1 -0
  143. package/react/hooks/useSubscription.js.map +1 -1
  144. package/react/hooks/utils/useAfterFastRefresh.d.ts +1 -0
  145. package/react/hooks/utils/useAfterFastRefresh.d.ts.map +1 -1
  146. package/react/hooks/utils/useAfterFastRefresh.js +1 -0
  147. package/react/hooks/utils/useAfterFastRefresh.js.map +1 -1
  148. package/react/hooks/utils/useBaseQuery.d.ts +1 -0
  149. package/react/hooks/utils/useBaseQuery.d.ts.map +1 -1
  150. package/react/hooks/utils/useBaseQuery.js +1 -0
  151. package/react/hooks/utils/useBaseQuery.js.map +1 -1
  152. package/react/index.d.ts +1 -0
  153. package/react/index.d.ts.map +1 -1
  154. package/react/index.js +1 -3
  155. package/react/index.js.map +1 -1
  156. package/react/parser/index.d.ts.map +1 -1
  157. package/react/parser/index.js +5 -5
  158. package/react/parser/index.js.map +1 -1
  159. package/react/parser/parser.cjs.js +10 -10
  160. package/react/parser/parser.cjs.js.map +1 -1
  161. package/react/react.cjs.js +2 -3
  162. package/react/react.cjs.js.map +1 -1
  163. package/testing/index.d.ts +1 -0
  164. package/testing/index.d.ts.map +1 -1
  165. package/testing/index.js +1 -3
  166. package/testing/index.js.map +1 -1
  167. package/testing/testing.cjs.js +3 -5
  168. package/testing/testing.cjs.js.map +1 -1
  169. package/utilities/common/mergeDeep.js +1 -1
  170. package/utilities/common/mergeDeep.js.map +1 -1
  171. package/utilities/globals/DEV.js +2 -2
  172. package/utilities/globals/DEV.js.map +1 -1
  173. package/utilities/{common → globals}/global.d.ts +0 -0
  174. package/utilities/globals/global.d.ts.map +1 -0
  175. package/utilities/{common → globals}/global.js +0 -0
  176. package/utilities/globals/global.js.map +1 -0
  177. package/utilities/globals/globals.cjs.js +57 -0
  178. package/utilities/globals/globals.cjs.js.map +1 -0
  179. package/utilities/globals/index.d.ts +5 -2
  180. package/utilities/globals/index.d.ts.map +1 -1
  181. package/utilities/globals/index.js +8 -1
  182. package/utilities/globals/index.js.map +1 -1
  183. package/utilities/{common → globals}/maybe.d.ts +0 -0
  184. package/utilities/globals/maybe.d.ts.map +1 -0
  185. package/utilities/{common → globals}/maybe.js +0 -0
  186. package/utilities/globals/maybe.js.map +1 -0
  187. package/utilities/globals/package.json +7 -0
  188. package/utilities/graphql/directives.d.ts.map +1 -1
  189. package/utilities/graphql/directives.js +5 -5
  190. package/utilities/graphql/directives.js.map +1 -1
  191. package/utilities/graphql/fragments.d.ts.map +1 -1
  192. package/utilities/graphql/fragments.js +5 -5
  193. package/utilities/graphql/fragments.js.map +1 -1
  194. package/utilities/graphql/getFromAST.d.ts.map +1 -1
  195. package/utilities/graphql/getFromAST.js +9 -9
  196. package/utilities/graphql/getFromAST.js.map +1 -1
  197. package/utilities/graphql/storeUtils.d.ts.map +1 -1
  198. package/utilities/graphql/storeUtils.js +2 -2
  199. package/utilities/graphql/storeUtils.js.map +1 -1
  200. package/utilities/graphql/transform.d.ts.map +1 -1
  201. package/utilities/graphql/transform.js +2 -2
  202. package/utilities/graphql/transform.js.map +1 -1
  203. package/utilities/index.d.ts +1 -3
  204. package/utilities/index.d.ts.map +1 -1
  205. package/utilities/index.js +1 -5
  206. package/utilities/index.js.map +1 -1
  207. package/utilities/observables/Concast.js +1 -1
  208. package/utilities/observables/Concast.js.map +1 -1
  209. package/utilities/package.json +1 -3
  210. package/utilities/policies/pagination.js +2 -2
  211. package/utilities/policies/pagination.js.map +1 -1
  212. package/utilities/testing/mocking/mockFetch.js +1 -1
  213. package/utilities/testing/mocking/mockFetch.js.map +1 -1
  214. package/utilities/testing/mocking/mockLink.d.ts.map +1 -1
  215. package/utilities/testing/mocking/mockLink.js +2 -2
  216. package/utilities/testing/mocking/mockLink.js.map +1 -1
  217. package/utilities/testing/mocking/mockWatchQuery.js +1 -1
  218. package/utilities/testing/mocking/mockWatchQuery.js.map +1 -1
  219. package/utilities/testing/observableToPromise.js +1 -1
  220. package/utilities/testing/observableToPromise.js.map +1 -1
  221. package/utilities/utilities.cjs.js +30 -71
  222. package/utilities/utilities.cjs.js.map +1 -1
  223. package/version.js +1 -1
  224. package/utilities/common/global.d.ts.map +0 -1
  225. package/utilities/common/global.js.map +0 -1
  226. package/utilities/common/maybe.d.ts.map +0 -1
  227. package/utilities/common/maybe.js.map +0 -1
@@ -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, 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","invari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ACjD,QAAQ,UAAU,CAAC,gBAAgB,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
+ {"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 { invariant } from '../../utilities/globals';\nimport * as React from 'react';\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, 31);\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 { invariant } from '../../utilities/globals';\nimport * as React from 'react';\nimport hoistNonReactStatics from 'hoist-non-react-statics';\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, 32);\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","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,2BAA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,YAAY,OAAO,IAAI,CAAC,eAAe,CAAC;AACxC,SAAS,CAAC;AACV,QAAQ,UAAU,CAAC,SAAS,CAAC,kBAAkB,GAAG,UAAU,GAAG,EAAE;AACjE,YAAY,IAAI,CAAC,eAAe,GAAG,GAAG,CAAC;AACvC,SAAS,CAAC;AACV,QAAQ,UAAU,CAAC,SAAS,CAAC,MAAM,GAAG,YAAY;AAClD,YAAY,IAAI,KAAK,GAAG,IAAI,CAAC;AAC7B,YAAY,QAAQC,gBAAK,CAAC,aAAa,CAACS,sBAAc,EAAE,IAAI,EAAE,UAAU,MAAM,EAAE;AAChF,gBAAgB,IAAI,KAAK,GAAG,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,KAAK,CAAC,KAAK,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,OAAOT,gBAAK,CAAC,aAAa,CAAC,gBAAgB,EAAEE,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,CAACF,gBAAK,CAAC,SAAS,CAAC,CAAC,CAAC;AACxB,IAAI,OAAOK,6BAAoB,CAAC,UAAU,EAAE,gBAAgB,EAAE,EAAE,CAAC,CAAC;AAClE;;;;;;;;"}
@@ -1,3 +1,4 @@
1
+ import '../../utilities/globals';
1
2
  export { graphql } from './graphql';
2
3
  export { withQuery } from './query-hoc';
3
4
  export { withMutation } from './mutation-hoc';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/react/hoc/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C,cAAc,SAAS,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/react/hoc/index.ts"],"names":[],"mappings":"AAAA,OAAO,yBAAyB,CAAC;AAEjC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C,cAAc,SAAS,CAAC"}
@@ -1,3 +1,4 @@
1
+ import "../../utilities/globals/index.js";
1
2
  export { graphql } from "./graphql.js";
2
3
  export { withQuery } from "./query-hoc.js";
3
4
  export { withMutation } from "./mutation-hoc.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/react/hoc/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C,cAAc,SAAS,CAAC","sourcesContent":["export { graphql } from './graphql';\n\nexport { withQuery } from './query-hoc';\nexport { withMutation } from './mutation-hoc';\nexport { withSubscription } from './subscription-hoc';\nexport { withApollo } from './withApollo';\n\nexport * from './types';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/react/hoc/index.ts"],"names":[],"mappings":"AAAA,OAAO,yBAAyB,CAAC;AAEjC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C,cAAc,SAAS,CAAC","sourcesContent":["import '../../utilities/globals';\n\nexport { graphql } from './graphql';\n\nexport { withQuery } from './query-hoc';\nexport { withMutation } from './mutation-hoc';\nexport { withSubscription } from './subscription-hoc';\nexport { withApollo } from './withApollo';\n\nexport * from './types';\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"withApollo.d.ts","sourceRoot":"","sources":["../../../src/react/hoc/withApollo.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAM5D,wBAAgB,UAAU,CAAC,MAAM,EAAE,OAAO,GAAG,GAAG,EAC9C,gBAAgB,EAAE,KAAK,CAAC,aAAa,CACnC,gBAAgB,CAAC,IAAI,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC,CACzC,EACD,gBAAgB,GAAE,eAAe,CAAC,MAAM,EAAE,OAAO,CAAM,GACtD,KAAK,CAAC,cAAc,CAAC,IAAI,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC,CAgD9C"}
1
+ {"version":3,"file":"withApollo.d.ts","sourceRoot":"","sources":["../../../src/react/hoc/withApollo.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAM5D,wBAAgB,UAAU,CAAC,MAAM,EAAE,OAAO,GAAG,GAAG,EAC9C,gBAAgB,EAAE,KAAK,CAAC,aAAa,CACnC,gBAAgB,CAAC,IAAI,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC,CACzC,EACD,gBAAgB,GAAE,eAAe,CAAC,MAAM,EAAE,OAAO,CAAM,GACtD,KAAK,CAAC,cAAc,CAAC,IAAI,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC,CAgD9C"}
@@ -1,7 +1,7 @@
1
1
  import { __assign, __extends } from "tslib";
2
+ import { invariant } from "../../utilities/globals/index.js";
2
3
  import * as React from 'react';
3
4
  import hoistNonReactStatics from 'hoist-non-react-statics';
4
- import { invariant } from 'ts-invariant';
5
5
  import { ApolloConsumer } from "../context/index.js";
6
6
  function getDisplayName(WrappedComponent) {
7
7
  return WrappedComponent.displayName || WrappedComponent.name || 'Component';
@@ -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, 35);
21
+ "{ withRef: true } in the options") : invariant(operationOptions.withRef, 32);
22
22
  return this.wrappedInstance;
23
23
  };
24
24
  WithApollo.prototype.setWrappedInstance = function (ref) {
@@ -1 +1 @@
1
- {"version":3,"file":"withApollo.js","sourceRoot":"","sources":["../../../src/react/hoc/withApollo.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,oBAAoB,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAG5C,S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AAoB,CAAC,UAAU,EAAE,gBAAgB,EAAE,EAAE,CAAC,CAAC;AAChE,CAAC","sourcesContent":["import * as React from 'react';\nimport hoistNonReactStatics from 'hoist-non-react-statics';\nimport { invariant } from 'ts-invariant';\n\nimport { ApolloConsumer } from '../context';\nimport { OperationOption, WithApolloClient } from './types';\n\nfunction getDisplayName<P>(WrappedComponent: React.ComponentType<P>) {\n return WrappedComponent.displayName || WrappedComponent.name || 'Component';\n}\n\nexport function withApollo<TProps, TResult = any>(\n WrappedComponent: React.ComponentType<\n WithApolloClient<Omit<TProps, 'client'>>\n >,\n operationOptions: OperationOption<TProps, TResult> = {}\n): React.ComponentClass<Omit<TProps, 'client'>> {\n const withDisplayName = `withApollo(${getDisplayName(WrappedComponent)})`;\n\n class WithApollo extends React.Component<Omit<TProps, 'client'>> {\n static displayName = withDisplayName;\n static WrappedComponent = WrappedComponent;\n\n // wrapped instance\n private wrappedInstance: any;\n\n constructor(props: Omit<TProps, 'client'>) {\n super(props);\n this.setWrappedInstance = this.setWrappedInstance.bind(this);\n }\n\n getWrappedInstance() {\n invariant(\n operationOptions.withRef,\n `To access the wrapped instance, you need to specify ` +\n `{ withRef: true } in the options`\n );\n\n return this.wrappedInstance;\n }\n\n setWrappedInstance(ref: React.ComponentType<WithApolloClient<TProps>>) {\n this.wrappedInstance = ref;\n }\n\n render() {\n return (\n <ApolloConsumer>\n {client => {\n const props = Object.assign({}, this.props, {\n client,\n ref: operationOptions.withRef\n ? this.setWrappedInstance\n : undefined\n });\n return <WrappedComponent {...props} />;\n }}\n </ApolloConsumer>\n );\n }\n }\n\n // Make sure we preserve any custom statics on the original component.\n return hoistNonReactStatics(WithApollo, WrappedComponent, {});\n}\n"]}
1
+ {"version":3,"file":"withApollo.js","sourceRoot":"","sources":["../../../src/react/hoc/withApollo.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACpD,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;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B,GAAG,gBAAgB,CAAC;QAuC7C,iBAAC;KAAA,AAzCD,CAAyB,KAAK,CAAC,SAAS,GAyCvC;IAGD,OAAO,oBAAoB,CAAC,UAAU,EAAE,gBAAgB,EAAE,EAAE,CAAC,CAAC;AAChE,CAAC","sourcesContent":["import { invariant } from '../../utilities/globals';\nimport * as React from 'react';\nimport hoistNonReactStatics from 'hoist-non-react-statics';\n\nimport { ApolloConsumer } from '../context';\nimport { OperationOption, WithApolloClient } from './types';\n\nfunction getDisplayName<P>(WrappedComponent: React.ComponentType<P>) {\n return WrappedComponent.displayName || WrappedComponent.name || 'Component';\n}\n\nexport function withApollo<TProps, TResult = any>(\n WrappedComponent: React.ComponentType<\n WithApolloClient<Omit<TProps, 'client'>>\n >,\n operationOptions: OperationOption<TProps, TResult> = {}\n): React.ComponentClass<Omit<TProps, 'client'>> {\n const withDisplayName = `withApollo(${getDisplayName(WrappedComponent)})`;\n\n class WithApollo extends React.Component<Omit<TProps, 'client'>> {\n static displayName = withDisplayName;\n static WrappedComponent = WrappedComponent;\n\n // wrapped instance\n private wrappedInstance: any;\n\n constructor(props: Omit<TProps, 'client'>) {\n super(props);\n this.setWrappedInstance = this.setWrappedInstance.bind(this);\n }\n\n getWrappedInstance() {\n invariant(\n operationOptions.withRef,\n `To access the wrapped instance, you need to specify ` +\n `{ withRef: true } in the options`\n );\n\n return this.wrappedInstance;\n }\n\n setWrappedInstance(ref: React.ComponentType<WithApolloClient<TProps>>) {\n this.wrappedInstance = ref;\n }\n\n render() {\n return (\n <ApolloConsumer>\n {client => {\n const props = Object.assign({}, this.props, {\n client,\n ref: operationOptions.withRef\n ? this.setWrappedInstance\n : undefined\n });\n return <WrappedComponent {...props} />;\n }}\n </ApolloConsumer>\n );\n }\n }\n\n // Make sure we preserve any custom statics on the original component.\n return hoistNonReactStatics(WithApollo, WrappedComponent, {});\n}\n"]}
@@ -2,8 +2,8 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
+ var globals = require('../../utilities/globals');
5
6
  var React = require('react');
6
- var tsInvariant = require('ts-invariant');
7
7
  var context = require('../context');
8
8
  var tslib = require('tslib');
9
9
  var data = require('../data');
@@ -25,8 +25,8 @@ var React__namespace = /*#__PURE__*/_interopNamespace(React);
25
25
 
26
26
  function useApolloClient() {
27
27
  var client = React__namespace.useContext(context.getApolloContext()).client;
28
- __DEV__ ? tsInvariant.invariant(client, 'No Apollo Client instance can be found. Please ensure that you ' +
29
- 'have called `ApolloProvider` higher up in your tree.') : tsInvariant.invariant(client, 36);
28
+ __DEV__ ? globals.invariant(client, 'No Apollo Client instance can be found. Please ensure that you ' +
29
+ 'have called `ApolloProvider` higher up in your tree.') : globals.invariant(client, 33);
30
30
  return client;
31
31
  }
32
32
 
@@ -1 +1 @@
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 queryData.currentObservable,\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,CAAC,EAAE;AACtD,QAAQ,GAAG,CAAC,OAAO,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,CAAC;AACpD,KAAK;AACL,IAAI,OAAO,GAAG,CAAC,OAAO,CAAC,KAAK,CAAC;AAC7B;;ACPO,SAAS,mBAAmB,CAAC,QAAQ,EAAE;AAC9C,IAAI,IAAI,OAAO,EAAE;AACjB,QAAQ,IAAI,YAAY,GAAGD,YAAM,CAAC,KAAK,CAAC,CAAC;AACzC,QAAQE,eAAS,CAAC,YAAY;AAC9B,YAAY,OAAO,YAAY;AAC/B,gBAA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Q,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;;;;;;;;;"}
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 { invariant } from '../../utilities/globals';\nimport * as React from 'react';\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, 33);\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 '../../../utilities/globals';\nimport { 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 '../../../utilities/globals';\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 queryData.currentObservable,\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 '../../utilities/globals';\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,iBAAS,CAAC,MAAM,EAAE,iEAAiE;AACjG,QAAQ,sDAAsD,CAAC,GAAGA,iBAAS,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,EAAE,GAAG,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,CAAC;AACpD,KAAK;AACL,IAAI,OAAO,GAAG,CAAC,OAAO,CAAC,KAAK,CAAC;AAC7B;;ACNO,SAAS,mBAAmB,CAAC,QAAQ,EAAE;AAC9C,IAAI,IAAI,OAAO,EAAE;AACjB,QAAQ,IAAI,YAAY,GAAGD,YAAM,CAAC,KAAK,CAAC,CAAC;AACzC,QAAQE,eAAS,CAAC,YAAY;AAC9B,YAAY,OAAO,YAAY;AAC/B,gBAAgB,YA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AGM,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;;;;;;;;;"}
@@ -1,3 +1,4 @@
1
+ import '../../utilities/globals';
1
2
  export * from './useApolloClient';
2
3
  export * from './useLazyQuery';
3
4
  export * from './useMutation';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/react/hooks/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/react/hooks/index.ts"],"names":[],"mappings":"AAAA,OAAO,yBAAyB,CAAC;AAEjC,cAAc,mBAAmB,CAAC;AAClC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC"}
@@ -1,3 +1,4 @@
1
+ import "../../utilities/globals/index.js";
1
2
  export * from "./useApolloClient.js";
2
3
  export * from "./useLazyQuery.js";
3
4
  export * from "./useMutation.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/react/hooks/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC","sourcesContent":["export * from './useApolloClient';\nexport * from './useLazyQuery';\nexport * from './useMutation';\nexport * from './useQuery';\nexport * from './useSubscription';\nexport * from './useReactiveVar';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/react/hooks/index.ts"],"names":[],"mappings":"AAAA,OAAO,yBAAyB,CAAC;AAEjC,cAAc,mBAAmB,CAAC;AAClC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC","sourcesContent":["import '../../utilities/globals';\n\nexport * from './useApolloClient';\nexport * from './useLazyQuery';\nexport * from './useMutation';\nexport * from './useQuery';\nexport * from './useSubscription';\nexport * from './useReactiveVar';\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"useApolloClient.d.ts","sourceRoot":"","sources":["../../../src/react/hooks/useApolloClient.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAG1C,wBAAgB,eAAe,IAAI,YAAY,CAAC,MAAM,CAAC,CAQtD"}
1
+ {"version":3,"file":"useApolloClient.d.ts","sourceRoot":"","sources":["../../../src/react/hooks/useApolloClient.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAG1C,wBAAgB,eAAe,IAAI,YAAY,CAAC,MAAM,CAAC,CAQtD"}
@@ -1,10 +1,10 @@
1
+ import { invariant } from "../../utilities/globals/index.js";
1
2
  import * as React from 'react';
2
- import { invariant } from 'ts-invariant';
3
3
  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, 36);
7
+ 'have called `ApolloProvider` higher up in your tree.') : invariant(client, 33);
8
8
  return client;
9
9
  }
10
10
  //# sourceMappingURL=useApolloClient.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useApolloClient.js","sourceRoot":"","sources":["../../../src/react/hooks/useApolloClient.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAGzC,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAE9C,MAAM,UAAU,eAAe;IACrB,IAAA,MAAM,GAAK,KAAK,CAAC,UAAU,CAAC,gBAAgB,EAAE,CAAC,OAAzC,CAA0C;IACxD,SAAS,CACP,MAAM,EACN,iEAAiE;QAC/D,sDAAsD,CACzD,CAAC;IACF,OAAO,MAAO,CAAC;AACjB,CAAC","sourcesContent":["import * as React from 'react';\nimport { invariant } from 'ts-invariant';\n\nimport { ApolloClient } from '../../core';\nimport { getApolloContext } from '../context';\n\nexport function useApolloClient(): ApolloClient<object> {\n const { client } = React.useContext(getApolloContext());\n invariant(\n client,\n 'No Apollo Client instance can be found. Please ensure that you ' +\n 'have called `ApolloProvider` higher up in your tree.'\n );\n return client!;\n}\n"]}
1
+ {"version":3,"file":"useApolloClient.js","sourceRoot":"","sources":["../../../src/react/hooks/useApolloClient.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAEpD,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAE9C,MAAM,UAAU,eAAe;IACrB,IAAA,MAAM,GAAK,KAAK,CAAC,UAAU,CAAC,gBAAgB,EAAE,CAAC,OAAzC,CAA0C;IACxD,SAAS,CACP,MAAM,EACN,iEAAiE;QAC/D,sDAAsD,CACzD,CAAC;IACF,OAAO,MAAO,CAAC;AACjB,CAAC","sourcesContent":["import { invariant } from '../../utilities/globals';\n\nimport * as React from 'react';\n\nimport { ApolloClient } from '../../core';\nimport { getApolloContext } from '../context';\n\nexport function useApolloClient(): ApolloClient<object> {\n const { client } = React.useContext(getApolloContext());\n invariant(\n client,\n 'No Apollo Client instance can be found. Please ensure that you ' +\n 'have called `ApolloProvider` higher up in your tree.'\n );\n return client!;\n}\n"]}
@@ -1,3 +1,4 @@
1
+ import '../../utilities/globals';
1
2
  import { DocumentNode } from 'graphql';
2
3
  import { TypedDocumentNode } from '@graphql-typed-document-node/core';
3
4
  import { SubscriptionHookOptions } from '../types/types';
@@ -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;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
+ {"version":3,"file":"useSubscription.d.ts","sourceRoot":"","sources":["../../../src/react/hooks/useSubscription.ts"],"names":[],"mappings":"AAAA,OAAO,yBAAyB,CAAC;AAGjC,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,4 +1,5 @@
1
1
  import { __assign } from "tslib";
2
+ import "../../utilities/globals/index.js";
2
3
  import { useContext, useState, useRef, useEffect, useReducer } from 'react';
3
4
  import { SubscriptionData } from "../data/index.js";
4
5
  import { getApolloContext } from "../context/index.js";
@@ -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,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"]}
1
+ {"version":3,"file":"useSubscription.js","sourceRoot":"","sources":["../../../src/react/hooks/useSubscription.ts"],"names":[],"mappings":";AAAA,OAAO,yBAAyB,CAAC;AAEjC,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,CA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ent":["import '../../utilities/globals';\n\nimport { 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"]}
@@ -1,2 +1,3 @@
1
+ import '../../../utilities/globals';
1
2
  export declare function useAfterFastRefresh(effectFn: () => unknown): void;
2
3
  //# sourceMappingURL=useAfterFastRefresh.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"useAfterFastRefresh.d.ts","sourceRoot":"","sources":["../../../../src/react/hooks/utils/useAfterFastRefresh.ts"],"names":[],"mappings":"AAUA,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,MAAM,OAAO,QAkB1D"}
1
+ {"version":3,"file":"useAfterFastRefresh.d.ts","sourceRoot":"","sources":["../../../../src/react/hooks/utils/useAfterFastRefresh.ts"],"names":[],"mappings":"AAAA,OAAO,4BAA4B,CAAC;AAWpC,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,MAAM,OAAO,QAkB1D"}
@@ -1,3 +1,4 @@
1
+ import "../../../utilities/globals/index.js";
1
2
  import { useEffect, useRef } from "react";
2
3
  export function useAfterFastRefresh(effectFn) {
3
4
  if (__DEV__) {
@@ -1 +1 @@
1
- {"version":3,"file":"useAfterFastRefresh.js","sourceRoot":"","sources":["../../../../src/react/hooks/utils/useAfterFastRefresh.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAU1C,MAAM,UAAU,mBAAmB,CAAC,QAAuB;IACzD,IAAI,OAAO,EAAE;QACX,IAAM,YAAU,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;QACjC,SAAS,CAAC;YACR,OAAO;gBAEL,YAAU,CAAC,OAAO,GAAG,IAAI,CAAC;YAC5B,CAAC,CAAC;QACJ,CAAC,EAAE,EAAE,CAAC,CAAC;QAEP,SAAS,CAAC;YACR,IAAI,YAAU,CAAC,OAAO,KAAK,IAAI,EAAE;gBAE/B,YAAU,CAAC,OAAO,GAAG,KAAK,CAAC;gBAC3B,QAAQ,EAAE,CAAC;aACZ;QACH,CAAC,EAAE,EAAE,CAAC,CAAA;KACP;AACH,CAAC","sourcesContent":["import { useEffect, useRef } from \"react\";\n\n/**\n * This hook allows running a function only immediately after a react\n * fast refresh or live reload.\n *\n * Useful in order to ensure that we can reinitialize things that have been\n * disposed by cleanup functions in `useEffect`.\n * @param effectFn a function to run immediately after a fast refresh\n */\nexport function useAfterFastRefresh(effectFn: () => unknown) {\n if (__DEV__) {\n const didRefresh = useRef(false);\n useEffect(() => {\n return () => {\n // Detect fast refresh, only runs multiple times in fast refresh\n didRefresh.current = true;\n };\n }, []);\n\n useEffect(() => {\n if (didRefresh.current === true) {\n // This block only runs after a fast refresh\n didRefresh.current = false;\n effectFn();\n }\n }, [])\n }\n}\n"]}
1
+ {"version":3,"file":"useAfterFastRefresh.js","sourceRoot":"","sources":["../../../../src/react/hooks/utils/useAfterFastRefresh.ts"],"names":[],"mappings":"AAAA,OAAO,4BAA4B,CAAC;AACpC,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAU1C,MAAM,UAAU,mBAAmB,CAAC,QAAuB;IACzD,IAAI,OAAO,EAAE;QACX,IAAM,YAAU,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;QACjC,SAAS,CAAC;YACR,OAAO;gBAEL,YAAU,CAAC,OAAO,GAAG,IAAI,CAAC;YAC5B,CAAC,CAAC;QACJ,CAAC,EAAE,EAAE,CAAC,CAAC;QAEP,SAAS,CAAC;YACR,IAAI,YAAU,CAAC,OAAO,KAAK,IAAI,EAAE;gBAE/B,YAAU,CAAC,OAAO,GAAG,KAAK,CAAC;gBAC3B,QAAQ,EAAE,CAAC;aACZ;QACH,CAAC,EAAE,EAAE,CAAC,CAAA;KACP;AACH,CAAC","sourcesContent":["import '../../../utilities/globals';\nimport { useEffect, useRef } from \"react\";\n\n/**\n * This hook allows running a function only immediately after a react\n * fast refresh or live reload.\n *\n * Useful in order to ensure that we can reinitialize things that have been\n * disposed by cleanup functions in `useEffect`.\n * @param effectFn a function to run immediately after a fast refresh\n */\nexport function useAfterFastRefresh(effectFn: () => unknown) {\n if (__DEV__) {\n const didRefresh = useRef(false);\n useEffect(() => {\n return () => {\n // Detect fast refresh, only runs multiple times in fast refresh\n didRefresh.current = true;\n };\n }, []);\n\n useEffect(() => {\n if (didRefresh.current === true) {\n // This block only runs after a fast refresh\n didRefresh.current = false;\n effectFn();\n }\n }, [])\n }\n}\n"]}
@@ -1,3 +1,4 @@
1
+ import '../../../utilities/globals';
1
2
  import { DocumentNode } from 'graphql';
2
3
  import { TypedDocumentNode } from '@graphql-typed-document-node/core';
3
4
  import { QueryHookOptions, QueryTuple, QueryResult } from '../../types/types';
@@ -1 +1 @@
1
- {"version":3,"file":"useBaseQuery.d.ts","sourceRoot":"","sources":["../../../../src/react/hooks/utils/useBaseQuery.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AAEtE,OAAO,EACL,gBAAgB,EAEhB,UAAU,EACV,WAAW,EACZ,MAAM,mBAAmB,CAAC;AAG3B,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAInD,wBAAgB,YAAY,CAAC,KAAK,GAAG,GAAG,EAAE,UAAU,GAAG,kBAAkB,EACvE,KAAK,EAAE,YAAY,GAAG,iBAAiB,CAAC,KAAK,EAAE,UAAU,CAAC,EAC1D,OAAO,CAAC,EAAE,gBAAgB,CAAC,KAAK,EAAE,UAAU,CAAC,EAC7C,IAAI,UAAQ,kEA6Eb"}
1
+ {"version":3,"file":"useBaseQuery.d.ts","sourceRoot":"","sources":["../../../../src/react/hooks/utils/useBaseQuery.ts"],"names":[],"mappings":"AAAA,OAAO,4BAA4B,CAAC;AAGpC,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AAEtE,OAAO,EACL,gBAAgB,EAEhB,UAAU,EACV,WAAW,EACZ,MAAM,mBAAmB,CAAC;AAG3B,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAInD,wBAAgB,YAAY,CAAC,KAAK,GAAG,GAAG,EAAE,UAAU,GAAG,kBAAkB,EACvE,KAAK,EAAE,YAAY,GAAG,iBAAiB,CAAC,KAAK,EAAE,UAAU,CAAC,EAC1D,OAAO,CAAC,EAAE,gBAAgB,CAAC,KAAK,EAAE,UAAU,CAAC,EAC7C,IAAI,UAAQ,kEA6Eb"}
@@ -1,4 +1,5 @@
1
1
  import { __assign } from "tslib";
2
+ import "../../../utilities/globals/index.js";
2
3
  import { useContext, useEffect, useReducer, useRef } from 'react';
3
4
  import { QueryData } from "../../data/index.js";
4
5
  import { useDeepMemo } from "./useDeepMemo.js";
@@ -1 +1 @@
1
- {"version":3,"file":"useBaseQuery.js","sourceRoot":"","sources":["../../../../src/react/hooks/utils/useBaseQuery.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAUlE,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AACvC,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAE5D,MAAM,UAAU,YAAY,CAC1B,KAA0D,EAC1D,OAA6C,EAC7C,IAAY;IAAZ,qBAAA,EAAA,YAAY;IAEZ,IAAM,OAAO,GAAG,UAAU,CAAC,gBAAgB,EAAE,CAAC,CAAC;IACzC,IAAA,KAAsB,UAAU,CAAC,UAAA,CAAC,IAAI,OAAA,CAAC,GAAG,CAAC,EAAL,CAAK,EAAE,CAAC,CAAC,EAA9C,IAAI,QAAA,EAAE,WAAW,QAA6B,CAAC;IACtD,IAAM,cAAc,GAAG,OAAO,CAAC,CAAC,uBAAM,OAAO,KAAE,KAAK,OAAA,IAAG,CAAC,CAAC,EAAE,KAAK,OAAA,EAAE,CAAC;IAEnE,IAAM,YAAY,GAAG,MAAM,EAAgC,CAAC;IAC5D,IAAM,SAAS,GAAG,YAAY,CAAC,OAAO,IAAI,CACxC,YAAY,CAAC,OAAO,GAAG,IAAI,SAAS,CAAoB;QACtD,OAAO,EAAE,cAAqD;QAC9D,OAAO,SAAA;QACP,SAAS;YACP,IAAI,CAAC,SAAS,CAAC,YAAY,EAA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QAChB,SAAS,CAAC,iBAAiB;KAC5B,CAAC,CAAC;IAEH,OAAO,MAAM,CAAC;AAChB,CAAC","sourcesContent":["import { useContext, useEffect, useReducer, useRef } from 'react';\nimport { DocumentNode } from 'graphql';\nimport { TypedDocumentNode } from '@graphql-typed-document-node/core';\n\nimport {\n QueryHookOptions,\n QueryDataOptions,\n QueryTuple,\n QueryResult,\n} from '../../types/types';\nimport { QueryData } from '../../data';\nimport { useDeepMemo } from './useDeepMemo';\nimport { OperationVariables } from '../../../core';\nimport { getApolloContext } from '../../context';\nimport { useAfterFastRefresh } from './useAfterFastRefresh';\n\nexport function useBaseQuery<TData = any, TVariables = OperationVariables>(\n query: DocumentNode | TypedDocumentNode<TData, TVariables>,\n options?: QueryHookOptions<TData, TVariables>,\n lazy = false\n) {\n const context = useContext(getApolloContext());\n const [tick, forceUpdate] = useReducer(x => x + 1, 0);\n const updatedOptions = options ? { ...options, query } : { query };\n\n const queryDataRef = useRef<QueryData<TData, TVariables>>();\n const queryData = queryDataRef.current || (\n queryDataRef.current = new QueryData<TData, TVariables>({\n options: updatedOptions as QueryDataOptions<TData, TVariables>,\n context,\n onNewData() {\n if (!queryData.ssrInitiated()) {\n // When new data is received from the `QueryData` object, we want to\n // force a re-render to make sure the new data is displayed. We can't\n // force that re-render if we're already rendering however so to be\n // safe we'll trigger the re-render in a microtask. In case the\n // component gets unmounted before this callback fires, we re-check\n // queryDataRef.current.isMounted before calling forceUpdate().\n Promise.resolve().then(() => queryDataRef.current && queryDataRef.current.isMounted && forceUpdate());\n } else {\n // If we're rendering on the server side we can force an update at\n // any point.\n forceUpdate();\n }\n }\n })\n );\n\n queryData.setOptions(updatedOptions);\n queryData.context = context;\n\n // `onError` and `onCompleted` callback functions will not always have a\n // stable identity, so we'll exclude them from the memoization key to\n // prevent `afterExecute` from being triggered un-necessarily.\n const memo = {\n options: {\n ...updatedOptions,\n onError: void 0,\n onCompleted: void 0\n } as QueryHookOptions<TData, TVariables>,\n context,\n tick\n };\n\n const result = useDeepMemo(\n () => (lazy ? queryData.executeLazy() : queryData.execute()),\n memo\n );\n\n const queryResult = lazy\n ? (result as QueryTuple<TData, TVariables>)[1]\n : (result as QueryResult<TData, TVariables>);\n\n if (__DEV__) {\n // ensure we run an update after refreshing so that we reinitialize\n useAfterFastRefresh(forceUpdate);\n }\n\n useEffect(() => {\n return () => {\n queryData.cleanup();\n // this effect can run multiple times during a fast-refresh\n // so make sure we clean up the ref\n queryDataRef.current = void 0;\n }\n }, []);\n\n useEffect(() => queryData.afterExecute({ lazy }), [\n queryResult.loading,\n queryResult.networkStatus,\n queryResult.error,\n queryResult.data,\n queryData.currentObservable,\n ]);\n\n return result;\n}\n"]}
1
+ {"version":3,"file":"useBaseQuery.js","sourceRoot":"","sources":["../../../../src/react/hooks/utils/useBaseQuery.ts"],"names":[],"mappings":";AAAA,OAAO,4BAA4B,CAAC;AAEpC,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAUlE,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AACvC,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAE5D,MAAM,UAAU,YAAY,CAC1B,KAA0D,EAC1D,OAA6C,EAC7C,IAAY;IAAZ,qBAAA,EAAA,YAAY;IAEZ,IAAM,OAAO,GAAG,UAAU,CAAC,gBAAgB,EAAE,CAAC,CAAC;IACzC,IAAA,KAAsB,UAAU,CAAC,UAAA,CAAC,IAAI,OAAA,CAAC,GAAG,CAAC,EAAL,CAAK,EAAE,CAAC,CAAC,EAA9C,IAAI,QAAA,EAAE,WAAW,QAA6B,CAAC;IACtD,IAAM,cAAc,GAAG,OAAO,CAAC,CAAC,uBAAM,OAAO,KAAE,KAAK,OAAA,IAAG,CAAC,CAAC,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,CAAC,CAAC;QAChC,CAAC,CAAA;IACH,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,SAAS,CAAC,cAAM,OAAA,SAAS,CAAC,YAAY,CAAC,EAAE,IAAI,MAAA,EAAE,CAAC,EAAhC,CAAgC,EAAE;QAChD,WAAW,CAAC,OAAO;QACnB,WAAW,CAAC,aAAa;QACzB,WAAW,CAAC,KAAK;QACjB,WAAW,CAAC,IAAI;QAChB,SAAS,CAAC,iBAAiB;KAC5B,CAAC,CAAC;IAEH,OAAO,MAAM,CAAC;AAChB,CAAC","sourcesContent":["import '../../../utilities/globals';\n\nimport { useContext, useEffect, useReducer, useRef } from 'react';\nimport { DocumentNode } from 'graphql';\nimport { TypedDocumentNode } from '@graphql-typed-document-node/core';\n\nimport {\n QueryHookOptions,\n QueryDataOptions,\n QueryTuple,\n QueryResult,\n} from '../../types/types';\nimport { QueryData } from '../../data';\nimport { useDeepMemo } from './useDeepMemo';\nimport { OperationVariables } from '../../../core';\nimport { getApolloContext } from '../../context';\nimport { useAfterFastRefresh } from './useAfterFastRefresh';\n\nexport function useBaseQuery<TData = any, TVariables = OperationVariables>(\n query: DocumentNode | TypedDocumentNode<TData, TVariables>,\n options?: QueryHookOptions<TData, TVariables>,\n lazy = false\n) {\n const context = useContext(getApolloContext());\n const [tick, forceUpdate] = useReducer(x => x + 1, 0);\n const updatedOptions = options ? { ...options, query } : { query };\n\n const queryDataRef = useRef<QueryData<TData, TVariables>>();\n const queryData = queryDataRef.current || (\n queryDataRef.current = new QueryData<TData, TVariables>({\n options: updatedOptions as QueryDataOptions<TData, TVariables>,\n context,\n onNewData() {\n if (!queryData.ssrInitiated()) {\n // When new data is received from the `QueryData` object, we want to\n // force a re-render to make sure the new data is displayed. We can't\n // force that re-render if we're already rendering however so to be\n // safe we'll trigger the re-render in a microtask. In case the\n // component gets unmounted before this callback fires, we re-check\n // queryDataRef.current.isMounted before calling forceUpdate().\n Promise.resolve().then(() => queryDataRef.current && queryDataRef.current.isMounted && forceUpdate());\n } else {\n // If we're rendering on the server side we can force an update at\n // any point.\n forceUpdate();\n }\n }\n })\n );\n\n queryData.setOptions(updatedOptions);\n queryData.context = context;\n\n // `onError` and `onCompleted` callback functions will not always have a\n // stable identity, so we'll exclude them from the memoization key to\n // prevent `afterExecute` from being triggered un-necessarily.\n const memo = {\n options: {\n ...updatedOptions,\n onError: void 0,\n onCompleted: void 0\n } as QueryHookOptions<TData, TVariables>,\n context,\n tick\n };\n\n const result = useDeepMemo(\n () => (lazy ? queryData.executeLazy() : queryData.execute()),\n memo\n );\n\n const queryResult = lazy\n ? (result as QueryTuple<TData, TVariables>)[1]\n : (result as QueryResult<TData, TVariables>);\n\n if (__DEV__) {\n // ensure we run an update after refreshing so that we reinitialize\n useAfterFastRefresh(forceUpdate);\n }\n\n useEffect(() => {\n return () => {\n queryData.cleanup();\n // this effect can run multiple times during a fast-refresh\n // so make sure we clean up the ref\n queryDataRef.current = void 0;\n }\n }, []);\n\n useEffect(() => queryData.afterExecute({ lazy }), [\n queryResult.loading,\n queryResult.networkStatus,\n queryResult.error,\n queryResult.data,\n queryData.currentObservable,\n ]);\n\n return result;\n}\n"]}
package/react/index.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ import '../utilities/globals';
1
2
  export { ApolloProvider, ApolloConsumer, getApolloContext, resetApolloContext, ApolloContextValue } from './context';
2
3
  export * from './hooks';
3
4
  export { DocumentType, IDocumentDefinition, operationName, parser } from './parser';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/react/index.ts"],"names":[],"mappings":"AAIA,OAAO,EACL,cAAc,EACd,cAAc,EACd,gBAAgB,EAChB,kBAAkB,EAClB,kBAAkB,EACnB,MAAM,WAAW,CAAC;AAEnB,cAAc,SAAS,CAAC;AAExB,OAAO,EACL,YAAY,EACZ,mBAAmB,EACnB,aAAa,EACb,MAAM,EACP,MAAM,UAAU,CAAC;AAElB,cAAc,eAAe,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/react/index.ts"],"names":[],"mappings":"AAAA,OAAO,sBAAsB,CAAC;AAE9B,OAAO,EACL,cAAc,EACd,cAAc,EACd,gBAAgB,EAChB,kBAAkB,EAClB,kBAAkB,EACnB,MAAM,WAAW,CAAC;AAEnB,cAAc,SAAS,CAAC;AAExB,OAAO,EACL,YAAY,EACZ,mBAAmB,EACnB,aAAa,EACb,MAAM,EACP,MAAM,UAAU,CAAC;AAElB,cAAc,eAAe,CAAC"}
package/react/index.js CHANGED
@@ -1,6 +1,4 @@
1
- import { invariant } from "ts-invariant";
2
- import { DEV } from "../utilities/index.js";
3
- __DEV__ ? invariant("boolean" === typeof DEV, DEV) : invariant("boolean" === typeof DEV, 37);
1
+ import "../utilities/globals/index.js";
4
2
  export { ApolloProvider, ApolloConsumer, getApolloContext, resetApolloContext } from "./context/index.js";
5
3
  export * from "./hooks/index.js";
6
4
  export { DocumentType, operationName, parser } from "./parser/index.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/react/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AACnC,SAAS,CAAC,SAAS,KAAK,OAAO,GAAG,EAAE,GAAG,CAAC,CAAC;AAEzC,OAAO,EACL,cAAc,EACd,cAAc,EACd,gBAAgB,EAChB,kBAAkB,EAEnB,MAAM,WAAW,CAAC;AAEnB,cAAc,SAAS,CAAC;AAExB,OAAO,EACL,YAAY,EAEZ,aAAa,EACb,MAAM,EACP,MAAM,UAAU,CAAC;AAElB,cAAc,eAAe,CAAC","sourcesContent":["import { invariant } from \"ts-invariant\";\nimport { DEV } from \"../utilities\";\ninvariant(\"boolean\" === typeof DEV, DEV);\n\nexport {\n ApolloProvider,\n ApolloConsumer,\n getApolloContext,\n resetApolloContext,\n ApolloContextValue\n} from './context';\n\nexport * from './hooks';\n\nexport {\n DocumentType,\n IDocumentDefinition,\n operationName,\n parser\n} from './parser';\n\nexport * from './types/types';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/react/index.ts"],"names":[],"mappings":"AAAA,OAAO,sBAAsB,CAAC;AAE9B,OAAO,EACL,cAAc,EACd,cAAc,EACd,gBAAgB,EAChB,kBAAkB,EAEnB,MAAM,WAAW,CAAC;AAEnB,cAAc,SAAS,CAAC;AAExB,OAAO,EACL,YAAY,EAEZ,aAAa,EACb,MAAM,EACP,MAAM,UAAU,CAAC;AAElB,cAAc,eAAe,CAAC","sourcesContent":["import '../utilities/globals';\n\nexport {\n ApolloProvider,\n ApolloConsumer,\n getApolloContext,\n resetApolloContext,\n ApolloContextValue\n} from './context';\n\nexport * from './hooks';\n\nexport {\n DocumentType,\n IDocumentDefinition,\n operationName,\n parser\n} from './parser';\n\nexport * from './types/types';\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/react/parser/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EAEZ,sBAAsB,EAEvB,MAAM,SAAS,CAAC;AAGjB,oBAAY,YAAY;IACtB,KAAK,IAAA;IACL,QAAQ,IAAA;IACR,YAAY,IAAA;CACb;AAED,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,YAAY,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,aAAa,CAAC,sBAAsB,CAAC,CAAC;CAClD;AAID,wBAAgB,aAAa,CAAC,IAAI,EAAE,YAAY,UAc/C;AAGD,wBAAgB,MAAM,CAAC,QAAQ,EAAE,YAAY,GAAG,mBAAmB,CA2ElE"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/react/parser/index.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,YAAY,EAEZ,sBAAsB,EAEvB,MAAM,SAAS,CAAC;AAEjB,oBAAY,YAAY;IACtB,KAAK,IAAA;IACL,QAAQ,IAAA;IACR,YAAY,IAAA;CACb;AAED,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,YAAY,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,aAAa,CAAC,sBAAsB,CAAC,CAAC;CAClD;AAID,wBAAgB,aAAa,CAAC,IAAI,EAAE,YAAY,UAc/C;AAGD,wBAAgB,MAAM,CAAC,QAAQ,EAAE,YAAY,GAAG,mBAAmB,CA2ElE"}
@@ -1,4 +1,4 @@
1
- import { invariant } from 'ts-invariant';
1
+ import { invariant } from "../../utilities/globals/index.js";
2
2
  export var DocumentType;
3
3
  (function (DocumentType) {
4
4
  DocumentType[DocumentType["Query"] = 0] = "Query";
@@ -28,7 +28,7 @@ export function parser(document) {
28
28
  var variables, type, name;
29
29
  __DEV__ ? invariant(!!document && !!document.kind, "Argument of " + document + " passed to parser was not a valid GraphQL " +
30
30
  "DocumentNode. You may need to use 'graphql-tag' or another method " +
31
- "to convert your operation into a document") : invariant(!!document && !!document.kind, 38);
31
+ "to convert your operation into a document") : invariant(!!document && !!document.kind, 34);
32
32
  var fragments = document.definitions.filter(function (x) { return x.kind === 'FragmentDefinition'; });
33
33
  var queries = document.definitions.filter(function (x) {
34
34
  return x.kind === 'OperationDefinition' && x.operation === 'query';
@@ -42,11 +42,11 @@ export function parser(document) {
42
42
  __DEV__ ? invariant(!fragments.length ||
43
43
  (queries.length || mutations.length || subscriptions.length), "Passing only a fragment to 'graphql' is not yet supported. " +
44
44
  "You must include a query, subscription or mutation as well") : invariant(!fragments.length ||
45
- (queries.length || mutations.length || subscriptions.length), 39);
45
+ (queries.length || mutations.length || subscriptions.length), 35);
46
46
  __DEV__ ? invariant(queries.length + mutations.length + subscriptions.length <= 1, "react-apollo only supports a query, subscription, or a mutation per HOC. " +
47
47
  (document + " had " + queries.length + " queries, " + subscriptions.length + " ") +
48
48
  ("subscriptions and " + mutations.length + " mutations. ") +
49
- "You can use 'compose' to join multiple operation types to a component") : invariant(queries.length + mutations.length + subscriptions.length <= 1, 40);
49
+ "You can use 'compose' to join multiple operation types to a component") : invariant(queries.length + mutations.length + subscriptions.length <= 1, 36);
50
50
  type = queries.length ? DocumentType.Query : DocumentType.Mutation;
51
51
  if (!queries.length && !mutations.length)
52
52
  type = DocumentType.Subscription;
@@ -57,7 +57,7 @@ export function parser(document) {
57
57
  : subscriptions;
58
58
  __DEV__ ? invariant(definitions.length === 1, "react-apollo only supports one definition per HOC. " + document + " had " +
59
59
  (definitions.length + " definitions. ") +
60
- "You can use 'compose' to join multiple operation types to a component") : invariant(definitions.length === 1, 41);
60
+ "You can use 'compose' to join multiple operation types to a component") : invariant(definitions.length === 1, 37);
61
61
  var definition = definitions[0];
62
62
  variables = definition.variableDefinitions || [];
63
63
  if (definition.name && definition.name.kind === 'Name') {