@apollo/client 3.5.1 → 3.5.5

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 (193) hide show
  1. package/README.md +1 -1
  2. package/apollo-client.cjs +144 -114
  3. package/apollo-client.cjs.map +1 -1
  4. package/apollo-client.min.cjs +1 -1
  5. package/cache/cache.cjs +15 -15
  6. package/cache/cache.cjs.map +1 -1
  7. package/cache/core/cache.js +2 -2
  8. package/cache/inmemory/entityStore.js +4 -4
  9. package/cache/inmemory/helpers.js +1 -1
  10. package/cache/inmemory/helpers.js.map +1 -1
  11. package/cache/inmemory/inMemoryCache.js +3 -3
  12. package/cache/inmemory/key-extractor.js +2 -2
  13. package/cache/inmemory/key-extractor.js.map +1 -1
  14. package/cache/inmemory/object-canon.js +2 -2
  15. package/cache/inmemory/policies.js +4 -4
  16. package/cache/inmemory/policies.js.map +1 -1
  17. package/cache/inmemory/reactiveVars.js +2 -2
  18. package/cache/inmemory/readFromStore.js +5 -5
  19. package/cache/inmemory/readFromStore.js.map +1 -1
  20. package/cache/inmemory/writeToStore.js +9 -9
  21. package/cache/inmemory/writeToStore.js.map +1 -1
  22. package/config/jest/setup.js +1 -1
  23. package/core/ApolloClient.d.ts +0 -1
  24. package/core/ApolloClient.d.ts.map +1 -1
  25. package/core/ApolloClient.js +2 -2
  26. package/core/ApolloClient.js.map +1 -1
  27. package/core/LocalState.js +3 -3
  28. package/core/LocalState.js.map +1 -1
  29. package/core/ObservableQuery.d.ts +0 -1
  30. package/core/ObservableQuery.d.ts.map +1 -1
  31. package/core/ObservableQuery.js +4 -4
  32. package/core/ObservableQuery.js.map +1 -1
  33. package/core/QueryInfo.d.ts +2 -2
  34. package/core/QueryInfo.d.ts.map +1 -1
  35. package/core/QueryInfo.js +2 -2
  36. package/core/QueryManager.d.ts +0 -1
  37. package/core/QueryManager.d.ts.map +1 -1
  38. package/core/QueryManager.js +3 -3
  39. package/core/QueryManager.js.map +1 -1
  40. package/core/core.cjs +10 -10
  41. package/core/core.cjs.map +1 -1
  42. package/core/index.js +2 -2
  43. package/errors/errors.cjs +2 -2
  44. package/errors/errors.cjs.map +1 -1
  45. package/errors/index.js +3 -3
  46. package/errors/index.js.map +1 -1
  47. package/invariantErrorCodes.js +25 -25
  48. package/link/batch/batch.cjs +1 -1
  49. package/link/batch/batch.cjs.map +1 -1
  50. package/link/batch/batchLink.d.ts +0 -1
  51. package/link/batch/batchLink.d.ts.map +1 -1
  52. package/link/batch/batchLink.js +1 -1
  53. package/link/batch/batching.d.ts +0 -1
  54. package/link/batch/batching.d.ts.map +1 -1
  55. package/link/batch/batching.js +2 -2
  56. package/link/batch/batching.js.map +1 -1
  57. package/link/batch-http/batch-http.cjs +1 -1
  58. package/link/batch-http/batch-http.cjs.map +1 -1
  59. package/link/batch-http/batchHttpLink.d.ts +0 -1
  60. package/link/batch-http/batchHttpLink.d.ts.map +1 -1
  61. package/link/batch-http/batchHttpLink.js +3 -3
  62. package/link/batch-http/batchHttpLink.js.map +1 -1
  63. package/link/context/index.js +1 -1
  64. package/link/core/ApolloLink.d.ts +0 -1
  65. package/link/core/ApolloLink.d.ts.map +1 -1
  66. package/link/core/ApolloLink.js +1 -1
  67. package/link/core/types.d.ts +0 -1
  68. package/link/core/types.d.ts.map +1 -1
  69. package/link/error/index.d.ts +0 -1
  70. package/link/error/index.d.ts.map +1 -1
  71. package/link/error/index.js +1 -1
  72. package/link/http/HttpLink.js +1 -1
  73. package/link/http/createHttpLink.js +4 -4
  74. package/link/http/createHttpLink.js.map +1 -1
  75. package/link/http/http.cjs +24 -13
  76. package/link/http/http.cjs.map +1 -1
  77. package/link/http/index.d.ts +1 -1
  78. package/link/http/index.d.ts.map +1 -1
  79. package/link/http/index.js +1 -1
  80. package/link/http/index.js.map +1 -1
  81. package/link/http/parseAndCheckHttpResponse.js +3 -3
  82. package/link/http/parseAndCheckHttpResponse.js.map +1 -1
  83. package/link/http/rewriteURIForGET.js +1 -1
  84. package/link/http/rewriteURIForGET.js.map +1 -1
  85. package/link/http/selectHttpOptionsAndBody.d.ts +5 -1
  86. package/link/http/selectHttpOptionsAndBody.d.ts.map +1 -1
  87. package/link/http/selectHttpOptionsAndBody.js +20 -9
  88. package/link/http/selectHttpOptionsAndBody.js.map +1 -1
  89. package/link/http/serializeFetchParameter.js +1 -1
  90. package/link/http/serializeFetchParameter.js.map +1 -1
  91. package/link/persisted-queries/index.js +2 -2
  92. package/link/retry/retryLink.d.ts +0 -1
  93. package/link/retry/retryLink.d.ts.map +1 -1
  94. package/link/retry/retryLink.js +1 -1
  95. package/link/schema/index.d.ts +0 -1
  96. package/link/schema/index.d.ts.map +1 -1
  97. package/link/schema/index.js +2 -2
  98. package/link/utils/createOperation.js +1 -1
  99. package/link/utils/fromError.d.ts +0 -1
  100. package/link/utils/fromError.d.ts.map +1 -1
  101. package/link/utils/fromPromise.d.ts +0 -1
  102. package/link/utils/fromPromise.d.ts.map +1 -1
  103. package/link/utils/toPromise.d.ts +0 -1
  104. package/link/utils/toPromise.d.ts.map +1 -1
  105. package/link/utils/utils.cjs +1 -1
  106. package/link/utils/utils.cjs.map +1 -1
  107. package/link/utils/validateOperation.js +1 -1
  108. package/link/utils/validateOperation.js.map +1 -1
  109. package/link/ws/index.d.ts +0 -1
  110. package/link/ws/index.d.ts.map +1 -1
  111. package/link/ws/index.js +2 -2
  112. package/main.cjs +4 -4
  113. package/package.json +10 -10
  114. package/react/components/Mutation.js +1 -1
  115. package/react/components/Query.js +2 -2
  116. package/react/components/Subscription.js +1 -1
  117. package/react/components/components.cjs +3 -3
  118. package/react/context/ApolloConsumer.js +1 -1
  119. package/react/context/ApolloContext.js +1 -1
  120. package/react/context/ApolloProvider.js +1 -1
  121. package/react/context/context.cjs +3 -3
  122. package/react/hoc/hoc-utils.js +2 -2
  123. package/react/hoc/hoc.cjs +9 -9
  124. package/react/hoc/hoc.cjs.map +1 -1
  125. package/react/hoc/mutation-hoc.js +5 -5
  126. package/react/hoc/mutation-hoc.js.map +1 -1
  127. package/react/hoc/query-hoc.js +4 -4
  128. package/react/hoc/query-hoc.js.map +1 -1
  129. package/react/hoc/subscription-hoc.js +4 -4
  130. package/react/hoc/subscription-hoc.js.map +1 -1
  131. package/react/hoc/withApollo.js +4 -4
  132. package/react/hoc/withApollo.js.map +1 -1
  133. package/react/hooks/hooks.cjs +70 -51
  134. package/react/hooks/hooks.cjs.map +1 -1
  135. package/react/hooks/useApolloClient.js +1 -1
  136. package/react/hooks/useLazyQuery.js +2 -2
  137. package/react/hooks/useMutation.d.ts.map +1 -1
  138. package/react/hooks/useMutation.js +73 -54
  139. package/react/hooks/useMutation.js.map +1 -1
  140. package/react/hooks/useQuery.js +3 -3
  141. package/react/hooks/useReactiveVar.js +1 -1
  142. package/react/hooks/useSubscription.js +2 -2
  143. package/react/parser/index.js +7 -7
  144. package/react/parser/index.js.map +1 -1
  145. package/react/parser/parser.cjs +7 -7
  146. package/react/parser/parser.cjs.map +1 -1
  147. package/react/react.cjs +2 -2
  148. package/react/ssr/getDataFromTree.js +2 -2
  149. package/react/ssr/ssr.cjs +3 -3
  150. package/react/types/types.d.ts +0 -1
  151. package/react/types/types.d.ts.map +1 -1
  152. package/testing/core/core.cjs +2 -2
  153. package/testing/core/core.cjs.map +1 -1
  154. package/testing/core/mocking/mockFetch.js +3 -3
  155. package/testing/core/mocking/mockFetch.js.map +1 -1
  156. package/testing/core/mocking/mockLink.d.ts +0 -1
  157. package/testing/core/mocking/mockLink.d.ts.map +1 -1
  158. package/testing/core/mocking/mockLink.js +5 -5
  159. package/testing/core/mocking/mockLink.js.map +1 -1
  160. package/testing/core/mocking/mockSubscriptionLink.d.ts +0 -1
  161. package/testing/core/mocking/mockSubscriptionLink.d.ts.map +1 -1
  162. package/testing/core/mocking/mockSubscriptionLink.js +1 -1
  163. package/testing/core/mocking/mockWatchQuery.js +1 -1
  164. package/testing/core/observableToPromise.js +2 -2
  165. package/testing/core/observableToPromise.js.map +1 -1
  166. package/testing/react/MockedProvider.js +2 -2
  167. package/testing/testing.cjs +5 -5
  168. package/utilities/common/makeUniqueId.js +1 -1
  169. package/utilities/common/makeUniqueId.js.map +1 -1
  170. package/utilities/common/mergeDeep.js +1 -1
  171. package/utilities/globals/fix-graphql.js +1 -1
  172. package/utilities/globals/index.js +1 -1
  173. package/utilities/graphql/directives.js +5 -5
  174. package/utilities/graphql/directives.js.map +1 -1
  175. package/utilities/graphql/fragments.js +4 -4
  176. package/utilities/graphql/fragments.js.map +1 -1
  177. package/utilities/graphql/getFromAST.js +2 -2
  178. package/utilities/graphql/getFromAST.js.map +1 -1
  179. package/utilities/graphql/storeUtils.js +5 -5
  180. package/utilities/graphql/storeUtils.js.map +1 -1
  181. package/utilities/graphql/transform.js +2 -2
  182. package/utilities/observables/Concast.d.ts +0 -1
  183. package/utilities/observables/Concast.d.ts.map +1 -1
  184. package/utilities/observables/Concast.js +1 -1
  185. package/utilities/observables/Observable.js +2 -2
  186. package/utilities/observables/asyncMap.d.ts +0 -1
  187. package/utilities/observables/asyncMap.d.ts.map +1 -1
  188. package/utilities/observables/subclassing.d.ts +0 -1
  189. package/utilities/observables/subclassing.d.ts.map +1 -1
  190. package/utilities/policies/pagination.js +2 -2
  191. package/utilities/utilities.cjs +15 -15
  192. package/utilities/utilities.cjs.map +1 -1
  193. package/version.js +1 -1
@@ -1,5 +1,5 @@
1
- import { __assign } from "tslib/tslib.es6.js";
2
- import { print } from "graphql/index.mjs";
1
+ import { __assign, __spreadArray } from "tslib";
2
+ import { print } from 'graphql';
3
3
  ;
4
4
  var defaultHttpOptions = {
5
5
  includeQuery: true,
@@ -18,17 +18,27 @@ export var fallbackHttpConfig = {
18
18
  options: defaultOptions,
19
19
  };
20
20
  export var defaultPrinter = function (ast, printer) { return printer(ast); };
21
- export var selectHttpOptionsAndBody = function (operation, printer, fallbackConfig) {
21
+ export function selectHttpOptionsAndBody(operation, fallbackConfig) {
22
22
  var configs = [];
23
- for (var _i = 3; _i < arguments.length; _i++) {
24
- configs[_i - 3] = arguments[_i];
23
+ for (var _i = 2; _i < arguments.length; _i++) {
24
+ configs[_i - 2] = arguments[_i];
25
25
  }
26
- var options = __assign(__assign({}, fallbackConfig.options), { headers: fallbackConfig.headers, credentials: fallbackConfig.credentials });
27
- var http = fallbackConfig.http || {};
26
+ configs.unshift(fallbackConfig);
27
+ return selectHttpOptionsAndBodyInternal.apply(void 0, __spreadArray([operation,
28
+ defaultPrinter], configs, false));
29
+ }
30
+ export function selectHttpOptionsAndBodyInternal(operation, printer) {
31
+ var configs = [];
32
+ for (var _i = 2; _i < arguments.length; _i++) {
33
+ configs[_i - 2] = arguments[_i];
34
+ }
35
+ var options = {};
36
+ var http = {};
28
37
  configs.forEach(function (config) {
29
38
  options = __assign(__assign(__assign({}, options), config.options), { headers: __assign(__assign({}, options.headers), headersToLowerCase(config.headers)) });
30
- if (config.credentials)
39
+ if (config.credentials) {
31
40
  options.credentials = config.credentials;
41
+ }
32
42
  http = __assign(__assign({}, http), config.http);
33
43
  });
34
44
  var operationName = operation.operationName, extensions = operation.extensions, variables = operation.variables, query = operation.query;
@@ -41,7 +51,8 @@ export var selectHttpOptionsAndBody = function (operation, printer, fallbackConf
41
51
  options: options,
42
52
  body: body,
43
53
  };
44
- };
54
+ }
55
+ ;
45
56
  function headersToLowerCase(headers) {
46
57
  if (headers) {
47
58
  var normalized_1 = Object.create(null);
@@ -1 +1 @@
1
- {"version":3,"file":"selectHttpOptionsAndBody.js","sourceRoot":"","sources":["../../../src/link/http/selectHttpOptionsAndBody.ts"],"names":[],"mappings":";AAAA,OAAO,EAAW,KAAK,EAAE,MAAM,SAAS,CAAC;AAMxC,CAAC;AAoFF,IAAM,kBAAkB,GAAqB;IAC3C,YAAY,EAAE,IAAI;IAClB,iBAAiB,EAAE,KAAK;CACzB,CAAC;AAEF,IAAM,cAAc,GAAG;IAErB,MAAM,EAAE,KAAK;IACb,cAAc,EAAE,kBAAkB;CACnC,CAAC;AAEF,IAAM,cAAc,GAAG;IACrB,MAAM,E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AU,CAAC;IAGlE,IAAI,IAAI,CAAC,YAAY;QAAG,IAAY,CAAC,KAAK,GAAG,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;IAEnE,OAAO;QACL,OAAO,SAAA;QACP,IAAI,MAAA;KACL,CAAC;AACJ,CAAC,CAAC;AAEF,SAAS,kBAAkB,CACzB,OAA2C;IAE3C,IAAI,OAAO,EAAE;QACX,IAAM,YAAU,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;QACvC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,UAAA,IAAI;YACvC,YAAU,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;QACjD,CAAC,CAAC,CAAC;QACH,OAAO,YAAU,CAAC;KACnB;IACD,OAAO,OAAO,CAAC;AACjB,CAAC","sourcesContent":["import { ASTNode, print } from 'graphql';\n\nimport { Operation } from '../core';\n\nexport interface Printer {\n (node: ASTNode, originalPrint: typeof print): string\n};\n\nexport interface UriFunction {\n (operation: Operation): string;\n}\n\nexport interface Body {\n query?: string;\n operationName?: string;\n variables?: Record<string, any>;\n extensions?: Record<string, any>;\n}\n\nexport interface HttpOptions {\n /**\n * The URI to use when fetching operations.\n *\n * Defaults to '/graphql'.\n */\n uri?: string | UriFunction;\n\n /**\n * Passes the extensions field to your graphql server.\n *\n * Defaults to false.\n */\n includeExtensions?: boolean;\n\n /**\n * A `fetch`-compatible API to use when making requests.\n */\n fetch?: WindowOrWorkerGlobalScope['fetch'];\n\n /**\n * An object representing values to be sent as headers on the request.\n */\n headers?: any;\n\n /**\n * The credentials policy you want to use for the fetch call.\n */\n credentials?: string;\n\n /**\n * Any overrides of the fetch options argument to pass to the fetch call.\n */\n fetchOptions?: any;\n\n /**\n * If set to true, use the HTTP GET method for query operations. Mutations\n * will still use the method specified in fetchOptions.method (which defaults\n * to POST).\n */\n useGETForQueries?: boolean;\n\n /**\n * If set to true, the default behavior of stripping unused variables\n * from the request will be disabled.\n *\n * Unused variables are likely to trigger server-side validation errors,\n * per https://spec.graphql.org/draft/#sec-All-Variables-Used, but this\n * includeUnusedVariables option can be useful if your server deviates\n * from the GraphQL specification by not strictly enforcing that rule.\n */\n includeUnusedVariables?: boolean;\n /**\n * A function to substitute for the default query print function. Can be\n * used to apply changes to the results of the print function.\n */\n print?: Printer;\n}\n\nexport interface HttpQueryOptions {\n includeQuery?: boolean;\n includeExtensions?: boolean;\n}\n\nexport interface HttpConfig {\n http?: HttpQueryOptions;\n options?: any;\n headers?: any;\n credentials?: any;\n}\n\nconst defaultHttpOptions: HttpQueryOptions = {\n includeQuery: true,\n includeExtensions: false,\n};\n\nconst defaultHeaders = {\n // headers are case insensitive (https://stackoverflow.com/a/5259004)\n accept: '*/*',\n 'content-type': 'application/json',\n};\n\nconst defaultOptions = {\n method: 'POST',\n};\n\nexport const fallbackHttpConfig = {\n http: defaultHttpOptions,\n headers: defaultHeaders,\n options: defaultOptions,\n};\n\nexport const defaultPrinter: Printer = (ast, printer) => printer(ast);\n\nexport const selectHttpOptionsAndBody = (\n operation: Operation,\n printer: Printer,\n fallbackConfig: HttpConfig,\n ...configs: Array<HttpConfig>\n) => {\n let options: HttpConfig & Record<string, any> = {\n ...fallbackConfig.options,\n headers: fallbackConfig.headers,\n credentials: fallbackConfig.credentials,\n };\n let http: HttpQueryOptions = fallbackConfig.http || {};\n\n /*\n * use the rest of the configs to populate the options\n * configs later in the list will overwrite earlier fields\n */\n configs.forEach(config => {\n options = {\n ...options,\n ...config.options,\n headers: {\n ...options.headers,\n ...headersToLowerCase(config.headers),\n },\n };\n if (config.credentials) options.credentials = config.credentials;\n\n http = {\n ...http,\n ...config.http,\n };\n });\n\n //The body depends on the http options\n const { operationName, extensions, variables, query } = operation;\n const body: Body = { operationName, variables };\n\n if (http.includeExtensions) (body as any).extensions = extensions;\n\n // not sending the query (i.e persisted queries)\n if (http.includeQuery) (body as any).query = printer(query, print);\n\n return {\n options,\n body,\n };\n};\n\nfunction headersToLowerCase(\n headers: Record<string, string> | undefined\n): typeof headers {\n if (headers) {\n const normalized = Object.create(null);\n Object.keys(Object(headers)).forEach(name => {\n normalized[name.toLowerCase()] = headers[name];\n });\n return normalized;\n }\n return headers;\n}\n"]}
1
+ {"version":3,"file":"selectHttpOptionsAndBody.js","sourceRoot":"","sources":["../../../src/link/http/selectHttpOptionsAndBody.ts"],"names":[],"mappings":";AAAA,OAAO,EAAW,KAAK,EAAE,MAAM,SAAS,CAAC;AAMxC,CAAC;AAoFF,IAAM,kBAAkB,GAAqB;IAC3C,YAAY,EAAE,IAAI;IAClB,iBAAiB,EAAE,KAAK;CACzB,CAAC;AAEF,IAAM,cAAc,GAAG;IAErB,MAAM,EAAE,KAAK;IACb,cAAc,EAAE,kBAAkB;CACnC,CAAC;AAEF,IAAM,cAAc,GAAG;IACrB,MAAM,EAAE,MAAM;CACf,CAAC;AAEF,MAAM,CAAC,IAAM,kBAAkB,GAAG;IAChC,IAAI,EAAE,kBAAkB;IACxB,OAAO,EAAE,cAAc;IACvB,OAAO,EAAE,cAAc;CACxB,CAAC;AAEF,MAAM,CAAC,IAAM,cAAc,GAAY,UAAC,GAAG,EAAE,OAAO,IAAK,OAAA,OAAO,CAAC,GAAG,CAAC,EAAZ,CAAY,CAAC;AAEtE,MAAM,UAAU,wBAAwB,CACtC,SAAoB,EACpB,cAA0B;IAC1B,iBAA6B;SAA7B,UAA6B,EAA7B,qBAA6B,EAA7B,IAA6B;QAA7B,gCAA6B;;IAE7B,OAAO,CAAC,OAAO,CAAC,cAAc,CAAC,CAAC;IAChC,OAAO,gCAAgC,8BACrC,SAAS;QACT,cAAc,GACX,OAAO,UACV;AACJ,CAAC;AAED,MAAM,UAAU,gCAAgC,CAC9C,SAAoB,EACpB,OAAgB;IAChB,iBAAwB;SAAxB,UAAwB,EAAxB,qBAAwB,EAAxB,IAAwB;QAAxB,gCAAwB;;IAExB,IAAI,O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AAC;KACnB;IACD,OAAO,OAAO,CAAC;AACjB,CAAC","sourcesContent":["import { ASTNode, print } from 'graphql';\n\nimport { Operation } from '../core';\n\nexport interface Printer {\n (node: ASTNode, originalPrint: typeof print): string\n};\n\nexport interface UriFunction {\n (operation: Operation): string;\n}\n\nexport interface Body {\n query?: string;\n operationName?: string;\n variables?: Record<string, any>;\n extensions?: Record<string, any>;\n}\n\nexport interface HttpOptions {\n /**\n * The URI to use when fetching operations.\n *\n * Defaults to '/graphql'.\n */\n uri?: string | UriFunction;\n\n /**\n * Passes the extensions field to your graphql server.\n *\n * Defaults to false.\n */\n includeExtensions?: boolean;\n\n /**\n * A `fetch`-compatible API to use when making requests.\n */\n fetch?: WindowOrWorkerGlobalScope['fetch'];\n\n /**\n * An object representing values to be sent as headers on the request.\n */\n headers?: any;\n\n /**\n * The credentials policy you want to use for the fetch call.\n */\n credentials?: string;\n\n /**\n * Any overrides of the fetch options argument to pass to the fetch call.\n */\n fetchOptions?: any;\n\n /**\n * If set to true, use the HTTP GET method for query operations. Mutations\n * will still use the method specified in fetchOptions.method (which defaults\n * to POST).\n */\n useGETForQueries?: boolean;\n\n /**\n * If set to true, the default behavior of stripping unused variables\n * from the request will be disabled.\n *\n * Unused variables are likely to trigger server-side validation errors,\n * per https://spec.graphql.org/draft/#sec-All-Variables-Used, but this\n * includeUnusedVariables option can be useful if your server deviates\n * from the GraphQL specification by not strictly enforcing that rule.\n */\n includeUnusedVariables?: boolean;\n /**\n * A function to substitute for the default query print function. Can be\n * used to apply changes to the results of the print function.\n */\n print?: Printer;\n}\n\nexport interface HttpQueryOptions {\n includeQuery?: boolean;\n includeExtensions?: boolean;\n}\n\nexport interface HttpConfig {\n http?: HttpQueryOptions;\n options?: any;\n headers?: any;\n credentials?: any;\n}\n\nconst defaultHttpOptions: HttpQueryOptions = {\n includeQuery: true,\n includeExtensions: false,\n};\n\nconst defaultHeaders = {\n // headers are case insensitive (https://stackoverflow.com/a/5259004)\n accept: '*/*',\n 'content-type': 'application/json',\n};\n\nconst defaultOptions = {\n method: 'POST',\n};\n\nexport const fallbackHttpConfig = {\n http: defaultHttpOptions,\n headers: defaultHeaders,\n options: defaultOptions,\n};\n\nexport const defaultPrinter: Printer = (ast, printer) => printer(ast);\n\nexport function selectHttpOptionsAndBody(\n operation: Operation,\n fallbackConfig: HttpConfig,\n ...configs: Array<HttpConfig>\n) {\n configs.unshift(fallbackConfig);\n return selectHttpOptionsAndBodyInternal(\n operation,\n defaultPrinter,\n ...configs,\n );\n}\n\nexport function selectHttpOptionsAndBodyInternal(\n operation: Operation,\n printer: Printer,\n ...configs: HttpConfig[]\n) {\n let options = {} as HttpConfig & Record<string, any>;\n let http = {} as HttpQueryOptions;\n\n configs.forEach(config => {\n options = {\n ...options,\n ...config.options,\n headers: {\n ...options.headers,\n ...headersToLowerCase(config.headers),\n },\n };\n\n if (config.credentials) {\n options.credentials = config.credentials;\n }\n\n http = {\n ...http,\n ...config.http,\n };\n });\n\n //The body depends on the http options\n const { operationName, extensions, variables, query } = operation;\n const body: Body = { operationName, variables };\n\n if (http.includeExtensions) (body as any).extensions = extensions;\n\n // not sending the query (i.e persisted queries)\n if (http.includeQuery) (body as any).query = printer(query, print);\n\n return {\n options,\n body,\n };\n};\n\nfunction headersToLowerCase(\n headers: Record<string, string> | undefined\n): typeof headers {\n if (headers) {\n const normalized = Object.create(null);\n Object.keys(Object(headers)).forEach(name => {\n normalized[name.toLowerCase()] = headers[name];\n });\n return normalized;\n }\n return headers;\n}\n"]}
@@ -5,7 +5,7 @@ export var serializeFetchParameter = function (p, label) {
5
5
  serialized = JSON.stringify(p);
6
6
  }
7
7
  catch (e) {
8
- var parseError = __DEV__ ? new InvariantError("Network request failed. " + label + " is not serializable: " + e.message) : new InvariantError(21);
8
+ var parseError = __DEV__ ? new InvariantError("Network request failed. ".concat(label, " is not serializable: ").concat(e.message)) : new InvariantError(21);
9
9
  parseError.parseError = e;
10
10
  throw parseError;
11
11
  }
@@ -1 +1 @@
1
- {"version":3,"file":"serializeFetchParameter.js","sourceRoot":"","sources":["../../../src/link/http/serializeFetchParameter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAMzD,MAAM,CAAC,IAAM,uBAAuB,GAAG,UAAC,CAAM,EAAE,KAAa;IAC3D,IAAI,UAAU,CAAC;IACf,IAAI;QACF,UAAU,GAAG,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;KAChC;IAAC,OAAO,CAAC,EAAE;QACV,IAAM,UAAU,GAAG,IAAI,cAAc,CACnC,6BAA2B,KAAK,8BAAyB,CAAC,CAAC,OAAS,CACjD,CAAC;QACtB,UAAU,CAAC,UAAU,GAAG,CAAC,CAAC;QAC1B,MAAM,UAAU,CAAC;KAClB;IACD,OAAO,UAAU,CAAC;AACpB,CAAC,CAAC","sourcesContent":["import { InvariantError } from '../../utilities/globals';\n\nexport type ClientParseError = InvariantError & {\n parseError: Error;\n};\n\nexport const serializeFetchParameter = (p: any, label: string) => {\n let serialized;\n try {\n serialized = JSON.stringify(p);\n } catch (e) {\n const parseError = new InvariantError(\n `Network request failed. ${label} is not serializable: ${e.message}`,\n ) as ClientParseError;\n parseError.parseError = e;\n throw parseError;\n }\n return serialized;\n};\n"]}
1
+ {"version":3,"file":"serializeFetchParameter.js","sourceRoot":"","sources":["../../../src/link/http/serializeFetchParameter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAMzD,MAAM,CAAC,IAAM,uBAAuB,GAAG,UAAC,CAAM,EAAE,KAAa;IAC3D,IAAI,UAAU,CAAC;IACf,IAAI;QACF,UAAU,GAAG,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;KAChC;IAAC,OAAO,CAAC,EAAE;QACV,IAAM,UAAU,GAAG,IAAI,cAAc,CACnC,kCAA2B,KAAK,mCAAyB,CAAC,CAAC,OAAO,CAAE,CACjD,CAAC;QACtB,UAAU,CAAC,UAAU,GAAG,CAAC,CAAC;QAC1B,MAAM,UAAU,CAAC;KAClB;IACD,OAAO,UAAU,CAAC;AACpB,CAAC,CAAC","sourcesContent":["import { InvariantError } from '../../utilities/globals';\n\nexport type ClientParseError = InvariantError & {\n parseError: Error;\n};\n\nexport const serializeFetchParameter = (p: any, label: string) => {\n let serialized;\n try {\n serialized = JSON.stringify(p);\n } catch (e) {\n const parseError = new InvariantError(\n `Network request failed. ${label} is not serializable: ${e.message}`,\n ) as ClientParseError;\n parseError.parseError = e;\n throw parseError;\n }\n return serialized;\n};\n"]}
@@ -1,6 +1,6 @@
1
- import { __assign } from "tslib/tslib.es6.js";
1
+ import { __assign } from "tslib";
2
2
  import { invariant } from "../../utilities/globals/index.js";
3
- import { print } from "graphql/index.mjs";
3
+ import { print } from 'graphql';
4
4
  import { ApolloLink } from "../core/index.js";
5
5
  import { Observable, compact, } from "../../utilities/index.js";
6
6
  export var VERSION = 1;
@@ -1,4 +1,3 @@
1
- /// <reference types="zen-observable" />
2
1
  import { ApolloLink, Operation, FetchResult, NextLink } from '../core';
3
2
  import { Observable } from '../../utilities';
4
3
  import { DelayFunction, DelayFunctionOptions } from './delayFunction';
@@ -1 +1 @@
1
- {"version":3,"file":"retryLink.d.ts","sourceRoot":"","sources":["../../../src/link/retry/retryLink.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACvE,OAAO,EAAE,UAAU,EAAoC,MAAM,iBAAiB,CAAC;AAC/E,OAAO,EACL,aAAa,EACb,oBAAoB,EAErB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,aAAa,EACb,oBAAoB,EAErB,MAAM,iBAAiB,CAAC;AAEzB,yBAAiB,SAAS,CAAC;IACzB,UAAiB,OAAO;QAItB,KAAK,CAAC,EAAE,oBAAoB,GAAG,aAAa,CAAC;QAK7C,QAAQ,CAAC,EAAE,oBAAoB,GAAG,aAAa,CAAC;KACjD;CACF;AAsJD,qBAAa,SAAU,SAAQ,UAAU;IACvC,OAAO,CAAC,QAAQ,CAAgB;IAChC,OAAO,CAAC,OAAO,CAAgB;gBAEnB,OAAO,CAAC,EAAE,SAAS,CAAC,OAAO;IAShC,OAAO,CACZ,SAAS,EAAE,SAAS,EACpB,QAAQ,EAAE,QAAQ,GACjB,UAAU,CAAC,WAAW,CAAC;CAgB3B"}
1
+ {"version":3,"file":"retryLink.d.ts","sourceRoot":"","sources":["../../../src/link/retry/retryLink.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACvE,OAAO,EAAE,UAAU,EAAoC,MAAM,iBAAiB,CAAC;AAC/E,OAAO,EACL,aAAa,EACb,oBAAoB,EAErB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,aAAa,EACb,oBAAoB,EAErB,MAAM,iBAAiB,CAAC;AAEzB,yBAAiB,SAAS,CAAC;IACzB,UAAiB,OAAO;QAItB,KAAK,CAAC,EAAE,oBAAoB,GAAG,aAAa,CAAC;QAK7C,QAAQ,CAAC,EAAE,oBAAoB,GAAG,aAAa,CAAC;KACjD;CACF;AAsJD,qBAAa,SAAU,SAAQ,UAAU;IACvC,OAAO,CAAC,QAAQ,CAAgB;IAChC,OAAO,CAAC,OAAO,CAAgB;gBAEnB,OAAO,CAAC,EAAE,SAAS,CAAC,OAAO;IAShC,OAAO,CACZ,SAAS,EAAE,SAAS,EACpB,QAAQ,EAAE,QAAQ,GACjB,UAAU,CAAC,WAAW,CAAC;CAgB3B"}
@@ -1,4 +1,4 @@
1
- import { __awaiter, __extends, __generator } from "tslib/tslib.es6.js";
1
+ import { __awaiter, __extends, __generator } from "tslib";
2
2
  import { ApolloLink } from "../core/index.js";
3
3
  import { Observable } from "../../utilities/index.js";
4
4
  import { buildDelayFunction, } from "./delayFunction.js";
@@ -1,4 +1,3 @@
1
- /// <reference types="zen-observable" />
2
1
  import { GraphQLSchema } from 'graphql';
3
2
  import { ApolloLink, Operation, FetchResult } from '../core';
4
3
  import { Observable } from '../../utilities';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/link/schema/index.ts"],"names":[],"mappings":";AAAA,OAAO,EAAqB,aAAa,EAAE,MAAM,SAAS,CAAC;AAE3D,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAC7D,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAE7C,yBAAiB,UAAU,CAAC;IAC1B,KAAY,eAAe,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAClD,KAAY,uBAAuB,GAAG,CACpC,SAAS,EAAE,SAAS,KACjB,eAAe,GAAG,WAAW,CAAC,eAAe,CAAC,CAAC;IAEpD,UAAiB,OAAO;QAItB,MAAM,EAAE,aAAa,CAAC;QAKtB,SAAS,CAAC,EAAE,GAAG,CAAC;QAKhB,OAAO,CAAC,EAAE,eAAe,GAAG,uBAAuB,CAAC;QAMpD,QAAQ,CAAC,EAAE,OAAO,CAAC;KACpB;CACF;AAED,qBAAa,UAAW,SAAQ,UAAU;IACjC,MAAM,EAAE,UAAU,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;IACrC,SAAS,EAAE,UAAU,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC;IAC3C,OAAO,EAAE,UAAU,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IACvC,QAAQ,EAAE,OAAO,CAAC;gBAEb,OAAO,EAAE,UAAU,CAAC,OAAO;IAQhC,OAAO,CAAC,SAAS,EAAE,SAAS,GAAG,UAAU,CAAC,WAAW,CAAC;CAoC9D"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/link/schema/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqB,aAAa,EAAE,MAAM,SAAS,CAAC;AAE3D,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAC7D,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAE7C,yBAAiB,UAAU,CAAC;IAC1B,KAAY,eAAe,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAClD,KAAY,uBAAuB,GAAG,CACpC,SAAS,EAAE,SAAS,KACjB,eAAe,GAAG,WAAW,CAAC,eAAe,CAAC,CAAC;IAEpD,UAAiB,OAAO;QAItB,MAAM,EAAE,aAAa,CAAC;QAKtB,SAAS,CAAC,EAAE,GAAG,CAAC;QAKhB,OAAO,CAAC,EAAE,eAAe,GAAG,uBAAuB,CAAC;QAMpD,QAAQ,CAAC,EAAE,OAAO,CAAC;KACpB;CACF;AAED,qBAAa,UAAW,SAAQ,UAAU;IACjC,MAAM,EAAE,UAAU,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;IACrC,SAAS,EAAE,UAAU,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC;IAC3C,OAAO,EAAE,UAAU,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IACvC,QAAQ,EAAE,OAAO,CAAC;gBAEb,OAAO,EAAE,UAAU,CAAC,OAAO;IAQhC,OAAO,CAAC,SAAS,EAAE,SAAS,GAAG,UAAU,CAAC,WAAW,CAAC;CAoC9D"}
@@ -1,5 +1,5 @@
1
- import { __extends } from "tslib/tslib.es6.js";
2
- import { validate, execute } from "graphql/index.mjs";
1
+ import { __extends } from "tslib";
2
+ import { validate, execute } from 'graphql';
3
3
  import { ApolloLink } from "../core/index.js";
4
4
  import { Observable } from "../../utilities/index.js";
5
5
  var SchemaLink = (function (_super) {
@@ -1,4 +1,4 @@
1
- import { __assign } from "tslib/tslib.es6.js";
1
+ import { __assign } from "tslib";
2
2
  export function createOperation(starting, operation) {
3
3
  var context = __assign({}, starting);
4
4
  var setContext = function (next) {
@@ -1,4 +1,3 @@
1
- /// <reference types="zen-observable" />
2
1
  import { Observable } from '../../utilities';
3
2
  export declare function fromError<T>(errorValue: any): Observable<T>;
4
3
  //# sourceMappingURL=fromError.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"fromError.d.ts","sourceRoot":"","sources":["../../../src/link/utils/fromError.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAE7C,wBAAgB,SAAS,CAAC,CAAC,EAAE,UAAU,EAAE,GAAG,GAAG,UAAU,CAAC,CAAC,CAAC,CAI3D"}
1
+ {"version":3,"file":"fromError.d.ts","sourceRoot":"","sources":["../../../src/link/utils/fromError.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAE7C,wBAAgB,SAAS,CAAC,CAAC,EAAE,UAAU,EAAE,GAAG,GAAG,UAAU,CAAC,CAAC,CAAC,CAI3D"}
@@ -1,4 +1,3 @@
1
- /// <reference types="zen-observable" />
2
1
  import { Observable } from '../../utilities';
3
2
  export declare function fromPromise<T>(promise: Promise<T>): Observable<T>;
4
3
  //# sourceMappingURL=fromPromise.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"fromPromise.d.ts","sourceRoot":"","sources":["../../../src/link/utils/fromPromise.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAE7C,wBAAgB,WAAW,CAAC,CAAC,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,GAAG,UAAU,CAAC,CAAC,CAAC,CASjE"}
1
+ {"version":3,"file":"fromPromise.d.ts","sourceRoot":"","sources":["../../../src/link/utils/fromPromise.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAE7C,wBAAgB,WAAW,CAAC,CAAC,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,GAAG,UAAU,CAAC,CAAC,CAAC,CASjE"}
@@ -1,4 +1,3 @@
1
- /// <reference types="zen-observable" />
2
1
  import { Observable } from '../../utilities';
3
2
  export declare function toPromise<R>(observable: Observable<R>): Promise<R>;
4
3
  //# sourceMappingURL=toPromise.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"toPromise.d.ts","sourceRoot":"","sources":["../../../src/link/utils/toPromise.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAE7C,wBAAgB,SAAS,CAAC,CAAC,EAAE,UAAU,EAAE,UAAU,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAiBlE"}
1
+ {"version":3,"file":"toPromise.d.ts","sourceRoot":"","sources":["../../../src/link/utils/toPromise.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAE7C,wBAAgB,SAAS,CAAC,CAAC,EAAE,UAAU,EAAE,UAAU,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAiBlE"}
@@ -61,7 +61,7 @@ function validateOperation(operation) {
61
61
  for (var _i = 0, _a = Object.keys(operation); _i < _a.length; _i++) {
62
62
  var key = _a[_i];
63
63
  if (OPERATION_FIELDS.indexOf(key) < 0) {
64
- throw __DEV__ ? new globals.InvariantError("illegal argument: " + key) : new globals.InvariantError(24);
64
+ throw __DEV__ ? new globals.InvariantError("illegal argument: ".concat(key)) : new globals.InvariantError(24);
65
65
  }
66
66
  }
67
67
  return operation;
@@ -1 +1 @@
1
- {"version":3,"file":"utils.cjs","sources":["fromError.js","toPromise.js","fromPromise.js","throwServerError.js","validateOperation.js","createOperation.js","transformOperation.js"],"sourcesContent":["import { Observable } from '../../utilities';\nexport function fromError(errorValue) {\n return new Observable(function (observer) {\n observer.error(errorValue);\n });\n}\n//# sourceMappingURL=fromError.js.map","import { invariant } from '../../utilities/globals';\nexport function toPromise(observable) {\n var completed = false;\n return new Promise(function (resolve, reject) {\n observable.subscribe({\n next: function (data) {\n if (completed) {\n __DEV__ && invariant.warn(\"Promise Wrapper does not support multiple results from Observable\");\n }\n else {\n completed = true;\n resolve(data);\n }\n },\n error: reject,\n });\n });\n}\n//# sourceMappingURL=toPromise.js.map","import { Observable } from '../../utilities';\nexport function fromPromise(promise) {\n return new Observable(function (observer) {\n promise\n .then(function (value) {\n observer.next(value);\n observer.complete();\n })\n .catch(observer.error.bind(observer));\n });\n}\n//# sourceMappingURL=fromPromise.js.map","export var throwServerError = function (response, result, message) {\n var error = new Error(message);\n error.name = 'ServerError';\n error.response = response;\n error.statusCode = response.status;\n error.result = result;\n throw error;\n};\n//# sourceMappingURL=throwServerError.js.map","import { InvariantError } from '../../utilities/globals';\nexport function validateOperation(operation) {\n var OPERATION_FIELDS = [\n 'query',\n 'operationName',\n 'variables',\n 'extensions',\n 'context',\n ];\n for (var _i = 0, _a = Object.keys(operation); _i < _a.length; _i++) {\n var key = _a[_i];\n if (OPERATION_FIELDS.indexOf(key) < 0) {\n throw __DEV__ ? new InvariantError(\"illegal argument: \" + key) : new InvariantError(24);\n }\n }\n return operation;\n}\n//# sourceMappingURL=validateOperation.js.map","import { __assign } from \"tslib\";\nexport function createOperation(starting, operation) {\n var context = __assign({}, starting);\n var setContext = function (next) {\n if (typeof next === 'function') {\n context = __assign(__assign({}, context), next(context));\n }\n else {\n context = __assign(__assign({}, context), next);\n }\n };\n var getContext = function () { return (__assign({}, context)); };\n Object.defineProperty(operation, 'setContext', {\n enumerable: false,\n value: setContext,\n });\n Object.defineProperty(operation, 'getContext', {\n enumerable: false,\n value: getContext,\n });\n return operation;\n}\n//# sourceMappingURL=createOperation.js.map","import { getOperationName } from '../../utilities';\nexport function transformOperation(operation) {\n var transformedOperation = {\n variables: operation.variables || {},\n extensions: operation.extensions || {},\n operationName: operation.operationName,\n query: operation.query,\n };\n if (!transformedOperation.operationName) {\n transformedOperation.operationName =\n typeof transformedOperation.query !== 'string'\n ? getOperationName(transformedOperation.query) || undefined\n : '';\n }\n return transformedOperation;\n}\n//# sourceMappingURL=transformOperation.js.map"],"names":["Observable","invariant","InvariantError","__assign","getOperationName"],"mappings":";;;;;;;;AACO,SAAS,SAAS,CAAC,UAAU,EAAE;AACtC,IAAI,OAAO,IAAIA,oBAAU,CAAC,UAAU,QAAQ,EAAE;AAC9C,QAAQ,QAAQ,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;AACnC,KAAK,CAAC,CAAC;AACP;;ACJO,SAAS,SAAS,CAAC,UAAU,EAAE;AACtC,IAAI,IAAI,SAAS,GAAG,KAAK,CAAC;AAC1B,IAAI,OAAO,IAAI,OAAO,CAAC,UAAU,OAAO,EAAE,MAAM,EAAE;AAClD,QAAQ,UAAU,CAAC,SAAS,CAAC;AAC7B,YAAY,IAAI,EAAE,UAAU,IAAI,EAAE;AAClC,gBAAgB,IAAI,SAAS,EAAE;AAC/B,oBAAoB,OAAO,IAAIC,iBAAS,CAAC,IAAI,CAAC,mEAAmE,CAAC,CAAC;AACnH,iBAAiB;AACjB,qBAAqB;AACrB,oBAAoB,SAAS,GAAG,IAAI,CAAC;AACrC,oBAAoB,OAAO,CAAC,IAAI,CAAC,CAAC;AAClC,iBAAiB;AACjB,aAAa;AACb,YAAY,KAAK,EAAE,MAAM;AACzB,SAAS,CAAC,CAAC;AACX,KAAK,CAAC,CAAC;AACP;;AChBO,SAAS,WAAW,CAAC,OAAO,EAAE;AACrC,IAAI,OAAO,IAAID,oBAAU,CAAC,UAAU,QAAQ,EAAE;AAC9C,QAAQ,OAAO;AACf,aAAa,IAAI,CAAC,UAAU,KAAK,EAAE;AACnC,YAAY,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AACjC,YAAY,QAAQ,CAAC,QAAQ,EAAE,CAAC;AAChC,SAAS,CAAC;AACV,aAAa,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC;AAClD,KAAK,CAAC,CAAC;AACP;;ACVU,IAAC,gBAAgB,GAA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AAE,CAAC;AACrB,KAAK;AACL,IAAI,OAAO,oBAAoB,CAAC;AAChC;;;;;;;;;;"}
1
+ {"version":3,"file":"utils.cjs","sources":["fromError.js","toPromise.js","fromPromise.js","throwServerError.js","validateOperation.js","createOperation.js","transformOperation.js"],"sourcesContent":["import { Observable } from '../../utilities';\nexport function fromError(errorValue) {\n return new Observable(function (observer) {\n observer.error(errorValue);\n });\n}\n//# sourceMappingURL=fromError.js.map","import { invariant } from '../../utilities/globals';\nexport function toPromise(observable) {\n var completed = false;\n return new Promise(function (resolve, reject) {\n observable.subscribe({\n next: function (data) {\n if (completed) {\n __DEV__ && invariant.warn(\"Promise Wrapper does not support multiple results from Observable\");\n }\n else {\n completed = true;\n resolve(data);\n }\n },\n error: reject,\n });\n });\n}\n//# sourceMappingURL=toPromise.js.map","import { Observable } from '../../utilities';\nexport function fromPromise(promise) {\n return new Observable(function (observer) {\n promise\n .then(function (value) {\n observer.next(value);\n observer.complete();\n })\n .catch(observer.error.bind(observer));\n });\n}\n//# sourceMappingURL=fromPromise.js.map","export var throwServerError = function (response, result, message) {\n var error = new Error(message);\n error.name = 'ServerError';\n error.response = response;\n error.statusCode = response.status;\n error.result = result;\n throw error;\n};\n//# sourceMappingURL=throwServerError.js.map","import { InvariantError } from '../../utilities/globals';\nexport function validateOperation(operation) {\n var OPERATION_FIELDS = [\n 'query',\n 'operationName',\n 'variables',\n 'extensions',\n 'context',\n ];\n for (var _i = 0, _a = Object.keys(operation); _i < _a.length; _i++) {\n var key = _a[_i];\n if (OPERATION_FIELDS.indexOf(key) < 0) {\n throw __DEV__ ? new InvariantError(\"illegal argument: \".concat(key)) : new InvariantError(24);\n }\n }\n return operation;\n}\n//# sourceMappingURL=validateOperation.js.map","import { __assign } from \"tslib\";\nexport function createOperation(starting, operation) {\n var context = __assign({}, starting);\n var setContext = function (next) {\n if (typeof next === 'function') {\n context = __assign(__assign({}, context), next(context));\n }\n else {\n context = __assign(__assign({}, context), next);\n }\n };\n var getContext = function () { return (__assign({}, context)); };\n Object.defineProperty(operation, 'setContext', {\n enumerable: false,\n value: setContext,\n });\n Object.defineProperty(operation, 'getContext', {\n enumerable: false,\n value: getContext,\n });\n return operation;\n}\n//# sourceMappingURL=createOperation.js.map","import { getOperationName } from '../../utilities';\nexport function transformOperation(operation) {\n var transformedOperation = {\n variables: operation.variables || {},\n extensions: operation.extensions || {},\n operationName: operation.operationName,\n query: operation.query,\n };\n if (!transformedOperation.operationName) {\n transformedOperation.operationName =\n typeof transformedOperation.query !== 'string'\n ? getOperationName(transformedOperation.query) || undefined\n : '';\n }\n return transformedOperation;\n}\n//# sourceMappingURL=transformOperation.js.map"],"names":["Observable","invariant","InvariantError","__assign","getOperationName"],"mappings":";;;;;;;;AACO,SAAS,SAAS,CAAC,UAAU,EAAE;AACtC,IAAI,OAAO,IAAIA,oBAAU,CAAC,UAAU,QAAQ,EAAE;AAC9C,QAAQ,QAAQ,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;AACnC,KAAK,CAAC,CAAC;AACP;;ACJO,SAAS,SAAS,CAAC,UAAU,EAAE;AACtC,IAAI,IAAI,SAAS,GAAG,KAAK,CAAC;AAC1B,IAAI,OAAO,IAAI,OAAO,CAAC,UAAU,OAAO,EAAE,MAAM,EAAE;AAClD,QAAQ,UAAU,CAAC,SAAS,CAAC;AAC7B,YAAY,IAAI,EAAE,UAAU,IAAI,EAAE;AAClC,gBAAgB,IAAI,SAAS,EAAE;AAC/B,oBAAoB,OAAO,IAAIC,iBAAS,CAAC,IAAI,CAAC,mEAAmE,CAAC,CAAC;AACnH,iBAAiB;AACjB,qBAAqB;AACrB,oBAAoB,SAAS,GAAG,IAAI,CAAC;AACrC,oBAAoB,OAAO,CAAC,IAAI,CAAC,CAAC;AAClC,iBAAiB;AACjB,aAAa;AACb,YAAY,KAAK,EAAE,MAAM;AACzB,SAAS,CAAC,CAAC;AACX,KAAK,CAAC,CAAC;AACP;;AChBO,SAAS,WAAW,CAAC,OAAO,EAAE;AACrC,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AAC5C,QAAQ,UAAU,EAAE,SAAS,CAAC,UAAU,IAAI,EAAE;AAC9C,QAAQ,aAAa,EAAE,SAAS,CAAC,aAAa;AAC9C,QAAQ,KAAK,EAAE,SAAS,CAAC,KAAK;AAC9B,KAAK,CAAC;AACN,IAAI,IAAI,CAAC,oBAAoB,CAAC,aAAa,EAAE;AAC7C,QAAQ,oBAAoB,CAAC,aAAa;AAC1C,YAAY,OAAO,oBAAoB,CAAC,KAAK,KAAK,QAAQ;AAC1D,kBAAkBC,0BAAgB,CAAC,oBAAoB,CAAC,KAAK,CAAC,IAAI,SAAS;AAC3E,kBAAkB,EAAE,CAAC;AACrB,KAAK;AACL,IAAI,OAAO,oBAAoB,CAAC;AAChC;;;;;;;;;;"}
@@ -10,7 +10,7 @@ export function validateOperation(operation) {
10
10
  for (var _i = 0, _a = Object.keys(operation); _i < _a.length; _i++) {
11
11
  var key = _a[_i];
12
12
  if (OPERATION_FIELDS.indexOf(key) < 0) {
13
- throw __DEV__ ? new InvariantError("illegal argument: " + key) : new InvariantError(24);
13
+ throw __DEV__ ? new InvariantError("illegal argument: ".concat(key)) : new InvariantError(24);
14
14
  }
15
15
  }
16
16
  return operation;
@@ -1 +1 @@
1
- {"version":3,"file":"validateOperation.js","sourceRoot":"","sources":["../../../src/link/utils/validateOperation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAA;AAGxD,MAAM,UAAU,iBAAiB,CAAC,SAAyB;IACzD,IAAM,gBAAgB,GAAG;QACvB,OAAO;QACP,eAAe;QACf,WAAW;QACX,YAAY;QACZ,SAAS;KACV,CAAC;IACF,KAAgB,UAAsB,EAAtB,KAAA,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,EAAtB,cAAsB,EAAtB,IAAsB,EAAE;QAAnC,IAAI,GAAG,SAAA;QACV,IAAI,gBAAgB,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE;YACrC,MAAM,IAAI,cAAc,CAAC,uBAAqB,GAAK,CAAC,CAAC;SACtD;KACF;IAED,OAAO,SAAS,CAAC;AACnB,CAAC","sourcesContent":["import { InvariantError } from '../../utilities/globals'\nimport { GraphQLRequest } from '../core';\n\nexport function validateOperation(operation: GraphQLRequest): GraphQLRequest {\n const OPERATION_FIELDS = [\n 'query',\n 'operationName',\n 'variables',\n 'extensions',\n 'context',\n ];\n for (let key of Object.keys(operation)) {\n if (OPERATION_FIELDS.indexOf(key) < 0) {\n throw new InvariantError(`illegal argument: ${key}`);\n }\n }\n\n return operation;\n}\n"]}
1
+ {"version":3,"file":"validateOperation.js","sourceRoot":"","sources":["../../../src/link/utils/validateOperation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAA;AAGxD,MAAM,UAAU,iBAAiB,CAAC,SAAyB;IACzD,IAAM,gBAAgB,GAAG;QACvB,OAAO;QACP,eAAe;QACf,WAAW;QACX,YAAY;QACZ,SAAS;KACV,CAAC;IACF,KAAgB,UAAsB,EAAtB,KAAA,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,EAAtB,cAAsB,EAAtB,IAAsB,EAAE;QAAnC,IAAI,GAAG,SAAA;QACV,IAAI,gBAAgB,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE;YACrC,MAAM,IAAI,cAAc,CAAC,4BAAqB,GAAG,CAAE,CAAC,CAAC;SACtD;KACF;IAED,OAAO,SAAS,CAAC;AACnB,CAAC","sourcesContent":["import { InvariantError } from '../../utilities/globals'\nimport { GraphQLRequest } from '../core';\n\nexport function validateOperation(operation: GraphQLRequest): GraphQLRequest {\n const OPERATION_FIELDS = [\n 'query',\n 'operationName',\n 'variables',\n 'extensions',\n 'context',\n ];\n for (let key of Object.keys(operation)) {\n if (OPERATION_FIELDS.indexOf(key) < 0) {\n throw new InvariantError(`illegal argument: ${key}`);\n }\n }\n\n return operation;\n}\n"]}
@@ -1,4 +1,3 @@
1
- /// <reference types="zen-observable" />
2
1
  import { SubscriptionClient, ClientOptions } from 'subscriptions-transport-ws';
3
2
  import { ApolloLink, Operation, FetchResult } from '../core';
4
3
  import { Observable } from '../../utilities';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/link/ws/index.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,kBAAkB,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAE/E,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAC7D,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAE7C,yBAAiB,aAAa,CAAC;IAI7B,UAAiB,aAAa;QAI5B,GAAG,EAAE,MAAM,CAAC;QAKZ,OAAO,CAAC,EAAE,aAAa,CAAC;QAKxB,aAAa,CAAC,EAAE,GAAG,CAAC;KACrB;CACF;AAGD,MAAM,QAAQ,eAAe,GAAG,aAAa,CAAC,aAAa,CAAC;AAE5D,qBAAa,aAAc,SAAQ,UAAU;IAC3C,OAAO,CAAC,kBAAkB,CAAqB;gBAG7C,cAAc,EAAE,aAAa,CAAC,aAAa,GAAG,kBAAkB;IAe3D,OAAO,CAAC,SAAS,EAAE,SAAS,GAAG,UAAU,CAAC,WAAW,CAAC,GAAG,IAAI;CAKrE"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/link/ws/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAE/E,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAC7D,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAE7C,yBAAiB,aAAa,CAAC;IAI7B,UAAiB,aAAa;QAI5B,GAAG,EAAE,MAAM,CAAC;QAKZ,OAAO,CAAC,EAAE,aAAa,CAAC;QAKxB,aAAa,CAAC,EAAE,GAAG,CAAC;KACrB;CACF;AAGD,MAAM,QAAQ,eAAe,GAAG,aAAa,CAAC,aAAa,CAAC;AAE5D,qBAAa,aAAc,SAAQ,UAAU;IAC3C,OAAO,CAAC,kBAAkB,CAAqB;gBAG7C,cAAc,EAAE,aAAa,CAAC,aAAa,GAAG,kBAAkB;IAe3D,OAAO,CAAC,SAAS,EAAE,SAAS,GAAG,UAAU,CAAC,WAAW,CAAC,GAAG,IAAI;CAKrE"}
package/link/ws/index.js CHANGED
@@ -1,5 +1,5 @@
1
- import { __extends } from "tslib/tslib.es6.js";
2
- import { SubscriptionClient } from "subscriptions-transport-ws/dist/index.js";
1
+ import { __extends } from "tslib";
2
+ import { SubscriptionClient } from 'subscriptions-transport-ws';
3
3
  import { ApolloLink } from "../core/index.js";
4
4
  var WebSocketLink = (function (_super) {
5
5
  __extends(WebSocketLink, _super);
package/main.cjs CHANGED
@@ -7,10 +7,10 @@ var react = require('./react');
7
7
 
8
8
 
9
9
 
10
- Object.keys(core).forEach(function (k) {
10
+ for (var k in core) {
11
11
  if (k !== 'default' && !exports.hasOwnProperty(k)) exports[k] = core[k];
12
- });
13
- Object.keys(react).forEach(function (k) {
12
+ }
13
+ for (var k in react) {
14
14
  if (k !== 'default' && !exports.hasOwnProperty(k)) exports[k] = react[k];
15
- });
15
+ }
16
16
  //# sourceMappingURL=main.cjs.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@apollo/client",
3
- "version": "3.5.1",
3
+ "version": "3.5.5",
4
4
  "description": "A fully-featured caching GraphQL client.",
5
5
  "private": false,
6
6
  "keywords": [
@@ -56,18 +56,18 @@
56
56
  "zen-observable-ts": "^1.2.0"
57
57
  },
58
58
  "devDependencies": {
59
- "@babel/parser": "7.16.2",
59
+ "@babel/parser": "7.16.4",
60
60
  "@graphql-tools/schema": "8.3.1",
61
61
  "@rollup/plugin-node-resolve": "11.2.1",
62
- "@testing-library/react": "9.5.0",
62
+ "@testing-library/react": "12.1.2",
63
63
  "@testing-library/react-hooks": "7.0.2",
64
64
  "@types/fast-json-stable-stringify": "2.0.0",
65
65
  "@types/fetch-mock": "7.3.5",
66
66
  "@types/glob": "7.2.0",
67
67
  "@types/hoist-non-react-statics": "3.3.1",
68
- "@types/jest": "27.0.2",
69
- "@types/lodash": "4.14.176",
70
- "@types/node": "16.11.6",
68
+ "@types/jest": "27.0.3",
69
+ "@types/lodash": "4.14.177",
70
+ "@types/node": "16.11.9",
71
71
  "@types/react": "17.0.34",
72
72
  "@types/react-dom": "17.0.2",
73
73
  "bundlesize": "0.18.1",
@@ -75,7 +75,7 @@
75
75
  "crypto-hash": "1.3.0",
76
76
  "fetch-mock": "9.11.0",
77
77
  "glob": "7.2.0",
78
- "graphql": "^16.0.0",
78
+ "graphql": "16.0.1",
79
79
  "jest": "27.3.1",
80
80
  "jest-fetch-mock": "3.0.3",
81
81
  "jest-junit": "13.0.0",
@@ -85,14 +85,14 @@
85
85
  "recast": "0.20.5",
86
86
  "resolve": "1.20.0",
87
87
  "rimraf": "3.0.2",
88
- "rollup": "2.50.5",
88
+ "rollup": "2.60.0",
89
89
  "rollup-plugin-terser": "7.0.2",
90
90
  "rxjs": "6.6.7",
91
91
  "subscriptions-transport-ws": "0.11.0",
92
- "terser": "5.9.0",
92
+ "terser": "5.10.0",
93
93
  "ts-jest": "27.0.7",
94
94
  "ts-node": "10.4.0",
95
- "typescript": "4.4.4",
95
+ "typescript": "4.5.2",
96
96
  "wait-for-observables": "1.0.3",
97
97
  "whatwg-fetch": "3.6.2"
98
98
  },
@@ -1,4 +1,4 @@
1
- import * as PropTypes from "prop-types/index.js";
1
+ import * as PropTypes from 'prop-types';
2
2
  import { useMutation } from "../hooks/index.js";
3
3
  export function Mutation(props) {
4
4
  var _a = useMutation(props.mutation, props), runMutation = _a[0], result = _a[1];
@@ -1,5 +1,5 @@
1
- import { __rest } from "tslib/tslib.es6.js";
2
- import * as PropTypes from "prop-types/index.js";
1
+ import { __rest } from "tslib";
2
+ import * as PropTypes from 'prop-types';
3
3
  import { useQuery } from "../hooks/index.js";
4
4
  export function Query(props) {
5
5
  var children = props.children, query = props.query, options = __rest(props, ["children", "query"]);
@@ -1,4 +1,4 @@
1
- import * as PropTypes from "prop-types/index.js";
1
+ import * as PropTypes from 'prop-types';
2
2
  import { useSubscription } from "../hooks/index.js";
3
3
  export function Subscription(props) {
4
4
  var result = useSubscription(props.subscription, props);
@@ -10,11 +10,11 @@ function _interopNamespace(e) {
10
10
  if (e && e.__esModule) return e;
11
11
  var n = Object.create(null);
12
12
  if (e) {
13
- Object.keys(e).forEach(function (k) {
13
+ for (var k in e) {
14
14
  n[k] = e[k];
15
- });
15
+ }
16
16
  }
17
- n['default'] = e;
17
+ n["default"] = e;
18
18
  return Object.freeze(n);
19
19
  }
20
20
 
@@ -1,5 +1,5 @@
1
1
  import { invariant } from "../../utilities/globals/index.js";
2
- import * as React from "react/index.js";
2
+ import * as React from 'react';
3
3
  import { getApolloContext } from "./ApolloContext.js";
4
4
  export var ApolloConsumer = function (props) {
5
5
  var ApolloContext = getApolloContext();
@@ -1,4 +1,4 @@
1
- import * as React from "react/index.js";
1
+ import * as React from 'react';
2
2
  import { canUseSymbol } from "../../utilities/index.js";
3
3
  var contextKey = canUseSymbol
4
4
  ? Symbol.for('__APOLLO_CONTEXT__')
@@ -1,5 +1,5 @@
1
1
  import { invariant } from "../../utilities/globals/index.js";
2
- import * as React from "react/index.js";
2
+ import * as React from 'react';
3
3
  import { getApolloContext } from "./ApolloContext.js";
4
4
  export var ApolloProvider = function (_a) {
5
5
  var client = _a.client, children = _a.children;
@@ -10,11 +10,11 @@ function _interopNamespace(e) {
10
10
  if (e && e.__esModule) return e;
11
11
  var n = Object.create(null);
12
12
  if (e) {
13
- Object.keys(e).forEach(function (k) {
13
+ for (var k in e) {
14
14
  n[k] = e[k];
15
- });
15
+ }
16
16
  }
17
- n['default'] = e;
17
+ n["default"] = e;
18
18
  return Object.freeze(n);
19
19
  }
20
20
 
@@ -1,6 +1,6 @@
1
- import { __extends } from "tslib/tslib.es6.js";
1
+ import { __extends } from "tslib";
2
2
  import { invariant } from "../../utilities/globals/index.js";
3
- import * as React from "react/index.js";
3
+ import * as React from 'react';
4
4
  export var defaultMapPropsToOptions = function () { return ({}); };
5
5
  export var defaultMapResultToProps = function (props) { return props; };
6
6
  export var defaultMapPropsToSkip = function () { return false; };
package/react/hoc/hoc.cjs CHANGED
@@ -10,17 +10,17 @@ var hoistNonReactStatics = require('hoist-non-react-statics');
10
10
  var components = require('../components');
11
11
  var context = require('../context');
12
12
 
13
- function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e['default'] : e; }
13
+ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e["default"] : e; }
14
14
 
15
15
  function _interopNamespace(e) {
16
16
  if (e && e.__esModule) return e;
17
17
  var n = Object.create(null);
18
18
  if (e) {
19
- Object.keys(e).forEach(function (k) {
19
+ for (var k in e) {
20
20
  n[k] = e[k];
21
- });
21
+ }
22
22
  }
23
- n['default'] = e;
23
+ n["default"] = e;
24
24
  return Object.freeze(n);
25
25
  }
26
26
 
@@ -83,7 +83,7 @@ function withQuery(document, operationOptions) {
83
83
  }
84
84
  var lastResultProps;
85
85
  return function (WrappedComponent) {
86
- var graphQLDisplayName = alias + "(" + getDisplayName$1(WrappedComponent) + ")";
86
+ var graphQLDisplayName = "".concat(alias, "(").concat(getDisplayName$1(WrappedComponent), ")");
87
87
  var GraphQL = (function (_super) {
88
88
  tslib.__extends(GraphQL, _super);
89
89
  function GraphQL() {
@@ -141,7 +141,7 @@ function withMutation(document, operationOptions) {
141
141
  if (typeof mapPropsToOptions !== 'function')
142
142
  mapPropsToOptions = function () { return options; };
143
143
  return function (WrappedComponent) {
144
- var graphQLDisplayName = alias + "(" + getDisplayName$1(WrappedComponent) + ")";
144
+ var graphQLDisplayName = "".concat(alias, "(").concat(getDisplayName$1(WrappedComponent), ")");
145
145
  var GraphQL = (function (_super) {
146
146
  tslib.__extends(GraphQL, _super);
147
147
  function GraphQL() {
@@ -165,7 +165,7 @@ function withMutation(document, operationOptions) {
165
165
  var result = Object.assign(r, data || {});
166
166
  var name = operationOptions.name || 'mutate';
167
167
  var resultName = operationOptions.name
168
- ? name + "Result"
168
+ ? "".concat(name, "Result")
169
169
  : 'result';
170
170
  var childProps = (_b = {},
171
171
  _b[name] = mutate,
@@ -202,7 +202,7 @@ function withSubscription(document, operationOptions) {
202
202
  mapPropsToSkip = function () { return skip; };
203
203
  var lastResultProps;
204
204
  return function (WrappedComponent) {
205
- var graphQLDisplayName = alias + "(" + getDisplayName$1(WrappedComponent) + ")";
205
+ var graphQLDisplayName = "".concat(alias, "(").concat(getDisplayName$1(WrappedComponent), ")");
206
206
  var GraphQL = (function (_super) {
207
207
  tslib.__extends(GraphQL, _super);
208
208
  function GraphQL(props) {
@@ -282,7 +282,7 @@ function getDisplayName(WrappedComponent) {
282
282
  }
283
283
  function withApollo(WrappedComponent, operationOptions) {
284
284
  if (operationOptions === void 0) { operationOptions = {}; }
285
- var withDisplayName = "withApollo(" + getDisplayName(WrappedComponent) + ")";
285
+ var withDisplayName = "withApollo(".concat(getDisplayName(WrappedComponent), ")");
286
286
  var WithApollo = (function (_super) {
287
287
  tslib.__extends(WithApollo, _super);
288
288
  function WithApollo(props) {