@apollo/client 3.5.3 → 3.5.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (116) hide show
  1. package/apollo-client.cjs +156 -144
  2. package/apollo-client.cjs.map +1 -1
  3. package/apollo-client.min.cjs +1 -1
  4. package/cache/cache.cjs +15 -15
  5. package/cache/cache.cjs.map +1 -1
  6. package/cache/inmemory/helpers.js +1 -1
  7. package/cache/inmemory/helpers.js.map +1 -1
  8. package/cache/inmemory/key-extractor.js +2 -2
  9. package/cache/inmemory/key-extractor.js.map +1 -1
  10. package/cache/inmemory/policies.js +3 -3
  11. package/cache/inmemory/policies.js.map +1 -1
  12. package/cache/inmemory/readFromStore.js +3 -3
  13. package/cache/inmemory/readFromStore.js.map +1 -1
  14. package/cache/inmemory/writeToStore.js +6 -6
  15. package/cache/inmemory/writeToStore.js.map +1 -1
  16. package/core/ApolloClient.js +1 -1
  17. package/core/ApolloClient.js.map +1 -1
  18. package/core/LocalState.js +1 -1
  19. package/core/LocalState.js.map +1 -1
  20. package/core/ObservableQuery.js +2 -2
  21. package/core/ObservableQuery.js.map +1 -1
  22. package/core/QueryManager.js +1 -1
  23. package/core/QueryManager.js.map +1 -1
  24. package/core/core.cjs +10 -10
  25. package/core/core.cjs.map +1 -1
  26. package/errors/errors.cjs +2 -2
  27. package/errors/errors.cjs.map +1 -1
  28. package/errors/index.js +2 -2
  29. package/errors/index.js.map +1 -1
  30. package/invariantErrorCodes.js +25 -25
  31. package/link/batch/batch.cjs +1 -1
  32. package/link/batch/batch.cjs.map +1 -1
  33. package/link/batch/batching.js +1 -1
  34. package/link/batch/batching.js.map +1 -1
  35. package/link/batch-http/batch-http.cjs +1 -1
  36. package/link/batch-http/batch-http.cjs.map +1 -1
  37. package/link/batch-http/batchHttpLink.js +2 -2
  38. package/link/batch-http/batchHttpLink.js.map +1 -1
  39. package/link/http/createHttpLink.js +2 -2
  40. package/link/http/createHttpLink.js.map +1 -1
  41. package/link/http/http.cjs +24 -13
  42. package/link/http/http.cjs.map +1 -1
  43. package/link/http/index.d.ts +1 -1
  44. package/link/http/index.d.ts.map +1 -1
  45. package/link/http/index.js +1 -1
  46. package/link/http/index.js.map +1 -1
  47. package/link/http/parseAndCheckHttpResponse.js +3 -3
  48. package/link/http/parseAndCheckHttpResponse.js.map +1 -1
  49. package/link/http/rewriteURIForGET.js +1 -1
  50. package/link/http/rewriteURIForGET.js.map +1 -1
  51. package/link/http/selectHttpOptionsAndBody.d.ts +5 -1
  52. package/link/http/selectHttpOptionsAndBody.d.ts.map +1 -1
  53. package/link/http/selectHttpOptionsAndBody.js +19 -8
  54. package/link/http/selectHttpOptionsAndBody.js.map +1 -1
  55. package/link/http/serializeFetchParameter.js +1 -1
  56. package/link/http/serializeFetchParameter.js.map +1 -1
  57. package/link/utils/utils.cjs +1 -1
  58. package/link/utils/utils.cjs.map +1 -1
  59. package/link/utils/validateOperation.js +1 -1
  60. package/link/utils/validateOperation.js.map +1 -1
  61. package/main.cjs +4 -4
  62. package/package.json +14 -14
  63. package/react/components/components.cjs +3 -3
  64. package/react/context/context.cjs +3 -3
  65. package/react/hoc/hoc.cjs +9 -9
  66. package/react/hoc/hoc.cjs.map +1 -1
  67. package/react/hoc/mutation-hoc.js +2 -2
  68. package/react/hoc/mutation-hoc.js.map +1 -1
  69. package/react/hoc/query-hoc.js +1 -1
  70. package/react/hoc/query-hoc.js.map +1 -1
  71. package/react/hoc/subscription-hoc.js +1 -1
  72. package/react/hoc/subscription-hoc.js.map +1 -1
  73. package/react/hoc/withApollo.js +1 -1
  74. package/react/hoc/withApollo.js.map +1 -1
  75. package/react/hooks/hooks.cjs +83 -82
  76. package/react/hooks/hooks.cjs.map +1 -1
  77. package/react/hooks/useMutation.d.ts.map +1 -1
  78. package/react/hooks/useMutation.js +59 -65
  79. package/react/hooks/useMutation.js.map +1 -1
  80. package/react/hooks/useQuery.d.ts.map +1 -1
  81. package/react/hooks/useQuery.js +25 -17
  82. package/react/hooks/useQuery.js.map +1 -1
  83. package/react/parser/index.js +7 -7
  84. package/react/parser/index.js.map +1 -1
  85. package/react/parser/parser.cjs +7 -7
  86. package/react/parser/parser.cjs.map +1 -1
  87. package/react/react.cjs +2 -2
  88. package/react/ssr/ssr.cjs +3 -3
  89. package/testing/core/core.cjs +2 -2
  90. package/testing/core/core.cjs.map +1 -1
  91. package/testing/core/mocking/mockFetch.js +1 -1
  92. package/testing/core/mocking/mockFetch.js.map +1 -1
  93. package/testing/core/mocking/mockLink.js +2 -2
  94. package/testing/core/mocking/mockLink.js.map +1 -1
  95. package/testing/core/observableToPromise.js +1 -1
  96. package/testing/core/observableToPromise.js.map +1 -1
  97. package/testing/testing.cjs +5 -5
  98. package/utilities/common/makeUniqueId.js +1 -1
  99. package/utilities/common/makeUniqueId.js.map +1 -1
  100. package/utilities/globals/fix-graphql.js +1 -1
  101. package/utilities/globals/global.d.ts.map +1 -1
  102. package/utilities/globals/global.js +1 -1
  103. package/utilities/globals/global.js.map +1 -1
  104. package/utilities/globals/globals.cjs +1 -1
  105. package/utilities/globals/globals.cjs.map +1 -1
  106. package/utilities/graphql/directives.js +4 -4
  107. package/utilities/graphql/directives.js.map +1 -1
  108. package/utilities/graphql/fragments.js +3 -3
  109. package/utilities/graphql/fragments.js.map +1 -1
  110. package/utilities/graphql/getFromAST.js +2 -2
  111. package/utilities/graphql/getFromAST.js.map +1 -1
  112. package/utilities/graphql/storeUtils.js +5 -5
  113. package/utilities/graphql/storeUtils.js.map +1 -1
  114. package/utilities/utilities.cjs +15 -15
  115. package/utilities/utilities.cjs.map +1 -1
  116. package/version.js +1 -1
package/core/core.cjs CHANGED
@@ -15,7 +15,7 @@ var utils = require('../link/utils');
15
15
  var tsInvariant = require('ts-invariant');
16
16
  var graphqlTag = require('graphql-tag');
17
17
 
18
- var version = '3.5.3';
18
+ var version = '3.5.7';
19
19
 
20
20
  exports.NetworkStatus = void 0;
21
21
  (function (NetworkStatus) {
@@ -191,7 +191,7 @@ var ObservableQuery = (function (_super) {
191
191
  var queryDef = utilities.getQueryDefinition(this.options.query);
192
192
  var vars = queryDef.variableDefinitions;
193
193
  if (!vars || !vars.some(function (v) { return v.variable.name.value === "variables"; })) {
194
- __DEV__ && globals.invariant.warn("Called refetch(" + JSON.stringify(variables) + ") for query " + (((_a = queryDef.name) === null || _a === void 0 ? void 0 : _a.value) || JSON.stringify(queryDef)) + ", which does not declare a $variables variable.\nDid you mean to call refetch(variables) instead of refetch({ variables })?");
194
+ __DEV__ && globals.invariant.warn("Called refetch(".concat(JSON.stringify(variables), ") for query ").concat(((_a = queryDef.name) === null || _a === void 0 ? void 0 : _a.value) || JSON.stringify(queryDef), ", which does not declare a $variables variable.\nDid you mean to call refetch(variables) instead of refetch({ variables })?"));
195
195
  }
196
196
  }
197
197
  if (variables && !equality.equal(this.options.variables, variables)) {
@@ -454,7 +454,7 @@ function defaultSubscriptionObserverErrorCallback(error) {
454
454
  }
455
455
  function logMissingFieldErrors(missing) {
456
456
  if (__DEV__ && missing) {
457
- __DEV__ && globals.invariant.debug("Missing cache result fields: " + JSON.stringify(missing), missing);
457
+ __DEV__ && globals.invariant.debug("Missing cache result fields: ".concat(JSON.stringify(missing)), missing);
458
458
  }
459
459
  }
460
460
  function applyNextFetchPolicy(options) {
@@ -635,7 +635,7 @@ var LocalState = (function () {
635
635
  }
636
636
  else {
637
637
  fragment = fragmentMap[selection.name.value];
638
- __DEV__ ? globals.invariant(fragment, "No fragment named " + selection.name.value) : globals.invariant(fragment, 9);
638
+ __DEV__ ? globals.invariant(fragment, "No fragment named ".concat(selection.name.value)) : globals.invariant(fragment, 9);
639
639
  }
640
640
  if (fragment && fragment.typeCondition) {
641
641
  typeCondition = fragment.typeCondition.name.value;
@@ -1426,7 +1426,7 @@ var QueryManager = (function () {
1426
1426
  if (__DEV__ && queryNamesAndDocs.size) {
1427
1427
  queryNamesAndDocs.forEach(function (included, nameOrDoc) {
1428
1428
  if (!included) {
1429
- __DEV__ && globals.invariant.warn("Unknown query " + (typeof nameOrDoc === "string" ? "named " : "") + JSON.stringify(nameOrDoc, null, 2) + " requested in refetchQueries options.include array");
1429
+ __DEV__ && globals.invariant.warn("Unknown query ".concat(typeof nameOrDoc === "string" ? "named " : "").concat(JSON.stringify(nameOrDoc, null, 2), " requested in refetchQueries options.include array"));
1430
1430
  }
1431
1431
  });
1432
1432
  }
@@ -2017,7 +2017,7 @@ var ApolloClient = (function () {
2017
2017
  result.queries = queries;
2018
2018
  result.results = results;
2019
2019
  result.catch(function (error) {
2020
- __DEV__ && globals.invariant.debug("In client.refetchQueries, Promise.all promise rejected with error " + error);
2020
+ __DEV__ && globals.invariant.debug("In client.refetchQueries, Promise.all promise rejected with error ".concat(error));
2021
2021
  });
2022
2022
  return result;
2023
2023
  };
@@ -2076,10 +2076,10 @@ exports.ApolloClient = ApolloClient;
2076
2076
  exports.ObservableQuery = ObservableQuery;
2077
2077
  exports.applyNextFetchPolicy = applyNextFetchPolicy;
2078
2078
  exports.mergeOptions = mergeOptions;
2079
- Object.keys(core).forEach(function (k) {
2079
+ for (var k in core) {
2080
2080
  if (k !== 'default' && !exports.hasOwnProperty(k)) exports[k] = core[k];
2081
- });
2082
- Object.keys(http).forEach(function (k) {
2081
+ }
2082
+ for (var k in http) {
2083
2083
  if (k !== 'default' && !exports.hasOwnProperty(k)) exports[k] = http[k];
2084
- });
2084
+ }
2085
2085
  //# sourceMappingURL=core.cjs.map