@apollo/client 3.3.17 → 3.3.21

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 (56) hide show
  1. package/README.md +4 -1
  2. package/apollo-client.cjs.js +22 -12
  3. package/apollo-client.cjs.js.map +1 -1
  4. package/apollo-client.cjs.min.js +1 -1
  5. package/cache/cache.cjs.js +3 -1
  6. package/cache/cache.cjs.js.map +1 -1
  7. package/cache/inmemory/policies.d.ts.map +1 -1
  8. package/cache/inmemory/policies.js +4 -2
  9. package/cache/inmemory/policies.js.map +1 -1
  10. package/cache/package.json +2 -1
  11. package/core/core.cjs.js +8 -8
  12. package/core/core.cjs.js.map +1 -1
  13. package/core/index.d.ts +1 -3
  14. package/core/index.d.ts.map +1 -1
  15. package/core/index.js +1 -3
  16. package/core/index.js.map +1 -1
  17. package/core/package.json +2 -1
  18. package/errors/package.json +2 -1
  19. package/invariantErrorCodes.js +1 -1
  20. package/link/batch/package.json +2 -1
  21. package/link/batch-http/package.json +2 -1
  22. package/link/context/context.cjs.js +4 -0
  23. package/link/context/context.cjs.js.map +1 -1
  24. package/link/context/index.d.ts.map +1 -1
  25. package/link/context/index.js +4 -0
  26. package/link/context/index.js.map +1 -1
  27. package/link/context/package.json +2 -1
  28. package/link/core/package.json +2 -1
  29. package/link/error/package.json +2 -1
  30. package/link/http/http.cjs.js +11 -1
  31. package/link/http/http.cjs.js.map +1 -1
  32. package/link/http/package.json +2 -1
  33. package/link/http/selectHttpOptionsAndBody.js +11 -1
  34. package/link/http/selectHttpOptionsAndBody.js.map +1 -1
  35. package/link/persisted-queries/package.json +2 -1
  36. package/link/retry/package.json +2 -1
  37. package/link/schema/package.json +2 -1
  38. package/link/utils/package.json +2 -1
  39. package/link/ws/package.json +2 -1
  40. package/package.json +24 -26
  41. package/react/components/package.json +2 -1
  42. package/react/context/package.json +2 -1
  43. package/react/data/package.json +2 -1
  44. package/react/hoc/package.json +2 -1
  45. package/react/hooks/package.json +2 -1
  46. package/react/package.json +2 -1
  47. package/react/parser/package.json +2 -1
  48. package/react/ssr/package.json +2 -1
  49. package/testing/package.json +2 -1
  50. package/utilities/package.json +2 -1
  51. package/utilities/policies/pagination.d.ts.map +1 -1
  52. package/utilities/policies/pagination.js +6 -6
  53. package/utilities/policies/pagination.js.map +1 -1
  54. package/utilities/utilities.cjs.js +6 -6
  55. package/utilities/utilities.cjs.js.map +1 -1
  56. package/version.js +1 -1
package/README.md CHANGED
@@ -4,7 +4,7 @@
4
4
 
5
5
  [![npm version](https://badge.fury.io/js/%40apollo%2Fclient.svg)](https://badge.fury.io/js/%40apollo%2Fclient)
6
6
  [![Build Status](https://circleci.com/gh/apollographql/apollo-client.svg?style=svg)](https://circleci.com/gh/apollographql/apollo-client)
7
- [![Join the community on Spectrum](https://withspectrum.github.io/badge/badge.svg)](https://spectrum.chat/apollo)
7
+ [![Join the community](https://img.shields.io/discourse/status?label=Join%20the%20community&server=https%3A%2F%2Fcommunity.apollographql.com)](https://community.apollographql.com)
8
8
 
9
9
  Apollo Client is a fully-featured caching GraphQL client with integrations for React, Angular, and more. It allows you to easily build UI components that fetch data via GraphQL.
10
10
 
@@ -16,6 +16,9 @@ All Apollo Client documentation, including React integration articles and helpfu
16
16
  The Apollo Client API reference can be found at: <br/>
17
17
  [https://www.apollographql.com/docs/react/api/apollo-client/](https://www.apollographql.com/docs/react/api/apollo-client/)
18
18
 
19
+ Learn how to use Apollo Client with self-paced hands-on training on Odyssey, Apollo's official learning platform: <br/>
20
+ [https://odyssey.apollographql.com/](https://odyssey.apollographql.com/)
21
+
19
22
  ## Maintainers
20
23
 
21
24
  - [@benjamn](https://github.com/benjamn) (Apollo)
@@ -13,7 +13,8 @@ require('symbol-observable');
13
13
  var equality = require('@wry/equality');
14
14
  var optimism = require('optimism');
15
15
  var context = require('@wry/context');
16
- var gql = _interopDefault(require('graphql-tag'));
16
+ var graphqlTag = require('graphql-tag');
17
+ var graphqlTag__default = _interopDefault(graphqlTag);
17
18
  var React = require('react');
18
19
  var React__default = _interopDefault(React);
19
20
 
@@ -1234,7 +1235,7 @@ var concat = ApolloLink.concat;
1234
1235
 
1235
1236
  var execute = ApolloLink.execute;
1236
1237
 
1237
- var version = '3.3.17';
1238
+ var version = '3.3.21';
1238
1239
 
1239
1240
  var hasOwnProperty$1 = Object.prototype.hasOwnProperty;
1240
1241
  function parseAndCheckHttpResponse(operations) {
@@ -1305,7 +1306,7 @@ var selectHttpOptionsAndBody = function (operation, fallbackConfig) {
1305
1306
  var options = tslib.__assign(tslib.__assign({}, fallbackConfig.options), { headers: fallbackConfig.headers, credentials: fallbackConfig.credentials });
1306
1307
  var http = fallbackConfig.http || {};
1307
1308
  configs.forEach(function (config) {
1308
- options = tslib.__assign(tslib.__assign(tslib.__assign({}, options), config.options), { headers: tslib.__assign(tslib.__assign({}, options.headers), config.headers) });
1309
+ options = tslib.__assign(tslib.__assign(tslib.__assign({}, options), config.options), { headers: tslib.__assign(tslib.__assign({}, options.headers), headersToLowerCase(config.headers)) });
1309
1310
  if (config.credentials)
1310
1311
  options.credentials = config.credentials;
1311
1312
  http = tslib.__assign(tslib.__assign({}, http), config.http);
@@ -1321,6 +1322,16 @@ var selectHttpOptionsAndBody = function (operation, fallbackConfig) {
1321
1322
  body: body,
1322
1323
  };
1323
1324
  };
1325
+ function headersToLowerCase(headers) {
1326
+ if (headers) {
1327
+ var normalized_1 = Object.create(null);
1328
+ Object.keys(Object(headers)).forEach(function (name) {
1329
+ normalized_1[name.toLowerCase()] = headers[name];
1330
+ });
1331
+ return normalized_1;
1332
+ }
1333
+ return headers;
1334
+ }
1324
1335
 
1325
1336
  var checkFetcher = function (fetcher) {
1326
1337
  if (!fetcher && typeof fetch === 'undefined') {
@@ -3220,7 +3231,9 @@ var Policies = (function () {
3220
3231
  }
3221
3232
  var inbox = this.toBeAdded[typename];
3222
3233
  if (inbox && inbox.length) {
3223
- this.updateTypePolicy(typename, compact.apply(void 0, inbox.splice(0)));
3234
+ inbox.splice(0).forEach(function (policy) {
3235
+ _this.updateTypePolicy(typename, policy);
3236
+ });
3224
3237
  }
3225
3238
  return this.typePolicies[typename];
3226
3239
  };
@@ -5149,9 +5162,6 @@ var ApolloClient = (function () {
5149
5162
  return ApolloClient;
5150
5163
  }());
5151
5164
 
5152
- tsInvariant.setVerbosity("log");
5153
- var resetCaches = gql.resetCaches, disableFragmentWarnings = gql.disableFragmentWarnings, enableExperimentalFragmentVariables = gql.enableExperimentalFragmentVariables, disableExperimentalFragmentVariables = gql.disableExperimentalFragmentVariables;
5154
-
5155
5165
  var cache = new (canUseWeakMap ? WeakMap : Map)();
5156
5166
  function getApolloContext() {
5157
5167
  var context = cache.get(React__default.createContext);
@@ -5958,7 +5968,11 @@ function useReactiveVar(rv) {
5958
5968
 
5959
5969
  exports.setLogVerbosity = tsInvariant.setVerbosity;
5960
5970
  exports.Observable = Observable;
5961
- exports.gql = gql;
5971
+ exports.disableExperimentalFragmentVariables = graphqlTag.disableExperimentalFragmentVariables;
5972
+ exports.disableFragmentWarnings = graphqlTag.disableFragmentWarnings;
5973
+ exports.enableExperimentalFragmentVariables = graphqlTag.enableExperimentalFragmentVariables;
5974
+ exports.gql = graphqlTag__default;
5975
+ exports.resetCaches = graphqlTag.resetCaches;
5962
5976
  exports.ApolloCache = ApolloCache;
5963
5977
  exports.ApolloClient = ApolloClient;
5964
5978
  exports.ApolloConsumer = ApolloConsumer;
@@ -5974,10 +5988,7 @@ exports.concat = concat;
5974
5988
  exports.createHttpLink = createHttpLink;
5975
5989
  exports.createSignalIfSupported = createSignalIfSupported;
5976
5990
  exports.defaultDataIdFromObject = defaultDataIdFromObject;
5977
- exports.disableExperimentalFragmentVariables = disableExperimentalFragmentVariables;
5978
- exports.disableFragmentWarnings = disableFragmentWarnings;
5979
5991
  exports.empty = empty;
5980
- exports.enableExperimentalFragmentVariables = enableExperimentalFragmentVariables;
5981
5992
  exports.execute = execute;
5982
5993
  exports.fallbackHttpConfig = fallbackHttpConfig;
5983
5994
  exports.from = from;
@@ -5993,7 +6004,6 @@ exports.operationName = operationName;
5993
6004
  exports.parseAndCheckHttpResponse = parseAndCheckHttpResponse;
5994
6005
  exports.parser = parser;
5995
6006
  exports.resetApolloContext = getApolloContext;
5996
- exports.resetCaches = resetCaches;
5997
6007
  exports.rewriteURIForGET = rewriteURIForGET;
5998
6008
  exports.selectHttpOptionsAndBody = selectHttpOptionsAndBody;
5999
6009
  exports.selectURI = selectURI;