@apollo/client 3.7.4 → 3.7.6

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/apollo-client.cjs +120 -61
  2. package/apollo-client.cjs.map +1 -1
  3. package/apollo-client.min.cjs +1 -1
  4. package/cache/core/cache.d.ts +1 -1
  5. package/cache/core/cache.d.ts.map +1 -1
  6. package/cache/core/cache.js.map +1 -1
  7. package/cache/core/types/common.d.ts +7 -7
  8. package/cache/core/types/common.d.ts.map +1 -1
  9. package/cache/inmemory/entityStore.d.ts +1 -1
  10. package/cache/inmemory/entityStore.d.ts.map +1 -1
  11. package/cache/inmemory/helpers.js.map +1 -1
  12. package/cache/inmemory/inMemoryCache.d.ts +3 -2
  13. package/cache/inmemory/inMemoryCache.d.ts.map +1 -1
  14. package/cache/inmemory/inMemoryCache.js.map +1 -1
  15. package/cache/inmemory/policies.d.ts +12 -12
  16. package/cache/inmemory/policies.d.ts.map +1 -1
  17. package/cache/inmemory/policies.js.map +1 -1
  18. package/cache/inmemory/reactiveVars.d.ts +1 -1
  19. package/cache/inmemory/reactiveVars.d.ts.map +1 -1
  20. package/cache/inmemory/readFromStore.d.ts +2 -2
  21. package/cache/inmemory/readFromStore.d.ts.map +1 -1
  22. package/cache/inmemory/types.d.ts +4 -4
  23. package/cache/inmemory/types.d.ts.map +1 -1
  24. package/cache/inmemory/writeToStore.d.ts +1 -1
  25. package/cache/inmemory/writeToStore.d.ts.map +1 -1
  26. package/cache/inmemory/writeToStore.js.map +1 -1
  27. package/core/ApolloClient.d.ts +5 -5
  28. package/core/ApolloClient.d.ts.map +1 -1
  29. package/core/ApolloClient.js.map +1 -1
  30. package/core/LocalState.d.ts +9 -6
  31. package/core/LocalState.d.ts.map +1 -1
  32. package/core/LocalState.js +61 -14
  33. package/core/LocalState.js.map +1 -1
  34. package/core/ObservableQuery.d.ts +5 -5
  35. package/core/ObservableQuery.d.ts.map +1 -1
  36. package/core/ObservableQuery.js +1 -1
  37. package/core/ObservableQuery.js.map +1 -1
  38. package/core/QueryInfo.d.ts +1 -1
  39. package/core/QueryInfo.d.ts.map +1 -1
  40. package/core/QueryManager.d.ts +7 -7
  41. package/core/QueryManager.d.ts.map +1 -1
  42. package/core/QueryManager.js +17 -9
  43. package/core/QueryManager.js.map +1 -1
  44. package/core/core.cjs +79 -24
  45. package/core/core.cjs.map +1 -1
  46. package/core/core.cjs.native.js +79 -24
  47. package/core/types.d.ts +18 -17
  48. package/core/types.d.ts.map +1 -1
  49. package/core/types.js +1 -0
  50. package/core/types.js.map +1 -1
  51. package/core/watchQueryOptions.d.ts +11 -11
  52. package/core/watchQueryOptions.d.ts.map +1 -1
  53. package/core/watchQueryOptions.js.map +1 -1
  54. package/errors/index.d.ts +2 -2
  55. package/errors/index.d.ts.map +1 -1
  56. package/invariantErrorCodes.js +48 -43
  57. package/link/batch/batch.cjs +5 -3
  58. package/link/batch/batch.cjs.map +1 -1
  59. package/link/batch/batch.cjs.native.js +5 -3
  60. package/link/batch/batching.d.ts +2 -2
  61. package/link/batch/batching.d.ts.map +1 -1
  62. package/link/batch/batching.js +5 -3
  63. package/link/batch/batching.js.map +1 -1
  64. package/link/context/index.d.ts +2 -1
  65. package/link/context/index.d.ts.map +1 -1
  66. package/link/context/index.js.map +1 -1
  67. package/link/core/ApolloLink.js +1 -1
  68. package/link/core/core.cjs +1 -1
  69. package/link/core/core.cjs.map +1 -1
  70. package/link/core/core.cjs.native.js +1 -1
  71. package/link/core/types.d.ts +11 -10
  72. package/link/core/types.d.ts.map +1 -1
  73. package/link/core/types.js.map +1 -1
  74. package/link/http/checkFetcher.js +1 -1
  75. package/link/http/createHttpLink.d.ts.map +1 -1
  76. package/link/http/createHttpLink.js +1 -0
  77. package/link/http/createHttpLink.js.map +1 -1
  78. package/link/http/http.cjs +6 -3
  79. package/link/http/http.cjs.map +1 -1
  80. package/link/http/http.cjs.native.js +6 -3
  81. package/link/http/iterators/async.js.map +1 -1
  82. package/link/http/iterators/nodeStream.js.map +1 -1
  83. package/link/http/iterators/promise.js.map +1 -1
  84. package/link/http/iterators/reader.js.map +1 -1
  85. package/link/http/parseAndCheckHttpResponse.d.ts +2 -2
  86. package/link/http/parseAndCheckHttpResponse.d.ts.map +1 -1
  87. package/link/http/parseAndCheckHttpResponse.js.map +1 -1
  88. package/link/http/selectHttpOptionsAndBody.d.ts +2 -2
  89. package/link/http/selectHttpOptionsAndBody.d.ts.map +1 -1
  90. package/link/http/selectHttpOptionsAndBody.js +3 -1
  91. package/link/http/selectHttpOptionsAndBody.js.map +1 -1
  92. package/link/http/serializeFetchParameter.d.ts +1 -1
  93. package/link/http/serializeFetchParameter.d.ts.map +1 -1
  94. package/link/http/serializeFetchParameter.js +1 -1
  95. package/link/persisted-queries/index.d.ts +2 -2
  96. package/link/persisted-queries/index.d.ts.map +1 -1
  97. package/link/persisted-queries/index.js +2 -2
  98. package/link/persisted-queries/persisted-queries.cjs +2 -2
  99. package/link/persisted-queries/persisted-queries.cjs.map +1 -1
  100. package/link/persisted-queries/persisted-queries.cjs.native.js +2 -2
  101. package/link/utils/throwServerError.d.ts +1 -1
  102. package/link/utils/throwServerError.d.ts.map +1 -1
  103. package/link/utils/utils.cjs +1 -1
  104. package/link/utils/utils.cjs.map +1 -1
  105. package/link/utils/utils.cjs.native.js +1 -1
  106. package/link/utils/validateOperation.js +1 -1
  107. package/package.json +15 -15
  108. package/react/components/Query.d.ts +2 -2
  109. package/react/components/Query.d.ts.map +1 -1
  110. package/react/components/Query.js.map +1 -1
  111. package/react/components/Subscription.d.ts +2 -2
  112. package/react/components/Subscription.d.ts.map +1 -1
  113. package/react/components/Subscription.js.map +1 -1
  114. package/react/components/types.d.ts +2 -2
  115. package/react/components/types.d.ts.map +1 -1
  116. package/react/components/types.js.map +1 -1
  117. package/react/context/ApolloConsumer.js +1 -1
  118. package/react/context/ApolloProvider.js +1 -1
  119. package/react/context/context.cjs +2 -2
  120. package/react/context/context.cjs.map +1 -1
  121. package/react/context/context.cjs.native.js +2 -2
  122. package/react/hoc/graphql.d.ts +2 -1
  123. package/react/hoc/graphql.d.ts.map +1 -1
  124. package/react/hoc/graphql.js.map +1 -1
  125. package/react/hoc/hoc-utils.d.ts +1 -1
  126. package/react/hoc/hoc-utils.d.ts.map +1 -1
  127. package/react/hoc/hoc-utils.js +1 -1
  128. package/react/hoc/hoc.cjs +2 -2
  129. package/react/hoc/hoc.cjs.map +1 -1
  130. package/react/hoc/hoc.cjs.native.js +2 -2
  131. package/react/hoc/mutation-hoc.d.ts +2 -2
  132. package/react/hoc/mutation-hoc.d.ts.map +1 -1
  133. package/react/hoc/mutation-hoc.js.map +1 -1
  134. package/react/hoc/query-hoc.d.ts +1 -1
  135. package/react/hoc/query-hoc.d.ts.map +1 -1
  136. package/react/hoc/query-hoc.js.map +1 -1
  137. package/react/hoc/subscription-hoc.d.ts +1 -1
  138. package/react/hoc/subscription-hoc.d.ts.map +1 -1
  139. package/react/hoc/subscription-hoc.js.map +1 -1
  140. package/react/hoc/types.d.ts +6 -6
  141. package/react/hoc/types.d.ts.map +1 -1
  142. package/react/hoc/types.js.map +1 -1
  143. package/react/hoc/withApollo.js +1 -1
  144. package/react/hooks/hooks.cjs +10 -9
  145. package/react/hooks/hooks.cjs.map +1 -1
  146. package/react/hooks/hooks.cjs.native.js +10 -9
  147. package/react/hooks/useApolloClient.js +1 -1
  148. package/react/hooks/useFragment.d.ts +2 -1
  149. package/react/hooks/useFragment.d.ts.map +1 -1
  150. package/react/hooks/useFragment.js +9 -8
  151. package/react/hooks/useFragment.js.map +1 -1
  152. package/react/hooks/useLazyQuery.d.ts +1 -1
  153. package/react/hooks/useLazyQuery.d.ts.map +1 -1
  154. package/react/hooks/useLazyQuery.js.map +1 -1
  155. package/react/hooks/useQuery.d.ts +3 -3
  156. package/react/hooks/useQuery.d.ts.map +1 -1
  157. package/react/hooks/useQuery.js.map +1 -1
  158. package/react/hooks/useSubscription.d.ts +1 -1
  159. package/react/hooks/useSubscription.d.ts.map +1 -1
  160. package/react/hooks/useSubscription.js.map +1 -1
  161. package/react/hooks/useSyncExternalStore.d.ts +1 -1
  162. package/react/hooks/useSyncExternalStore.d.ts.map +1 -1
  163. package/react/parser/index.js +5 -5
  164. package/react/parser/parser.cjs +5 -5
  165. package/react/parser/parser.cjs.map +1 -1
  166. package/react/parser/parser.cjs.native.js +5 -5
  167. package/react/ssr/RenderPromises.d.ts +4 -4
  168. package/react/ssr/RenderPromises.d.ts.map +1 -1
  169. package/react/ssr/RenderPromises.js.map +1 -1
  170. package/react/ssr/getDataFromTree.d.ts +1 -1
  171. package/react/ssr/getDataFromTree.d.ts.map +1 -1
  172. package/react/types/types.d.ts +17 -17
  173. package/react/types/types.d.ts.map +1 -1
  174. package/react/types/types.js.map +1 -1
  175. package/testing/core/core.cjs +1 -1
  176. package/testing/core/core.cjs.map +1 -1
  177. package/testing/core/core.cjs.native.js +1 -1
  178. package/testing/core/mocking/mockFetch.js.map +1 -1
  179. package/testing/core/mocking/mockLink.d.ts +1 -1
  180. package/testing/core/mocking/mockLink.d.ts.map +1 -1
  181. package/testing/core/mocking/mockLink.js +1 -1
  182. package/testing/core/observableToPromise.d.ts +2 -2
  183. package/testing/core/observableToPromise.d.ts.map +1 -1
  184. package/testing/core/observableToPromise.js.map +1 -1
  185. package/utilities/common/cloneDeep.js.map +1 -1
  186. package/utilities/common/errorHandling.d.ts +2 -2
  187. package/utilities/common/errorHandling.d.ts.map +1 -1
  188. package/utilities/common/errorHandling.js.map +1 -1
  189. package/utilities/common/incrementalResult.d.ts +4 -4
  190. package/utilities/common/incrementalResult.d.ts.map +1 -1
  191. package/utilities/common/incrementalResult.js.map +1 -1
  192. package/utilities/common/mergeDeep.d.ts +2 -2
  193. package/utilities/common/mergeDeep.d.ts.map +1 -1
  194. package/utilities/common/mergeOptions.d.ts +2 -2
  195. package/utilities/common/mergeOptions.d.ts.map +1 -1
  196. package/utilities/common/mergeOptions.js.map +1 -1
  197. package/utilities/globals/globals.cjs +1 -1
  198. package/utilities/globals/globals.cjs.map +1 -1
  199. package/utilities/globals/globals.cjs.native.js +1 -1
  200. package/utilities/globals/index.js +1 -1
  201. package/utilities/graphql/directives.d.ts +2 -2
  202. package/utilities/graphql/directives.d.ts.map +1 -1
  203. package/utilities/graphql/directives.js +4 -4
  204. package/utilities/graphql/directives.js.map +1 -1
  205. package/utilities/graphql/fragments.d.ts +1 -1
  206. package/utilities/graphql/fragments.d.ts.map +1 -1
  207. package/utilities/graphql/fragments.js +3 -3
  208. package/utilities/graphql/getFromAST.js +8 -8
  209. package/utilities/graphql/storeUtils.d.ts +3 -3
  210. package/utilities/graphql/storeUtils.d.ts.map +1 -1
  211. package/utilities/graphql/storeUtils.js +1 -1
  212. package/utilities/graphql/storeUtils.js.map +1 -1
  213. package/utilities/graphql/transform.d.ts +9 -9
  214. package/utilities/graphql/transform.d.ts.map +1 -1
  215. package/utilities/graphql/transform.js.map +1 -1
  216. package/utilities/observables/Concast.d.ts +5 -5
  217. package/utilities/observables/Concast.d.ts.map +1 -1
  218. package/utilities/observables/asyncMap.js.map +1 -1
  219. package/utilities/policies/pagination.d.ts +7 -7
  220. package/utilities/policies/pagination.d.ts.map +1 -1
  221. package/utilities/policies/pagination.js.map +1 -1
  222. package/utilities/types/IsStrictlyAny.d.ts +3 -3
  223. package/utilities/types/IsStrictlyAny.d.ts.map +1 -1
  224. package/utilities/utilities.cjs +16 -16
  225. package/utilities/utilities.cjs.map +1 -1
  226. package/utilities/utilities.cjs.native.js +16 -16
  227. package/version.js +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/react/components/types.ts"],"names":[],"mappings":"","sourcesContent":["import { DocumentNode } from 'graphql';\nimport { TypedDocumentNode } from '@graphql-typed-document-node/core';\n\nimport { OperationVariables, DefaultContext, ApolloCache } from '../../core';\nimport {\n QueryFunctionOptions,\n QueryResult,\n BaseMutationOptions,\n MutationFunction,\n MutationResult,\n BaseSubscriptionOptions,\n SubscriptionResult\n} from '../types/types';\n\nexport interface QueryComponentOptions<\n TData = any,\n TVariables = OperationVariables\n> extends QueryFunctionOptions<TData, TVariables> {\n children: (result: QueryResult<TData, TVariables>) => JSX.Element | null;\n query: DocumentNode | TypedDocumentNode<TData, TVariables>;\n}\n\nexport interface MutationComponentOptions<\n TData = any,\n TVariables = OperationVariables,\n TContext = DefaultContext,\n TCache extends ApolloCache<any> = ApolloCache<any>\n> extends BaseMutationOptions<TData, TVariables, TContext, TCache> {\n mutation: DocumentNode | TypedDocumentNode<TData, TVariables>;\n children: (\n mutateFunction: MutationFunction<TData, TVariables, TContext>,\n result: MutationResult<TData>\n ) => JSX.Element | null;\n}\n\nexport interface SubscriptionComponentOptions<\n TData = any,\n TVariables = OperationVariables\n> extends BaseSubscriptionOptions<TData, TVariables> {\n subscription: DocumentNode | TypedDocumentNode<TData, TVariables>;\n children?: null | ((result: SubscriptionResult<TData>) => JSX.Element | null);\n}\n"]}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/react/components/types.ts"],"names":[],"mappings":"","sourcesContent":["import { DocumentNode } from 'graphql';\nimport { TypedDocumentNode } from '@graphql-typed-document-node/core';\n\nimport { OperationVariables, DefaultContext, ApolloCache } from '../../core';\nimport {\n QueryFunctionOptions,\n QueryResult,\n BaseMutationOptions,\n MutationFunction,\n MutationResult,\n BaseSubscriptionOptions,\n SubscriptionResult\n} from '../types/types';\n\nexport interface QueryComponentOptions<\n TData = any,\n TVariables extends OperationVariables = OperationVariables\n> extends QueryFunctionOptions<TData, TVariables> {\n children: (result: QueryResult<TData, TVariables>) => JSX.Element | null;\n query: DocumentNode | TypedDocumentNode<TData, TVariables>;\n}\n\nexport interface MutationComponentOptions<\n TData = any,\n TVariables = OperationVariables,\n TContext = DefaultContext,\n TCache extends ApolloCache<any> = ApolloCache<any>\n> extends BaseMutationOptions<TData, TVariables, TContext, TCache> {\n mutation: DocumentNode | TypedDocumentNode<TData, TVariables>;\n children: (\n mutateFunction: MutationFunction<TData, TVariables, TContext>,\n result: MutationResult<TData>\n ) => JSX.Element | null;\n}\n\nexport interface SubscriptionComponentOptions<\n TData = any,\n TVariables extends OperationVariables = OperationVariables\n> extends BaseSubscriptionOptions<TData, TVariables> {\n subscription: DocumentNode | TypedDocumentNode<TData, TVariables>;\n children?: null | ((result: SubscriptionResult<TData>) => JSX.Element | null);\n}\n"]}
@@ -5,7 +5,7 @@ export var ApolloConsumer = function (props) {
5
5
  var ApolloContext = getApolloContext();
6
6
  return (React.createElement(ApolloContext.Consumer, null, function (context) {
7
7
  __DEV__ ? invariant(context && context.client, 'Could not find "client" in the context of ApolloConsumer. ' +
8
- 'Wrap the root component in an <ApolloProvider>.') : invariant(context && context.client, 27);
8
+ 'Wrap the root component in an <ApolloProvider>.') : invariant(context && context.client, 28);
9
9
  return props.children(context.client);
10
10
  }));
11
11
  };
@@ -10,7 +10,7 @@ export var ApolloProvider = function (_a) {
10
10
  context = Object.assign({}, context, { client: client });
11
11
  }
12
12
  __DEV__ ? invariant(context.client, 'ApolloProvider was not passed a client instance. Make ' +
13
- 'sure you pass in your client via the "client" prop.') : invariant(context.client, 28);
13
+ 'sure you pass in your client via the "client" prop.') : invariant(context.client, 29);
14
14
  return (React.createElement(ApolloContext.Provider, { value: context }, children));
15
15
  }));
16
16
  };
@@ -41,7 +41,7 @@ var ApolloConsumer = function (props) {
41
41
  var ApolloContext = getApolloContext();
42
42
  return (React__namespace.createElement(ApolloContext.Consumer, null, function (context) {
43
43
  __DEV__ ? globals.invariant(context && context.client, 'Could not find "client" in the context of ApolloConsumer. ' +
44
- 'Wrap the root component in an <ApolloProvider>.') : globals.invariant(context && context.client, 27);
44
+ 'Wrap the root component in an <ApolloProvider>.') : globals.invariant(context && context.client, 28);
45
45
  return props.children(context.client);
46
46
  }));
47
47
  };
@@ -55,7 +55,7 @@ var ApolloProvider = function (_a) {
55
55
  context = Object.assign({}, context, { client: client });
56
56
  }
57
57
  __DEV__ ? globals.invariant(context.client, 'ApolloProvider was not passed a client instance. Make ' +
58
- 'sure you pass in your client via the "client" prop.') : globals.invariant(context.client, 28);
58
+ 'sure you pass in your client via the "client" prop.') : globals.invariant(context.client, 29);
59
59
  return (React__namespace.createElement(ApolloContext.Provider, { value: context }, children));
60
60
  }));
61
61
  };
@@ -1 +1 @@
1
- {"version":3,"file":"context.cjs","sources":["ApolloContext.js","ApolloConsumer.js","ApolloProvider.js"],"sourcesContent":["import * as React from 'react';\nimport { canUseSymbol } from '../../utilities';\nvar contextKey = canUseSymbol\n ? Symbol.for('__APOLLO_CONTEXT__')\n : '__APOLLO_CONTEXT__';\nexport function getApolloContext() {\n var context = React.createContext[contextKey];\n if (!context) {\n Object.defineProperty(React.createContext, contextKey, {\n value: context = React.createContext({}),\n enumerable: false,\n writable: false,\n configurable: true,\n });\n context.displayName = 'ApolloContext';\n }\n return context;\n}\nexport { getApolloContext as resetApolloContext };\n//# sourceMappingURL=ApolloContext.js.map","import { invariant } from '../../utilities/globals';\nimport * as React from 'react';\nimport { getApolloContext } from './ApolloContext';\nexport var ApolloConsumer = function (props) {\n var ApolloContext = getApolloContext();\n return (React.createElement(ApolloContext.Consumer, null, function (context) {\n __DEV__ ? invariant(context && context.client, 'Could not find \"client\" in the context of ApolloConsumer. ' +\n 'Wrap the root component in an <ApolloProvider>.') : invariant(context && context.client, 27);\n return props.children(context.client);\n }));\n};\n//# sourceMappingURL=ApolloConsumer.js.map","import { invariant } from '../../utilities/globals';\nimport * as React from 'react';\nimport { getApolloContext } from './ApolloContext';\nexport var ApolloProvider = function (_a) {\n var client = _a.client, children = _a.children;\n var ApolloContext = getApolloContext();\n return (React.createElement(ApolloContext.Consumer, null, function (context) {\n if (context === void 0) { context = {}; }\n if (client && context.client !== client) {\n context = Object.assign({}, context, { client: client });\n }\n __DEV__ ? invariant(context.client, 'ApolloProvider was not passed a client instance. Make ' +\n 'sure you pass in your client via the \"client\" prop.') : invariant(context.client, 28);\n return (React.createElement(ApolloContext.Provider, { value: context }, children));\n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AAE;AAC1C,IAAI,IAAI,MAAM,GAAG,EAAE,CAAC,MAAM,EAAE,QAAQ,GAAG,EAAE,CAAC,QAAQ,CAAC;AACnD,IAAI,IAAI,aAAa,GAAG,gBAAgB,EAAE,CAAC;AAC3C,IAAI,QAAQD,gBAAK,CAAC,aAAa,CAAC,aAAa,CAAC,QAAQ,EAAE,IAAI,EAAE,UAAU,OAAO,EAAE;AACjF,QAAQ,IAAI,OAAO,KAAK,KAAK,CAAC,EAAE,EAAE,OAAO,GAAG,EAAE,CAAC,EAAE;AACjD,QAAQ,IAAI,MAAM,IAAI,OAAO,CAAC,MAAM,KAAK,MAAM,EAAE;AACjD,YAAY,OAAO,GAAG,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,OAAO,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;AACrE,SAAS;AACT,QAAQ,OAAO,GAAGC,iBAAS,CAAC,OAAO,CAAC,MAAM,EAAE,wDAAwD;AACpG,YAAY,qDAAqD,CAAC,GAAGA,iBAAS,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;AACnG,QAAQ,QAAQD,gBAAK,CAAC,aAAa,CAAC,aAAa,CAAC,QAAQ,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,QAAQ,CAAC,EAAE;AAC3F,KAAK,CAAC,EAAE;AACR;;;;;;;"}
1
+ {"version":3,"file":"context.cjs","sources":["ApolloContext.js","ApolloConsumer.js","ApolloProvider.js"],"sourcesContent":["import * as React from 'react';\nimport { canUseSymbol } from '../../utilities';\nvar contextKey = canUseSymbol\n ? Symbol.for('__APOLLO_CONTEXT__')\n : '__APOLLO_CONTEXT__';\nexport function getApolloContext() {\n var context = React.createContext[contextKey];\n if (!context) {\n Object.defineProperty(React.createContext, contextKey, {\n value: context = React.createContext({}),\n enumerable: false,\n writable: false,\n configurable: true,\n });\n context.displayName = 'ApolloContext';\n }\n return context;\n}\nexport { getApolloContext as resetApolloContext };\n//# sourceMappingURL=ApolloContext.js.map","import { invariant } from '../../utilities/globals';\nimport * as React from 'react';\nimport { getApolloContext } from './ApolloContext';\nexport var ApolloConsumer = function (props) {\n var ApolloContext = getApolloContext();\n return (React.createElement(ApolloContext.Consumer, null, function (context) {\n __DEV__ ? invariant(context && context.client, 'Could not find \"client\" in the context of ApolloConsumer. ' +\n 'Wrap the root component in an <ApolloProvider>.') : invariant(context && context.client, 28);\n return props.children(context.client);\n }));\n};\n//# sourceMappingURL=ApolloConsumer.js.map","import { invariant } from '../../utilities/globals';\nimport * as React from 'react';\nimport { getApolloContext } from './ApolloContext';\nexport var ApolloProvider = function (_a) {\n var client = _a.client, children = _a.children;\n var ApolloContext = getApolloContext();\n return (React.createElement(ApolloContext.Consumer, null, function (context) {\n if (context === void 0) { context = {}; }\n if (client && context.client !== client) {\n context = Object.assign({}, context, { client: client });\n }\n __DEV__ ? invariant(context.client, 'ApolloProvider was not passed a client instance. Make ' +\n 'sure you pass in your client via the \"client\" prop.') : invariant(context.client, 29);\n return (React.createElement(ApolloContext.Provider, { value: context }, children));\n }));\n};\n//# sourceMappingURL=ApolloProvider.js.map"],"names":["canUseSymbol","React","invariant"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAEA,IAAI,UAAU,GAAGA,sBAAY;AAC7B,MAAM,MAAM,CAAC,GAAG,CAAC,oBAAoB,CAAC;AACtC,MAAM,oBAAoB,CAAC;AACpB,SAAS,gBAAgB,GAAG;AACnC,IAAI,IAAI,OAAO,GAAGC,gBAAK,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC;AAClD,IAAI,IAAI,CAAC,OAAO,EAAE;AAClB,QAAQ,MAAM,CAAC,cAAc,CAACA,gBAAK,CAAC,aAAa,EAAE,UAAU,EAAE;AAC/D,YAAY,KAAK,EAAE,OAAO,GAAGA,gBAAK,CAAC,aAAa,CAAC,EAAE,CAAC;AACpD,YAAY,UAAU,EAAE,KAAK;AAC7B,YAAY,QAAQ,EAAE,KAAK;AAC3B,YAAY,Y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OAAO,CAAC,MAAM,EAAE,wDAAwD;AACpG,YAAY,qDAAqD,CAAC,GAAGA,iBAAS,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;AACnG,QAAQ,QAAQD,gBAAK,CAAC,aAAa,CAAC,aAAa,CAAC,QAAQ,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,QAAQ,CAAC,EAAE;AAC3F,KAAK,CAAC,EAAE;AACR;;;;;;;"}
@@ -41,7 +41,7 @@ var ApolloConsumer = function (props) {
41
41
  var ApolloContext = getApolloContext();
42
42
  return (React__namespace.createElement(ApolloContext.Consumer, null, function (context) {
43
43
  __DEV__ ? globals.invariant(context && context.client, 'Could not find "client" in the context of ApolloConsumer. ' +
44
- 'Wrap the root component in an <ApolloProvider>.') : globals.invariant(context && context.client, 27);
44
+ 'Wrap the root component in an <ApolloProvider>.') : globals.invariant(context && context.client, 28);
45
45
  return props.children(context.client);
46
46
  }));
47
47
  };
@@ -55,7 +55,7 @@ var ApolloProvider = function (_a) {
55
55
  context = Object.assign({}, context, { client: client });
56
56
  }
57
57
  __DEV__ ? globals.invariant(context.client, 'ApolloProvider was not passed a client instance. Make ' +
58
- 'sure you pass in your client via the "client" prop.') : globals.invariant(context.client, 28);
58
+ 'sure you pass in your client via the "client" prop.') : globals.invariant(context.client, 29);
59
59
  return (React__namespace.createElement(ApolloContext.Provider, { value: context }, children));
60
60
  }));
61
61
  };
@@ -1,5 +1,6 @@
1
1
  /// <reference types="react" />
2
2
  import { DocumentNode } from 'graphql';
3
3
  import { OperationOption, DataProps, MutateProps } from './types';
4
- export declare function graphql<TProps extends TGraphQLVariables | {} = {}, TData = {}, TGraphQLVariables = {}, TChildProps = Partial<DataProps<TData, TGraphQLVariables>> & Partial<MutateProps<TData, TGraphQLVariables>>>(document: DocumentNode, operationOptions?: OperationOption<TProps, TData, TGraphQLVariables, TChildProps>): (WrappedComponent: React.ComponentType<TProps & TChildProps>) => React.ComponentClass<TProps>;
4
+ import { OperationVariables } from '../../core';
5
+ export declare function graphql<TProps extends TGraphQLVariables | {} = {}, TData extends object = {}, TGraphQLVariables extends OperationVariables = {}, TChildProps extends object = Partial<DataProps<TData, TGraphQLVariables>> & Partial<MutateProps<TData, TGraphQLVariables>>>(document: DocumentNode, operationOptions?: OperationOption<TProps, TData, TGraphQLVariables, TChildProps>): (WrappedComponent: React.ComponentType<TProps & TChildProps>) => React.ComponentClass<TProps>;
5
6
  //# sourceMappingURL=graphql.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"graphql.d.ts","sourceRoot":"","sources":["../../../src/react/hoc/graphql.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAMvC,OAAO,EAAE,eAAe,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAElE,wBAAgB,OAAO,CACrB,MAAM,SAAS,iBAAiB,GAAG,EAAE,GAAG,EAAE,EAC1C,KAAK,GAAG,EAAE,EACV,iBAAiB,GAAG,EAAE,EACtB,WAAW,GAAG,OAAO,CAAC,SAAS,CAAC,KAAK,EAAE,iBAAiB,CAAC,CAAC,GACxD,OAAO,CAAC,WAAW,CAAC,KAAK,EAAE,iBAAiB,CAAC,CAAC,EAEhD,QAAQ,EAAE,YAAY,EACtB,gBAAgB,GAAE,eAAe,CAC/B,MAAM,EACN,KAAK,EACL,iBAAiB,EACjB,WAAW,CACP,GACL,CACD,gBAAgB,EAAE,KAAK,CAAC,aAAa,CAAC,MAAM,GAAG,WAAW,CAAC,KACxD,KAAK,CAAC,cAAc,CAAC,MAAM,CAAC,CAUhC"}
1
+ {"version":3,"file":"graphql.d.ts","sourceRoot":"","sources":["../../../src/react/hoc/graphql.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAMvC,OAAO,EAAE,eAAe,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAClE,OAAO,EAAE,kB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,SAAS,CAAC,QAAQ,EAAE,gBAAgB,CAAC,CAAC;KAChD;AACH,CAAC","sourcesContent":["import { DocumentNode } from 'graphql';\n\nimport { parser, DocumentType } from '../parser';\nimport { withQuery } from './query-hoc';\nimport { withMutation } from './mutation-hoc';\nimport { withSubscription } from './subscription-hoc';\nimport { OperationOption, DataProps, MutateProps } from './types';\n\nexport function graphql<\n TProps extends TGraphQLVariables | {} = {},\n TData = {},\n TGraphQLVariables = {},\n TChildProps = Partial<DataProps<TData, TGraphQLVariables>> &\n Partial<MutateProps<TData, TGraphQLVariables>>\n>(\n document: DocumentNode,\n operationOptions: OperationOption<\n TProps,\n TData,\n TGraphQLVariables,\n TChildProps\n > = {}\n): (\n WrappedComponent: React.ComponentType<TProps & TChildProps>\n) => React.ComponentClass<TProps> {\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"]}
1
+ {"version":3,"file":"graphql.js","sourceRoot":"","sources":["../../../src/react/hoc/graphql.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACjD,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAItD,MAAM,UAAU,OAAO,CAOrB,QAAsB,EACtB,gBAKM;IALN,iCAAA,EAAA,qBAKM;IAIN,QAAQ,MAAM,CAAC,QAAQ,CAAC,CAAC,IAAI,EAAE;QAC7B,KAAK,YAAY,CAAC,QAAQ;YACxB,OAAO,YAAY,CAAC,QAAQ,EAAE,gBAAgB,CAAC,CAAC;QAClD,KAAK,YAAY,CAAC,YAAY;YAC5B,OAAO,gBAAgB,CAAC,QAAQ,EAAE,gBAAgB,CAAC,CAAC;QACtD,KAAK,YAAY,CAAC,KAAK,CAAC;QACxB;YACE,OAAO,SAAS,CAAC,QAAQ,EAAE,gBAAgB,CAAC,CAAC;KAChD;AACH,CAAC","sourcesContent":["import { DocumentNode } from 'graphql';\n\nimport { parser, DocumentType } from '../parser';\nimport { withQuery } from './query-hoc';\nimport { withMutation } from './mutation-hoc';\nimport { withSubscription } from './subscription-hoc';\nimport { OperationOption, DataProps, MutateProps } from './types';\nimport { OperationVariables } from '../../core';\n\nexport function graphql<\n TProps extends TGraphQLVariables | {} = {},\n TData extends object = {},\n TGraphQLVariables extends OperationVariables = {},\n TChildProps extends object = Partial<DataProps<TData, TGraphQLVariables>> &\n Partial<MutateProps<TData, TGraphQLVariables>>\n>(\n document: DocumentNode,\n operationOptions: OperationOption<\n TProps,\n TData,\n TGraphQLVariables,\n TChildProps\n > = {}\n): (\n WrappedComponent: React.ComponentType<TProps & TChildProps>\n) => React.ComponentClass<TProps> {\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"]}
@@ -6,7 +6,7 @@ export declare const defaultMapResultToProps: <P>(props: P) => P;
6
6
  export declare const defaultMapPropsToSkip: () => boolean;
7
7
  export declare function getDisplayName<P>(WrappedComponent: React.ComponentType<P>): string;
8
8
  export declare function calculateVariablesFromProps<TProps>(operation: IDocumentDefinition, props: TProps): OperationVariables;
9
- export declare type RefSetter<TChildProps> = (ref: React.ComponentClass<TChildProps>) => void | void;
9
+ export type RefSetter<TChildProps> = (ref: React.ComponentClass<TChildProps>) => void | void;
10
10
  export declare class GraphQLBase<TProps, TChildProps, TState = any> extends React.Component<TProps, TState> {
11
11
  withRef: boolean;
12
12
  private wrappedInstance?;
@@ -1 +1 @@
1
- {"version":3,"file":"hoc-utils.d.ts","sourceRoot":"","sources":["../../../src/react/hoc/hoc-utils.tsx"],"names":[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AAM,uBAAuB,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,KAAK,CAAkB,CAAC;AAC1E,eAAO,MAAM,qBAAqB,eAAc,CAAC;AAEjD,wBAAgB,cAAc,CAAC,CAAC,EAAE,gBAAgB,EAAE,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,UAEzE;AAED,wBAAgB,2BAA2B,CAAC,MAAM,EAChD,SAAS,EAAE,mBAAmB,EAC9B,KAAK,EAAE,MAAM,sBAoBd;AAED,MAAM,MAAM,SAAS,CAAC,WAAW,IAAI,CACnC,GAAG,EAAE,KAAK,CAAC,cAAc,CAAC,WAAW,CAAC,KACnC,IAAI,GAAG,IAAI,CAAC;AAGjB,qBAAa,WAAW,CACtB,MAAM,EACN,WAAW,EACX,MAAM,GAAG,GAAG,CACZ,SAAQ,KAAK,CAAC,SAAS,CAAC,MAAM,EAAE,MAAM,CAAC;IAChC,OAAO,EAAE,OAAO,CAAS;IAEhC,OAAO,CAAC,eAAe,CAAC,CAAoC;gBAEhD,KAAK,EAAE,MAAM;IAKzB,kBAAkB;IAUlB,kBAAkB,CAAC,GAAG,EAAE,KAAK,CAAC,cAAc,CAAC,WAAW,CAAC;CAG1D"}
@@ -35,7 +35,7 @@ var GraphQLBase = (function (_super) {
35
35
  }
36
36
  GraphQLBase.prototype.getWrappedInstance = function () {
37
37
  __DEV__ ? invariant(this.withRef, "To access the wrapped instance, you need to specify " +
38
- "{ withRef: true } in the options") : invariant(this.withRef, 29);
38
+ "{ withRef: true } in the options") : invariant(this.withRef, 30);
39
39
  return this.wrappedInstance;
40
40
  };
41
41
  GraphQLBase.prototype.setWrappedInstance = function (ref) {
package/react/hoc/hoc.cjs CHANGED
@@ -60,7 +60,7 @@ var GraphQLBase = (function (_super) {
60
60
  }
61
61
  GraphQLBase.prototype.getWrappedInstance = function () {
62
62
  __DEV__ ? globals.invariant(this.withRef, "To access the wrapped instance, you need to specify " +
63
- "{ withRef: true } in the options") : globals.invariant(this.withRef, 29);
63
+ "{ withRef: true } in the options") : globals.invariant(this.withRef, 30);
64
64
  return this.wrappedInstance;
65
65
  };
66
66
  GraphQLBase.prototype.setWrappedInstance = function (ref) {
@@ -292,7 +292,7 @@ function withApollo(WrappedComponent, operationOptions) {
292
292
  }
293
293
  WithApollo.prototype.getWrappedInstance = function () {
294
294
  __DEV__ ? globals.invariant(operationOptions.withRef, "To access the wrapped instance, you need to specify " +
295
- "{ withRef: true } in the options") : globals.invariant(operationOptions.withRef, 30);
295
+ "{ withRef: true } in the options") : globals.invariant(operationOptions.withRef, 31);
296
296
  return this.wrappedInstance;
297
297
  };
298
298
  WithApollo.prototype.setWrappedInstance = function (ref) {
@@ -1 +1 @@
1
- {"version":3,"file":"hoc.cjs","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, 29);\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 = \"\".concat(alias, \"(\").concat(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 = \"\".concat(alias, \"(\").concat(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 ? \"\".concat(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 = \"\".concat(alias, \"(\").concat(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.updateResubscribe = function (resubscribe) {\n this.setState({ resubscribe: resubscribe });\n };\n GraphQL.prototype.componentDidUpdate = function (prevProps) {\n var resubscribe = !!(shouldResubscribe &&\n shouldResubscribe(prevProps, this.props));\n if (this.state.resubscribe !== resubscribe) {\n this.updateResubscribe(resubscribe);\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(\".concat(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, 30);\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"],"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AAE;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
+ {"version":3,"file":"hoc.cjs","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, 30);\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 = \"\".concat(alias, \"(\").concat(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 = \"\".concat(alias, \"(\").concat(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 ? \"\".concat(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 = \"\".concat(alias, \"(\").concat(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.updateResubscribe = function (resubscribe) {\n this.setState({ resubscribe: resubscribe });\n };\n GraphQL.prototype.componentDidUpdate = function (prevProps) {\n var resubscribe = !!(shouldResubscribe &&\n shouldResubscribe(prevProps, this.props));\n if (this.state.resubscribe !== resubscribe) {\n this.updateResubscribe(resubscribe);\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(\".concat(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, 31);\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,2BAA2B,CAAC,SAAS,EAAE,KAAK,EAAE;AAC9D,IAAI,IAAI,SAAS,GAAG,EAAE,CAAC;AACvB,IAAI,KAAK,IAAI,EAAE,GAAG,CAAC,EAAE,EAAE,GAAG,SAAS,CAAC,SAAS,EAAE,EAAE,GAAG,EAAE,CAAC,MAAM,EAAE,EAAE,EAAE,EAAE;AACrE,QAAQ,IAAI,EAAE,GAAG,EAAE,CAAC,EAAE,CAAC,EAAE,QAAQ,GAAG,EAAE,CAAC,QAAQ,EAAE,IAAI,GAAG,EAAE,CAAC,IAAI,CAAC;AAChE,QAAQ,IAAI,CAAC,QAAQ,CAAC,IAAI,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK;AAClD,YAAY,SAAS;AACrB,QAAQ,IAAI,YAAY,GAAG,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC;AAC/C,QAAQ,IAAI,YAAY,GAAG,KAAK,CAAC,YAAY,CAAC,CAAC;AAC/C,QAAQ,IAAI,OAAO,YAAY,KAAK,WAAW,EAAE;AACjD,YAAY,SAAS,CAAC,YAAY,CAAC,GAAG,YAAY,CAAC;AACnD,YAAY,SAAS;AACrB,SAAS;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;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;;;;;;;;"}
@@ -60,7 +60,7 @@ var GraphQLBase = (function (_super) {
60
60
  }
61
61
  GraphQLBase.prototype.getWrappedInstance = function () {
62
62
  __DEV__ ? globals.invariant(this.withRef, "To access the wrapped instance, you need to specify " +
63
- "{ withRef: true } in the options") : globals.invariant(this.withRef, 29);
63
+ "{ withRef: true } in the options") : globals.invariant(this.withRef, 30);
64
64
  return this.wrappedInstance;
65
65
  };
66
66
  GraphQLBase.prototype.setWrappedInstance = function (ref) {
@@ -292,7 +292,7 @@ function withApollo(WrappedComponent, operationOptions) {
292
292
  }
293
293
  WithApollo.prototype.getWrappedInstance = function () {
294
294
  __DEV__ ? globals.invariant(operationOptions.withRef, "To access the wrapped instance, you need to specify " +
295
- "{ withRef: true } in the options") : globals.invariant(operationOptions.withRef, 30);
295
+ "{ withRef: true } in the options") : globals.invariant(operationOptions.withRef, 31);
296
296
  return this.wrappedInstance;
297
297
  };
298
298
  WithApollo.prototype.setWrappedInstance = function (ref) {
@@ -1,7 +1,7 @@
1
1
  import * as React from 'react';
2
2
  import { DocumentNode } from 'graphql';
3
- import { DefaultContext } from '../../core/types';
3
+ import { DefaultContext, OperationVariables } from '../../core/types';
4
4
  import { OperationOption, MutateProps } from './types';
5
5
  import { ApolloCache } from '../../core';
6
- export declare function withMutation<TProps extends TGraphQLVariables | {} = {}, TData extends Record<string, any> = {}, TGraphQLVariables = {}, TChildProps = MutateProps<TData, TGraphQLVariables>, TContext = DefaultContext, TCache extends ApolloCache<any> = ApolloCache<any>>(document: DocumentNode, operationOptions?: OperationOption<TProps, TData, TGraphQLVariables, TChildProps>): (WrappedComponent: React.ComponentType<TProps & TChildProps>) => React.ComponentClass<TProps>;
6
+ export declare function withMutation<TProps extends TGraphQLVariables | {} = {}, TData extends Record<string, any> = {}, TGraphQLVariables extends OperationVariables = {}, TChildProps = MutateProps<TData, TGraphQLVariables>, TContext extends Record<string, any> = DefaultContext, TCache extends ApolloCache<any> = ApolloCache<any>>(document: DocumentNode, operationOptions?: OperationOption<TProps, TData, TGraphQLVariables, TChildProps>): (WrappedComponent: React.ComponentType<TProps & TChildProps>) => React.ComponentClass<TProps>;
7
7
  //# sourceMappingURL=mutation-hoc.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"mutation-hoc.d.ts","sourceRoot":"","sources":["../../../src/react/hoc/mutation-hoc.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAIvC,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAclD,OAAO,EAAE,eAAe,EAAe,WAAW,EAAE,MAAM,SAAS,CAAC;AACpE,OAAO,EAAE,WAAW,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KAAK,CAAC,SAAS,CAAQ,CAAC;qBACvD;oBAED,OAAO,oBAAC,gBAAgB,eAAK,KAAK,EAAM,UAAU,EAAI,CAAC;gBACzD,CAAC,CACQ,CACZ,CAAC;YACJ,CAAC;YApDM,mBAAW,GAAG,kBAAkB,CAAC;YACjC,wBAAgB,GAAG,gBAAgB,CAAC;YAoD7C,cAAC;SAAA,AAtDD,CAAsB,WAAW,GAsDhC;QAGD,OAAO,oBAAoB,CAAC,OAAO,EAAE,gBAAgB,EAAE,EAAE,CAAC,CAAC;IAC7D,CAAC,CAAC;AACJ,CAAC","sourcesContent":["import * as React from 'react';\nimport { DocumentNode } from 'graphql';\nimport hoistNonReactStatics from 'hoist-non-react-statics';\n\nimport { parser } from '../parser';\nimport { DefaultContext } from '../../core/types';\nimport {\n BaseMutationOptions,\n MutationFunction,\n MutationResult\n} from '../types/types';\nimport { Mutation } from '../components';\n\nimport {\n defaultMapPropsToOptions,\n getDisplayName,\n calculateVariablesFromProps,\n GraphQLBase\n} from './hoc-utils';\nimport { OperationOption, OptionProps, MutateProps } from './types';\nimport { ApolloCache } from '../../core';\n\nexport function withMutation<\n TProps extends TGraphQLVariables | {} = {},\n TData extends Record<string, any> = {},\n TGraphQLVariables = {},\n TChildProps = MutateProps<TData, TGraphQLVariables>,\n TContext = DefaultContext,\n TCache extends ApolloCache<any> = ApolloCache<any>,\n>(\n document: DocumentNode,\n operationOptions: OperationOption<\n TProps,\n TData,\n TGraphQLVariables,\n TChildProps\n > = {}\n) {\n // this is memoized so if coming from `graphql` there is nearly no extra cost\n const operation = parser(document);\n // extract options\n\n const {\n options = defaultMapPropsToOptions,\n alias = 'Apollo'\n } = operationOptions;\n\n let mapPropsToOptions = options as (props: any) => BaseMutationOptions<TData, TGraphQLVariables, TContext, TCache>;\n if (typeof mapPropsToOptions !== 'function')\n mapPropsToOptions = () => options as BaseMutationOptions<TData, TGraphQLVariables, TContext, TCache>;\n\n return (\n WrappedComponent: React.ComponentType<TProps & TChildProps>\n ): React.ComponentClass<TProps> => {\n const graphQLDisplayName = `${alias}(${getDisplayName(WrappedComponent)})`;\n class GraphQL extends GraphQLBase<TProps, TChildProps> {\n static displayName = graphQLDisplayName;\n static WrappedComponent = WrappedComponent;\n render() {\n let props = this.props as TProps;\n const opts = mapPropsToOptions(props) as BaseMutationOptions<TData, TGraphQLVariables, TContext, TCache>;\n\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) as TGraphQLVariables;\n }\n\n return (\n <Mutation ignoreResults {...opts} mutation={document}>\n {(\n mutate: MutationFunction<TData, TGraphQLVariables>,\n { data, ...r }: MutationResult<TData>\n ) => {\n // the HOC's historically hoisted the data from the execution result\n // up onto the result since it was passed as a nested prop\n // we massage the Mutation component's shape here to replicate that\n // this matches the query HoC\n const result = Object.assign(r, data || {});\n const name = operationOptions.name || 'mutate';\n const resultName = operationOptions.name\n ? `${name}Result`\n : 'result';\n let childProps = ({\n [name]: mutate,\n [resultName]: result\n } as any) as TChildProps;\n if (operationOptions.props) {\n const newResult: OptionProps<\n TProps,\n TData,\n TGraphQLVariables\n > = {\n [name]: mutate,\n [resultName]: result,\n ownProps: props\n };\n childProps = operationOptions.props(newResult) as any;\n }\n\n return <WrappedComponent {...props} {...childProps} />;\n }}\n </Mutation>\n );\n }\n }\n\n // Make sure we preserve any custom statics on the original component.\n return hoistNonReactStatics(GraphQL, WrappedComponent, {});\n };\n}\n"]}
1
+ {"version":3,"file":"mutation-hoc.js","sourceRoot":"","sources":["../../../src/react/hoc/mutation-hoc.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,oBAAoB,MAAM,yBAAyB,CAAC;AAE3D,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAOnC,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CA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IAAE,QAAQ,EAAE,QAAQ,KACjD,UACC,MAAkD,EAClD,EAAqC;;oBAAnC,IAAA,IAAI,UAAA,EAAK,CAAC,cAAZ,QAAc,CAAF;oBAMZ,IAAM,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,IAAI,IAAI,EAAE,CAAC,CAAC;oBAC5C,IAAM,IAAI,GAAG,gBAAgB,CAAC,IAAI,IAAI,QAAQ,CAAC;oBAC/C,IAAM,UAAU,GAAG,gBAAgB,CAAC,IAAI;wBACtC,CAAC,CAAC,UAAG,IAAI,WAAQ;wBACjB,CAAC,CAAC,QAAQ,CAAC;oBACb,IAAI,UAAU,GAAG,CAAC;wBAChB,GAAC,IAAI,IAAG,MAAM;wBACd,GAAC,UAAU,IAAG,MAAM;0BACE,CAAA,CAAC;oBACzB,IAAI,gBAAgB,CAAC,KAAK,EAAE;wBAC1B,IAAM,SAAS;4BAKb,GAAC,IAAI,IAAG,MAAM;4BACd,GAAC,UAAU,IAAG,MAAM;4BACpB,WAAQ,GAAE,KAAK;+BAChB,CAAC;wBACF,UAAU,GAAG,gBAAgB,CAAC,KAAK,CAAC,SAAS,CAAQ,CAAC;qBACvD;oBAED,OAAO,oBAAC,gBAAgB,eAAK,KAAK,EAAM,UAAU,EAAI,CAAC;gBACzD,CAAC,CACQ,CACZ,CAAC;YACJ,CAAC;YApDM,mBAAW,GAAG,kBAAkB,CAAC;YACjC,wBAAgB,GAAG,gBAAgB,CAAC;YAoD7C,cAAC;SAAA,AAtDD,CAAsB,WAAW,GAsDhC;QAGD,OAAO,oBAAoB,CAAC,OAAO,EAAE,gBAAgB,EAAE,EAAE,CAAC,CAAC;IAC7D,CAAC,CAAC;AACJ,CAAC","sourcesContent":["import * as React from 'react';\nimport { DocumentNode } from 'graphql';\nimport hoistNonReactStatics from 'hoist-non-react-statics';\n\nimport { parser } from '../parser';\nimport { DefaultContext, OperationVariables } from '../../core/types';\nimport {\n BaseMutationOptions,\n MutationFunction,\n MutationResult\n} from '../types/types';\nimport { Mutation } from '../components';\n\nimport {\n defaultMapPropsToOptions,\n getDisplayName,\n calculateVariablesFromProps,\n GraphQLBase\n} from './hoc-utils';\nimport { OperationOption, OptionProps, MutateProps } from './types';\nimport { ApolloCache } from '../../core';\n\nexport function withMutation<\n TProps extends TGraphQLVariables | {} = {},\n TData extends Record<string, any> = {},\n TGraphQLVariables extends OperationVariables = {},\n TChildProps = MutateProps<TData, TGraphQLVariables>,\n TContext extends Record<string, any> = DefaultContext,\n TCache extends ApolloCache<any> = ApolloCache<any>,\n>(\n document: DocumentNode,\n operationOptions: OperationOption<\n TProps,\n TData,\n TGraphQLVariables,\n TChildProps\n > = {}\n) {\n // this is memoized so if coming from `graphql` there is nearly no extra cost\n const operation = parser(document);\n // extract options\n\n const {\n options = defaultMapPropsToOptions,\n alias = 'Apollo'\n } = operationOptions;\n\n let mapPropsToOptions = options as (props: any) => BaseMutationOptions<TData, TGraphQLVariables, TContext, TCache>;\n if (typeof mapPropsToOptions !== 'function')\n mapPropsToOptions = () => options as BaseMutationOptions<TData, TGraphQLVariables, TContext, TCache>;\n\n return (\n WrappedComponent: React.ComponentType<TProps & TChildProps>\n ): React.ComponentClass<TProps> => {\n const graphQLDisplayName = `${alias}(${getDisplayName(WrappedComponent)})`;\n class GraphQL extends GraphQLBase<TProps, TChildProps> {\n static displayName = graphQLDisplayName;\n static WrappedComponent = WrappedComponent;\n render() {\n let props = this.props as TProps;\n const opts = mapPropsToOptions(props) as BaseMutationOptions<TData, TGraphQLVariables, TContext, TCache>;\n\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) as TGraphQLVariables;\n }\n\n return (\n <Mutation ignoreResults {...opts} mutation={document}>\n {(\n mutate: MutationFunction<TData, TGraphQLVariables>,\n { data, ...r }: MutationResult<TData>\n ) => {\n // the HOC's historically hoisted the data from the execution result\n // up onto the result since it was passed as a nested prop\n // we massage the Mutation component's shape here to replicate that\n // this matches the query HoC\n const result = Object.assign(r, data || {});\n const name = operationOptions.name || 'mutate';\n const resultName = operationOptions.name\n ? `${name}Result`\n : 'result';\n let childProps = ({\n [name]: mutate,\n [resultName]: result\n } as any) as TChildProps;\n if (operationOptions.props) {\n const newResult: OptionProps<\n TProps,\n TData,\n TGraphQLVariables\n > = {\n [name]: mutate,\n [resultName]: result,\n ownProps: props\n };\n childProps = operationOptions.props(newResult) as any;\n }\n\n return <WrappedComponent {...props} {...childProps} />;\n }}\n </Mutation>\n );\n }\n }\n\n // Make sure we preserve any custom statics on the original component.\n return hoistNonReactStatics(GraphQL, WrappedComponent, {});\n };\n}\n"]}
@@ -1,5 +1,5 @@
1
1
  import * as React from 'react';
2
2
  import { DocumentNode } from 'graphql';
3
3
  import { OperationOption, DataProps } from './types';
4
- export declare function withQuery<TProps extends TGraphQLVariables | {} = {}, TData = {}, TGraphQLVariables = {}, TChildProps = DataProps<TData, TGraphQLVariables>>(document: DocumentNode, operationOptions?: OperationOption<TProps, TData, TGraphQLVariables, TChildProps>): (WrappedComponent: React.ComponentType<TProps & TChildProps>) => React.ComponentClass<TProps>;
4
+ export declare function withQuery<TProps extends TGraphQLVariables | Record<string, any> = Record<string, any>, TData extends object = {}, TGraphQLVariables extends object = {}, TChildProps extends object = DataProps<TData, TGraphQLVariables>>(document: DocumentNode, operationOptions?: OperationOption<TProps, TData, TGraphQLVariables, TChildProps>): (WrappedComponent: React.ComponentType<TProps & TChildProps>) => React.ComponentClass<TProps>;
5
5
  //# sourceMappingURL=query-hoc.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"query-hoc.d.ts","sourceRoot":"","sources":["../../../src/react/hoc/query-hoc.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAavC,OAAO,EAAE,eAAe,EAAe,SAAS,EAAE,MAAM,SAAS,CAAC;AAElE,wBAAgB,SAAS,CACvB,MAAM,SAAS,iBAAiB,GAAG,EAAE,GAAG,EAAE,EAC1C,KAAK,GAAG,EAAE,EACV,iBAAiB,GAAG,EAAE,EACtB,WAAW,GAAG,SAAS,CAAC,KAAK,EAAE,iBAAiB,CAAC,EAEjD,QAAQ,EAAE,YAAY,EACtB,gBAAgB,GAAE,eAAe,CAC/B,MAAM,EACN,KAAK,EACL,iBAAiB,EACjB,WAAW,CACP,sBAwBc,MAAM,aAAa,CAAC,MAAM,GAAG,WAAW,CAAC,KAC1D,MAAM,cAAc,CAAC,MAAM,CAAC,CA+EhC"}
1
+ {"version":3,"file":"query-hoc.d.ts","sourceRoot":"","sources":["../../../src/react/hoc/query-hoc.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAavC,OAAO,EAAE,eAAe,EAAe,SAAS,EAAE,MAAM,SAAS,CAAC;AAElE,wBAAgB,SAAS,CACvB,MAAM,SAAS,iBAAiB,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAC5E,KAAK,SAAS,MAAM,GAAG,EAAE,EACzB,iBAAiB,SAAS,MAAM,GAAG,EAAE,EACrC,WAAW,SAAS,MAAM,GAAG,SAAS,CAAC,KAAK,EAAE,iBAAiB,CAAC,EAEhE,QAAQ,EAAE,YAAY,EACtB,gBAAgB,GAAE,eAAe,CAC/B,MAAM,EACN,KAAK,EACL,iBAAiB,EACjB,WAAW,CACP,sBAwBc,MAAM,aAAa,CAAC,MAAM,GAAG,WAAW,CAAC,KAC1D,MAAM,cAAc,CAAC,MAAM,CAAC,CA+EhC"}
@@ -1 +1 @@
1
- {"version":3,"file":"query-hoc.js","sourceRoot":"","sources":["../../../src/react/hoc/query-hoc.tsx"],"names":[],"mappings":";AAA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AG,gBAAgB,CAAC,KAAK,CACtC,SAAS,EACT,eAAe,CAChB,CAAC;wBACF,UAAU,GAAG,eAAe,CAAC;qBAC9B;oBAED,OAAO,CACL,oBAAC,gBAAgB,eACV,KAAgB,EAChB,UAA0B,EAC/B,CACH,CAAC;gBACJ,CAAC,CACK,CACT,CAAC;YACJ,CAAC;YAtEM,mBAAW,GAAG,kBAAkB,CAAC;YACjC,wBAAgB,GAAG,gBAAgB,CAAC;YAsE7C,cAAC;SAAA,AAxED,CAAsB,WAAW,GAwEhC;QAGD,OAAO,oBAAoB,CAAC,OAAO,EAAE,gBAAgB,EAAE,EAAE,CAAC,CAAC;IAC7D,CAAC,CAAC;AACJ,CAAC","sourcesContent":["import * as React from 'react';\nimport { DocumentNode } from 'graphql';\nimport hoistNonReactStatics from 'hoist-non-react-statics';\n\nimport { parser } from '../parser';\nimport { BaseQueryOptions } from '../types/types';\nimport { Query } from '../components';\nimport {\n getDisplayName,\n GraphQLBase,\n calculateVariablesFromProps,\n defaultMapPropsToOptions,\n defaultMapPropsToSkip\n} from './hoc-utils';\nimport { OperationOption, OptionProps, DataProps } from './types';\n\nexport function withQuery<\n TProps extends TGraphQLVariables | {} = {},\n TData = {},\n TGraphQLVariables = {},\n TChildProps = DataProps<TData, TGraphQLVariables>\n>(\n document: DocumentNode,\n operationOptions: OperationOption<\n TProps,\n TData,\n TGraphQLVariables,\n TChildProps\n > = {}\n) {\n // this is memoized so if coming from `graphql` there is nearly no extra cost\n const operation = parser(document);\n // extract options\n const {\n options = defaultMapPropsToOptions,\n skip = defaultMapPropsToSkip,\n alias = 'Apollo'\n } = operationOptions;\n\n let mapPropsToOptions = options as (props: any) => BaseQueryOptions;\n if (typeof mapPropsToOptions !== 'function') {\n mapPropsToOptions = () => options as BaseQueryOptions;\n }\n\n let mapPropsToSkip = skip as (props: any) => boolean;\n if (typeof mapPropsToSkip !== 'function') {\n mapPropsToSkip = () => skip as any;\n }\n\n // allow for advanced referential equality checks\n let lastResultProps: TChildProps | void;\n return (\n WrappedComponent: React.ComponentType<TProps & TChildProps>\n ): React.ComponentClass<TProps> => {\n const graphQLDisplayName = `${alias}(${getDisplayName(WrappedComponent)})`;\n class GraphQL extends GraphQLBase<TProps, TChildProps> {\n static displayName = graphQLDisplayName;\n static WrappedComponent = WrappedComponent;\n\n render() {\n let props = this.props;\n const shouldSkip = mapPropsToSkip(props);\n const opts = shouldSkip\n ? Object.create(null)\n : { ...mapPropsToOptions(props) };\n\n if (!shouldSkip && !opts.variables && operation.variables.length > 0) {\n opts.variables = calculateVariablesFromProps(operation, props);\n }\n\n return (\n <Query\n {...opts}\n displayName={graphQLDisplayName}\n skip={shouldSkip}\n query={document}\n >\n {({ client: _, data, ...r }: any) => {\n if (operationOptions.withRef) {\n this.withRef = true;\n props = Object.assign({}, props, {\n ref: this.setWrappedInstance\n });\n }\n\n // if we have skipped, no reason to manage any reshaping\n if (shouldSkip) {\n return (\n <WrappedComponent\n {...(props as TProps)}\n {...({} as TChildProps)}\n />\n );\n }\n\n // the HOC's historically hoisted the data from the execution result\n // up onto the result since it was passed as a nested prop\n // we massage the Query components shape here to replicate that\n const result = Object.assign(r, data || {});\n const name = operationOptions.name || 'data';\n let childProps = { [name]: result };\n if (operationOptions.props) {\n const newResult: OptionProps<\n TProps,\n TData,\n TGraphQLVariables\n > = {\n [name]: result,\n ownProps: props as TProps\n };\n lastResultProps = operationOptions.props(\n newResult,\n lastResultProps\n );\n childProps = lastResultProps;\n }\n\n return (\n <WrappedComponent\n {...(props as TProps)}\n {...(childProps as TChildProps)}\n />\n );\n }}\n </Query>\n );\n }\n }\n\n // Make sure we preserve any custom statics on the original component.\n return hoistNonReactStatics(GraphQL, WrappedComponent, {});\n };\n}\n"]}
1
+ {"version":3,"file":"query-hoc.js","sourceRoot":"","sources":["../../../src/react/hoc/query-hoc.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,oBAAoB,MAAM,yBAAyB,CA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eAAe,CAAC;qBAC9B;oBAED,OAAO,CACL,oBAAC,gBAAgB,eACV,KAAgB,EAChB,UAA0B,EAC/B,CACH,CAAC;gBACJ,CAAC,CACK,CACT,CAAC;YACJ,CAAC;YAtEM,mBAAW,GAAG,kBAAkB,CAAC;YACjC,wBAAgB,GAAG,gBAAgB,CAAC;YAsE7C,cAAC;SAAA,AAxED,CAAsB,WAAW,GAwEhC;QAGD,OAAO,oBAAoB,CAAC,OAAO,EAAE,gBAAgB,EAAE,EAAE,CAAC,CAAC;IAC7D,CAAC,CAAC;AACJ,CAAC","sourcesContent":["import * as React from 'react';\nimport { DocumentNode } from 'graphql';\nimport hoistNonReactStatics from 'hoist-non-react-statics';\n\nimport { parser } from '../parser';\nimport { BaseQueryOptions } from '../types/types';\nimport { Query } from '../components';\nimport {\n getDisplayName,\n GraphQLBase,\n calculateVariablesFromProps,\n defaultMapPropsToOptions,\n defaultMapPropsToSkip\n} from './hoc-utils';\nimport { OperationOption, OptionProps, DataProps } from './types';\n\nexport function withQuery<\n TProps extends TGraphQLVariables | Record<string, any> = Record<string, any>,\n TData extends object = {},\n TGraphQLVariables extends object = {},\n TChildProps extends object = DataProps<TData, TGraphQLVariables>\n>(\n document: DocumentNode,\n operationOptions: OperationOption<\n TProps,\n TData,\n TGraphQLVariables,\n TChildProps\n > = {}\n) {\n // this is memoized so if coming from `graphql` there is nearly no extra cost\n const operation = parser(document);\n // extract options\n const {\n options = defaultMapPropsToOptions,\n skip = defaultMapPropsToSkip,\n alias = 'Apollo'\n } = operationOptions;\n\n let mapPropsToOptions = options as (props: any) => BaseQueryOptions;\n if (typeof mapPropsToOptions !== 'function') {\n mapPropsToOptions = () => options as BaseQueryOptions;\n }\n\n let mapPropsToSkip = skip as (props: any) => boolean;\n if (typeof mapPropsToSkip !== 'function') {\n mapPropsToSkip = () => skip as any;\n }\n\n // allow for advanced referential equality checks\n let lastResultProps: TChildProps | void;\n return (\n WrappedComponent: React.ComponentType<TProps & TChildProps>\n ): React.ComponentClass<TProps> => {\n const graphQLDisplayName = `${alias}(${getDisplayName(WrappedComponent)})`;\n class GraphQL extends GraphQLBase<TProps, TChildProps> {\n static displayName = graphQLDisplayName;\n static WrappedComponent = WrappedComponent;\n\n render() {\n let props = this.props;\n const shouldSkip = mapPropsToSkip(props);\n const opts = shouldSkip\n ? Object.create(null)\n : { ...mapPropsToOptions(props) };\n\n if (!shouldSkip && !opts.variables && operation.variables.length > 0) {\n opts.variables = calculateVariablesFromProps(operation, props);\n }\n\n return (\n <Query\n {...opts}\n displayName={graphQLDisplayName}\n skip={shouldSkip}\n query={document}\n >\n {({ client: _, data, ...r }: any) => {\n if (operationOptions.withRef) {\n this.withRef = true;\n props = Object.assign({}, props, {\n ref: this.setWrappedInstance\n });\n }\n\n // if we have skipped, no reason to manage any reshaping\n if (shouldSkip) {\n return (\n <WrappedComponent\n {...(props as TProps)}\n {...({} as TChildProps)}\n />\n );\n }\n\n // the HOC's historically hoisted the data from the execution result\n // up onto the result since it was passed as a nested prop\n // we massage the Query components shape here to replicate that\n const result = Object.assign(r, data || {});\n const name = operationOptions.name || 'data';\n let childProps = { [name]: result };\n if (operationOptions.props) {\n const newResult: OptionProps<\n TProps,\n TData,\n TGraphQLVariables\n > = {\n [name]: result,\n ownProps: props as TProps\n };\n lastResultProps = operationOptions.props(\n newResult,\n lastResultProps\n );\n childProps = lastResultProps;\n }\n\n return (\n <WrappedComponent\n {...(props as TProps)}\n {...(childProps as TChildProps)}\n />\n );\n }}\n </Query>\n );\n }\n }\n\n // Make sure we preserve any custom statics on the original component.\n return hoistNonReactStatics(GraphQL, WrappedComponent, {});\n };\n}\n"]}
@@ -1,5 +1,5 @@
1
1
  import * as React from 'react';
2
2
  import { DocumentNode } from 'graphql';
3
3
  import { OperationOption, DataProps } from './types';
4
- export declare function withSubscription<TProps extends TGraphQLVariables | {} = {}, TData = {}, TGraphQLVariables = {}, TChildProps = DataProps<TData, TGraphQLVariables>>(document: DocumentNode, operationOptions?: OperationOption<TProps, TData, TGraphQLVariables, TChildProps>): (WrappedComponent: React.ComponentType<TProps & TChildProps>) => React.ComponentClass<TProps>;
4
+ export declare function withSubscription<TProps extends TGraphQLVariables | {} = {}, TData extends object = {}, TGraphQLVariables extends object = {}, TChildProps extends object = DataProps<TData, TGraphQLVariables>>(document: DocumentNode, operationOptions?: OperationOption<TProps, TData, TGraphQLVariables, TChildProps>): (WrappedComponent: React.ComponentType<TProps & TChildProps>) => React.ComponentClass<TProps>;
5
5
  //# sourceMappingURL=subscription-hoc.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"subscription-hoc.d.ts","sourceRoot":"","sources":["../../../src/react/hoc/subscription-hoc.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAavC,OAAO,EAAE,eAAe,EAAe,SAAS,EAAE,MAAM,SAAS,CAAC;AAElE,wBAAgB,gBAAgB,CAC9B,MAAM,SAAS,iBAAiB,GAAG,EAAE,GAAG,EAAE,EAC1C,KAAK,GAAG,EAAE,EACV,iBAAiB,GAAG,EAAE,EACtB,WAAW,GAAG,SAAS,CAAC,KAAK,EAAE,iBAAiB,CAAC,EAEjD,QAAQ,EAAE,YAAY,EACtB,gBAAgB,GAAE,eAAe,CAC/B,MAAM,EACN,KAAK,EACL,iBAAiB,EACjB,WAAW,CACP,sBAsBc,MAAM,aAAa,CAAC,MAAM,GAAG,WAAW,CAAC,KAC1D,MAAM,cAAc,CAAC,MAAM,CAAC,CAoGhC"}
1
+ {"version":3,"file":"subscription-hoc.d.ts","sourceRoot":"","sources":["../../../src/react/hoc/subscription-hoc.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAavC,OAAO,EAAE,eAAe,EAAe,SAAS,EAAE,MAAM,SAAS,CAAC;AAElE,wBAAgB,g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ACH,CAAC;gBACJ,CAAC,CACY,CAChB,CAAC;YACJ,CAAC;YAvFM,mBAAW,GAAG,kBAAkB,CAAC;YACjC,wBAAgB,GAAG,gBAAgB,CAAC;YAuF7C,cAAC;SAAA,AA7FD,CAAsB,WAAW,GA6FhC;QAGD,OAAO,oBAAoB,CAAC,OAAO,EAAE,gBAAgB,EAAE,EAAE,CAAC,CAAC;IAC7D,CAAC,CAAC;AACJ,CAAC","sourcesContent":["import * as React from 'react';\nimport { DocumentNode } from 'graphql';\nimport hoistNonReactStatics from 'hoist-non-react-statics';\n\nimport { parser } from '../parser';\nimport { BaseQueryOptions } from '../types/types';\nimport { Subscription } from '../components';\nimport {\n getDisplayName,\n GraphQLBase,\n calculateVariablesFromProps,\n defaultMapPropsToOptions,\n defaultMapPropsToSkip\n} from './hoc-utils';\nimport { OperationOption, OptionProps, DataProps } from './types';\n\nexport function withSubscription<\n TProps extends TGraphQLVariables | {} = {},\n TData = {},\n TGraphQLVariables = {},\n TChildProps = DataProps<TData, TGraphQLVariables>\n>(\n document: DocumentNode,\n operationOptions: OperationOption<\n TProps,\n TData,\n TGraphQLVariables,\n TChildProps\n > = {}\n) {\n // this is memoized so if coming from `graphql` there is nearly no extra cost\n const operation = parser(document);\n // extract options\n const {\n options = defaultMapPropsToOptions,\n skip = defaultMapPropsToSkip,\n alias = 'Apollo',\n shouldResubscribe\n } = operationOptions;\n\n let mapPropsToOptions = options as (props: any) => BaseQueryOptions;\n if (typeof mapPropsToOptions !== 'function')\n mapPropsToOptions = () => options as BaseQueryOptions;\n\n let mapPropsToSkip = skip as (props: any) => boolean;\n if (typeof mapPropsToSkip !== 'function') mapPropsToSkip = () => skip as any;\n\n // allow for advanced referential equality checks\n let lastResultProps: TChildProps | void;\n return (\n WrappedComponent: React.ComponentType<TProps & TChildProps>\n ): React.ComponentClass<TProps> => {\n const graphQLDisplayName = `${alias}(${getDisplayName(WrappedComponent)})`;\n class GraphQL extends GraphQLBase<\n TProps,\n TChildProps,\n { resubscribe: boolean }\n > {\n static displayName = graphQLDisplayName;\n static WrappedComponent = WrappedComponent;\n constructor(props: TProps) {\n super(props);\n this.state = { resubscribe: false };\n }\n\n updateResubscribe(resubscribe: boolean) {\n this.setState({ resubscribe });\n }\n\n componentDidUpdate(prevProps: TProps) {\n const resubscribe = !!(\n shouldResubscribe &&\n shouldResubscribe(prevProps, this.props)\n );\n if (this.state.resubscribe !== resubscribe) {\n this.updateResubscribe(resubscribe);\n }\n }\n\n render() {\n let props = this.props;\n const shouldSkip = mapPropsToSkip(props);\n const opts = shouldSkip\n ? Object.create(null)\n : mapPropsToOptions(props);\n\n if (!shouldSkip && !opts.variables && operation.variables.length > 0) {\n opts.variables = calculateVariablesFromProps(operation, props);\n }\n return (\n <Subscription\n {...opts}\n displayName={graphQLDisplayName}\n skip={shouldSkip}\n subscription={document}\n shouldResubscribe={this.state.resubscribe}\n >\n {({ data, ...r }: any) => {\n if (operationOptions.withRef) {\n this.withRef = true;\n props = Object.assign({}, props, {\n ref: this.setWrappedInstance\n });\n }\n // if we have skipped, no reason to manage any reshaping\n if (shouldSkip) {\n return (\n <WrappedComponent\n {...(props as TProps)}\n {...({} as TChildProps)}\n />\n );\n }\n\n // the HOC's historically hoisted the data from the execution result\n // up onto the result since it was passed as a nested prop\n // we massage the Query components shape here to replicate that\n const result = Object.assign(r, data || {});\n const name = operationOptions.name || 'data';\n let childProps = { [name]: result };\n if (operationOptions.props) {\n const newResult: OptionProps<\n TProps,\n TData,\n TGraphQLVariables\n > = {\n [name]: result,\n ownProps: props as TProps\n };\n lastResultProps = operationOptions.props(\n newResult,\n lastResultProps\n );\n childProps = lastResultProps;\n }\n\n return (\n <WrappedComponent\n {...(props as TProps)}\n {...(childProps as TChildProps)}\n />\n );\n }}\n </Subscription>\n );\n }\n }\n\n // Make sure we preserve any custom statics on the original component.\n return hoistNonReactStatics(GraphQL, WrappedComponent, {});\n };\n}\n"]}
1
+ {"version":3,"file":"subscription-hoc.js","sourceRoot":"","sources":["../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B,KAAK,GAAG,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,KAAK,EAAE;4BAC/B,GAAG,EAAE,KAAI,CAAC,kBAAkB;yBAC7B,CAAC,CAAC;qBACJ;oBAED,IAAI,UAAU,EAAE;wBACd,OAAO,CACL,oBAAC,gBAAgB,eACV,KAAgB,EAChB,EAAkB,EACvB,CACH,CAAC;qBACH;oBAKD,IAAM,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,IAAI,IAAI,EAAE,CAAC,CAAC;oBAC5C,IAAM,IAAI,GAAG,gBAAgB,CAAC,IAAI,IAAI,MAAM,CAAC;oBAC7C,IAAI,UAAU,aAAK,GAAC,IAAI,IAAG,MAAM,KAAE,CAAC;oBACpC,IAAI,gBAAgB,CAAC,KAAK,EAAE;wBAC1B,IAAM,SAAS;4BAKb,GAAC,IAAI,IAAG,MAAM;4BACd,WAAQ,GAAE,KAAe;+BAC1B,CAAC;wBACF,eAAe,GAAG,gBAAgB,CAAC,KAAK,CACtC,SAAS,EACT,eAAe,CAChB,CAAC;wBACF,UAAU,GAAG,eAAe,CAAC;qBAC9B;oBAED,OAAO,CACL,oBAAC,gBAAgB,eACV,KAAgB,EAChB,UAA0B,EAC/B,CACH,CAAC;gBACJ,CAAC,CACY,CAChB,CAAC;YACJ,CAAC;YAvFM,mBAAW,GAAG,kBAAkB,CAAC;YACjC,wBAAgB,GAAG,gBAAgB,CAAC;YAuF7C,cAAC;SAAA,AA7FD,CAAsB,WAAW,GA6FhC;QAGD,OAAO,oBAAoB,CAAC,OAAO,EAAE,gBAAgB,EAAE,EAAE,CAAC,CAAC;IAC7D,CAAC,CAAC;AACJ,CAAC","sourcesContent":["import * as React from 'react';\nimport { DocumentNode } from 'graphql';\nimport hoistNonReactStatics from 'hoist-non-react-statics';\n\nimport { parser } from '../parser';\nimport { BaseQueryOptions } from '../types/types';\nimport { Subscription } from '../components';\nimport {\n getDisplayName,\n GraphQLBase,\n calculateVariablesFromProps,\n defaultMapPropsToOptions,\n defaultMapPropsToSkip\n} from './hoc-utils';\nimport { OperationOption, OptionProps, DataProps } from './types';\n\nexport function withSubscription<\n TProps extends TGraphQLVariables | {} = {},\n TData extends object = {},\n TGraphQLVariables extends object = {},\n TChildProps extends object = DataProps<TData, TGraphQLVariables>\n>(\n document: DocumentNode,\n operationOptions: OperationOption<\n TProps,\n TData,\n TGraphQLVariables,\n TChildProps\n > = {}\n) {\n // this is memoized so if coming from `graphql` there is nearly no extra cost\n const operation = parser(document);\n // extract options\n const {\n options = defaultMapPropsToOptions,\n skip = defaultMapPropsToSkip,\n alias = 'Apollo',\n shouldResubscribe\n } = operationOptions;\n\n let mapPropsToOptions = options as (props: any) => BaseQueryOptions;\n if (typeof mapPropsToOptions !== 'function')\n mapPropsToOptions = () => options as BaseQueryOptions;\n\n let mapPropsToSkip = skip as (props: any) => boolean;\n if (typeof mapPropsToSkip !== 'function') mapPropsToSkip = () => skip as any;\n\n // allow for advanced referential equality checks\n let lastResultProps: TChildProps | void;\n return (\n WrappedComponent: React.ComponentType<TProps & TChildProps>\n ): React.ComponentClass<TProps> => {\n const graphQLDisplayName = `${alias}(${getDisplayName(WrappedComponent)})`;\n class GraphQL extends GraphQLBase<\n TProps,\n TChildProps,\n { resubscribe: boolean }\n > {\n static displayName = graphQLDisplayName;\n static WrappedComponent = WrappedComponent;\n constructor(props: TProps) {\n super(props);\n this.state = { resubscribe: false };\n }\n\n updateResubscribe(resubscribe: boolean) {\n this.setState({ resubscribe });\n }\n\n componentDidUpdate(prevProps: TProps) {\n const resubscribe = !!(\n shouldResubscribe &&\n shouldResubscribe(prevProps, this.props)\n );\n if (this.state.resubscribe !== resubscribe) {\n this.updateResubscribe(resubscribe);\n }\n }\n\n render() {\n let props = this.props;\n const shouldSkip = mapPropsToSkip(props);\n const opts = shouldSkip\n ? Object.create(null)\n : mapPropsToOptions(props);\n\n if (!shouldSkip && !opts.variables && operation.variables.length > 0) {\n opts.variables = calculateVariablesFromProps(operation, props);\n }\n return (\n <Subscription\n {...opts}\n displayName={graphQLDisplayName}\n skip={shouldSkip}\n subscription={document}\n shouldResubscribe={this.state.resubscribe}\n >\n {({ data, ...r }: any) => {\n if (operationOptions.withRef) {\n this.withRef = true;\n props = Object.assign({}, props, {\n ref: this.setWrappedInstance\n });\n }\n // if we have skipped, no reason to manage any reshaping\n if (shouldSkip) {\n return (\n <WrappedComponent\n {...(props as TProps)}\n {...({} as TChildProps)}\n />\n );\n }\n\n // the HOC's historically hoisted the data from the execution result\n // up onto the result since it was passed as a nested prop\n // we massage the Query components shape here to replicate that\n const result = Object.assign(r, data || {});\n const name = operationOptions.name || 'data';\n let childProps = { [name]: result };\n if (operationOptions.props) {\n const newResult: OptionProps<\n TProps,\n TData,\n TGraphQLVariables\n > = {\n [name]: result,\n ownProps: props as TProps\n };\n lastResultProps = operationOptions.props(\n newResult,\n lastResultProps\n );\n childProps = lastResultProps;\n }\n\n return (\n <WrappedComponent\n {...(props as TProps)}\n {...(childProps as TChildProps)}\n />\n );\n }}\n </Subscription>\n );\n }\n }\n\n // Make sure we preserve any custom statics on the original component.\n return hoistNonReactStatics(GraphQL, WrappedComponent, {});\n };\n}\n"]}
@@ -14,7 +14,7 @@ export interface QueryControls<TData = any, TGraphQLVariables = OperationVariabl
14
14
  subscribeToMore: (options: SubscribeToMoreOptions) => () => void;
15
15
  updateQuery: (mapFn: (previousQueryResult: any, options: UpdateQueryOptions<any>) => any) => void;
16
16
  }
17
- export declare type DataValue<TData, TGraphQLVariables = OperationVariables> = QueryControls<TData, TGraphQLVariables> & Partial<TData>;
17
+ export type DataValue<TData, TGraphQLVariables = OperationVariables> = QueryControls<TData, TGraphQLVariables> & Partial<TData>;
18
18
  export interface DataProps<TData, TGraphQLVariables = OperationVariables> {
19
19
  data: DataValue<TData, TGraphQLVariables>;
20
20
  }
@@ -22,13 +22,13 @@ export interface MutateProps<TData = any, TGraphQLVariables = OperationVariables
22
22
  mutate: MutationFunction<TData, TGraphQLVariables>;
23
23
  result: MutationResult<TData>;
24
24
  }
25
- export declare type ChildProps<TProps = {}, TData = {}, TGraphQLVariables = OperationVariables> = TProps & Partial<DataProps<TData, TGraphQLVariables>> & Partial<MutateProps<TData, TGraphQLVariables>>;
26
- export declare type ChildDataProps<TProps = {}, TData = {}, TGraphQLVariables = OperationVariables> = TProps & DataProps<TData, TGraphQLVariables>;
27
- export declare type ChildMutateProps<TProps = {}, TData = {}, TGraphQLVariables = OperationVariables> = TProps & MutateProps<TData, TGraphQLVariables>;
25
+ export type ChildProps<TProps = {}, TData = {}, TGraphQLVariables = OperationVariables> = TProps & Partial<DataProps<TData, TGraphQLVariables>> & Partial<MutateProps<TData, TGraphQLVariables>>;
26
+ export type ChildDataProps<TProps = {}, TData = {}, TGraphQLVariables = OperationVariables> = TProps & DataProps<TData, TGraphQLVariables>;
27
+ export type ChildMutateProps<TProps = {}, TData = {}, TGraphQLVariables = OperationVariables> = TProps & MutateProps<TData, TGraphQLVariables>;
28
28
  export interface OptionProps<TProps = any, TData = any, TGraphQLVariables = OperationVariables> extends Partial<DataProps<TData, TGraphQLVariables>>, Partial<MutateProps<TData, TGraphQLVariables>> {
29
29
  ownProps: TProps;
30
30
  }
31
- export interface OperationOption<TProps, TData, TGraphQLVariables = OperationVariables, TChildProps = ChildProps<TProps, TData, TGraphQLVariables>, TContext = DefaultContext, TCache extends ApolloCache<any> = ApolloCache<any>> {
31
+ export interface OperationOption<TProps, TData, TGraphQLVariables extends OperationVariables = OperationVariables, TChildProps = ChildProps<TProps, TData, TGraphQLVariables>, TContext = DefaultContext, TCache extends ApolloCache<any> = ApolloCache<any>> {
32
32
  options?: BaseQueryOptions<TGraphQLVariables> | BaseMutationOptions<TData, TGraphQLVariables, TContext, TCache> | ((props: TProps) => BaseQueryOptions<TGraphQLVariables> | BaseMutationOptions<TData, TGraphQLVariables, TContext, TCache>);
33
33
  props?: (props: OptionProps<TProps, TData, TGraphQLVariables>, lastProps?: TChildProps | void) => TChildProps;
34
34
  skip?: boolean | ((props: TProps) => boolean);
@@ -37,7 +37,7 @@ export interface OperationOption<TProps, TData, TGraphQLVariables = OperationVar
37
37
  shouldResubscribe?: (props: TProps, nextProps: TProps) => boolean;
38
38
  alias?: string;
39
39
  }
40
- export declare type WithApolloClient<P> = P & {
40
+ export type WithApolloClient<P> = P & {
41
41
  client?: ApolloClient<any>;
42
42
  };
43
43
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/react/hoc/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AACvD,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAC3C,OAAO,EACL,iBAAiB,EACjB,kBAAkB,EAClB,gBAAgB,EAChB,kBAAkB,EAClB,qBAAqB,EACrB,sBAAsB,EACtB,cAAc,EACf,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,gBAAgB,EAChB,gBAAgB,EAChB,mBAAmB,EACnB,cAAc,EACf,MAAM,gBAAgB,CAAC;AAExB,MAAM,WAAW,aAAa,CAC5B,KAAK,GAAG,GAAG,EACX,iBAAiB,GAAG,kBAAkB;IAEtC,KAAK,CAAC,EAAE,WAAW,CAAC;IACpB,aAAa,EAAE,MAAM,CAAC;IACtB,OAAO,EAAE,OAAO,CAAC;IACjB,SAAS,EAAE,iBAAiB,CAAC;IAC7B,SAAS,EAAE,CACT,gBAAgB,EAAE,qBAAqB,CAAC,iBAAiB,EAAE,KAAK,CAAC,GAC/D,gBAAgB,CAAC,KAAK,EAAE,iBAAiB,CAAC,KACzC,OAAO,CAAC,iBAAiB,CAAC,KAAK,CAAC,CAAC,CAAC;IACvC,OAAO,EAAE,CAAC,SAAS,CAAC,EAAE,iBAAiB,KAAK,OAAO,CAAC,iBAAiB,CAAC,KAAK,CAAC,CAAC,CAAC;IAC9E,YAAY,EAAE,CAAC,YAAY,EAAE,MAAM,KAAK,IAAI,CAAC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