@apollo/client 3.9.0-alpha.0 → 3.9.0-alpha.2
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.
- package/apollo-client.cjs +116 -136
- package/apollo-client.cjs.map +1 -1
- package/apollo-client.min.cjs +1 -1
- package/cache/cache.cjs +6 -29
- package/cache/cache.cjs.map +1 -1
- package/cache/cache.cjs.native.js +6 -29
- package/cache/index.d.ts +1 -2
- package/cache/index.d.ts.map +1 -1
- package/cache/index.js +1 -2
- package/cache/index.js.map +1 -1
- package/cache/inmemory/inMemoryCache.d.ts.map +1 -1
- package/cache/inmemory/inMemoryCache.js +1 -2
- package/cache/inmemory/inMemoryCache.js.map +1 -1
- package/cache/inmemory/object-canon.d.ts +0 -5
- package/cache/inmemory/object-canon.d.ts.map +1 -1
- package/cache/inmemory/object-canon.js +0 -22
- package/cache/inmemory/object-canon.js.map +1 -1
- package/cache/inmemory/policies.d.ts.map +1 -1
- package/cache/inmemory/policies.js +0 -2
- package/cache/inmemory/policies.js.map +1 -1
- package/cache/inmemory/readFromStore.d.ts.map +1 -1
- package/cache/inmemory/readFromStore.js +2 -2
- package/cache/inmemory/readFromStore.js.map +1 -1
- package/cache/inmemory/writeToStore.d.ts.map +1 -1
- package/cache/inmemory/writeToStore.js +1 -2
- package/cache/inmemory/writeToStore.js.map +1 -1
- package/core/ObservableQuery.d.ts.map +1 -1
- package/core/ObservableQuery.js +5 -6
- package/core/ObservableQuery.js.map +1 -1
- package/core/QueryInfo.d.ts +0 -2
- package/core/QueryInfo.d.ts.map +1 -1
- package/core/QueryInfo.js +0 -2
- package/core/QueryInfo.js.map +1 -1
- package/core/QueryManager.js +2 -2
- package/core/QueryManager.js.map +1 -1
- package/core/core.cjs +8 -11
- package/core/core.cjs.map +1 -1
- package/core/core.cjs.native.js +8 -11
- package/dev/dev.cjs +52 -37
- package/dev/dev.cjs.map +1 -1
- package/dev/dev.cjs.native.js +52 -37
- package/dev/loadErrorMessageHandler.js +1 -1
- package/dev/loadErrorMessageHandler.js.map +1 -1
- package/invariantErrorCodes.js +24 -18
- package/package.json +7 -7
- package/react/cache/index.d.ts +0 -4
- package/react/cache/index.d.ts.map +1 -1
- package/react/cache/index.js +0 -14
- package/react/cache/index.js.map +1 -1
- package/react/index.d.ts +0 -1
- package/react/index.d.ts.map +1 -1
- package/react/index.js +0 -1
- package/react/index.js.map +1 -1
- package/react/react.cjs +1 -218
- package/react/react.cjs.map +1 -1
- package/react/react.cjs.native.js +1 -218
- package/react/types/types.d.ts +0 -3
- package/react/types/types.d.ts.map +1 -1
- package/react/types/types.js.map +1 -1
- package/testing/core/core.cjs +9 -1
- package/testing/core/core.cjs.map +1 -1
- package/testing/core/core.cjs.native.js +9 -1
- package/testing/core/mocking/mockLink.d.ts +1 -0
- package/testing/core/mocking/mockLink.d.ts.map +1 -1
- package/testing/core/mocking/mockLink.js +9 -1
- package/testing/core/mocking/mockLink.js.map +1 -1
- package/testing/internal/ObservableStream.d.ts +26 -0
- package/testing/internal/ObservableStream.d.ts.map +1 -0
- package/testing/internal/ObservableStream.js +101 -0
- package/testing/internal/ObservableStream.js.map +1 -0
- package/testing/internal/index.d.ts +1 -0
- package/testing/internal/index.d.ts.map +1 -1
- package/testing/internal/index.js +1 -0
- package/testing/internal/index.js.map +1 -1
- package/utilities/common/canonicalStringify.d.ts +4 -0
- package/utilities/common/canonicalStringify.d.ts.map +1 -0
- package/utilities/common/canonicalStringify.js +37 -0
- package/utilities/common/canonicalStringify.js.map +1 -0
- package/utilities/globals/globals.cjs +29 -19
- package/utilities/globals/globals.cjs.map +1 -1
- package/utilities/globals/globals.cjs.native.js +29 -19
- package/utilities/globals/invariantWrappers.d.ts.map +1 -1
- package/utilities/globals/invariantWrappers.js +28 -18
- package/utilities/globals/invariantWrappers.js.map +1 -1
- package/utilities/graphql/DocumentTransform.js +1 -1
- package/utilities/graphql/directives.js +4 -4
- package/utilities/graphql/fragments.js +3 -3
- package/utilities/graphql/getFromAST.js +8 -8
- package/utilities/graphql/storeUtils.d.ts +2 -2
- package/utilities/graphql/storeUtils.d.ts.map +1 -1
- package/utilities/graphql/storeUtils.js +8 -20
- package/utilities/graphql/storeUtils.js.map +1 -1
- package/utilities/graphql/transform.js +2 -2
- package/utilities/index.d.ts +1 -0
- package/utilities/index.d.ts.map +1 -1
- package/utilities/index.js +1 -0
- package/utilities/index.js.map +1 -1
- package/utilities/observables/asyncMap.d.ts.map +1 -1
- package/utilities/observables/asyncMap.js +17 -34
- package/utilities/observables/asyncMap.js.map +1 -1
- package/utilities/utilities.cjs +80 -72
- package/utilities/utilities.cjs.map +1 -1
- package/utilities/utilities.cjs.native.js +80 -72
- package/version.js +1 -1
package/cache/cache.cjs
CHANGED
|
@@ -766,28 +766,6 @@ var ObjectCanon = (function () {
|
|
|
766
766
|
};
|
|
767
767
|
return ObjectCanon;
|
|
768
768
|
}());
|
|
769
|
-
var canonicalStringify = Object.assign(function (value) {
|
|
770
|
-
if (utilities.isNonNullObject(value)) {
|
|
771
|
-
if (stringifyCanon === void 0) {
|
|
772
|
-
resetCanonicalStringify();
|
|
773
|
-
}
|
|
774
|
-
var canonical = stringifyCanon.admit(value);
|
|
775
|
-
var json = stringifyCache.get(canonical);
|
|
776
|
-
if (json === void 0) {
|
|
777
|
-
stringifyCache.set(canonical, (json = JSON.stringify(canonical)));
|
|
778
|
-
}
|
|
779
|
-
return json;
|
|
780
|
-
}
|
|
781
|
-
return JSON.stringify(value);
|
|
782
|
-
}, {
|
|
783
|
-
reset: resetCanonicalStringify,
|
|
784
|
-
});
|
|
785
|
-
var stringifyCanon;
|
|
786
|
-
var stringifyCache;
|
|
787
|
-
function resetCanonicalStringify() {
|
|
788
|
-
stringifyCanon = new ObjectCanon();
|
|
789
|
-
stringifyCache = new (utilities.canUseWeakMap ? WeakMap : Map)();
|
|
790
|
-
}
|
|
791
769
|
|
|
792
770
|
function execSelectionSetKeyArgs(options) {
|
|
793
771
|
return [
|
|
@@ -854,7 +832,7 @@ var StoreReader = (function () {
|
|
|
854
832
|
selectionSet: utilities.getMainDefinition(query).selectionSet,
|
|
855
833
|
objectOrReference: rootRef,
|
|
856
834
|
enclosingRef: rootRef,
|
|
857
|
-
context: tslib.__assign({ store: store, query: query, policies: policies, variables: variables, varString: canonicalStringify(variables), canonizeResults: canonizeResults }, extractFragmentContext(query, this.config.fragments)),
|
|
835
|
+
context: tslib.__assign({ store: store, query: query, policies: policies, variables: variables, varString: utilities.canonicalStringify(variables), canonizeResults: canonizeResults }, extractFragmentContext(query, this.config.fragments)),
|
|
858
836
|
});
|
|
859
837
|
var missing;
|
|
860
838
|
if (execResult.missing) {
|
|
@@ -1239,7 +1217,6 @@ function normalize(value) {
|
|
|
1239
1217
|
return value;
|
|
1240
1218
|
}
|
|
1241
1219
|
|
|
1242
|
-
utilities.getStoreKeyName.setStringify(canonicalStringify);
|
|
1243
1220
|
function argsFromFieldSpecifier(spec) {
|
|
1244
1221
|
return spec.args !== void 0
|
|
1245
1222
|
? spec.args
|
|
@@ -1712,7 +1689,7 @@ var StoreWriter = (function () {
|
|
|
1712
1689
|
variables = tslib.__assign(tslib.__assign({}, utilities.getDefaultValues(operationDefinition)), variables);
|
|
1713
1690
|
var context = tslib.__assign(tslib.__assign({ store: store, written: Object.create(null), merge: function (existing, incoming) {
|
|
1714
1691
|
return merger.merge(existing, incoming);
|
|
1715
|
-
}, variables: variables, varString: canonicalStringify(variables) }, extractFragmentContext(query, this.fragments)), { overwrite: !!overwrite, incomingById: new Map(), clientOnly: false, deferred: false, flavors: new Map() });
|
|
1692
|
+
}, variables: variables, varString: utilities.canonicalStringify(variables) }, extractFragmentContext(query, this.fragments)), { overwrite: !!overwrite, incomingById: new Map(), clientOnly: false, deferred: false, flavors: new Map() });
|
|
1716
1693
|
var ref = this.processSelectionSet({
|
|
1717
1694
|
result: result || Object.create(null),
|
|
1718
1695
|
dataId: dataId,
|
|
@@ -2131,7 +2108,7 @@ var InMemoryCache = (function (_super) {
|
|
|
2131
2108
|
var store = c.optimistic ? _this.optimisticData : _this.data;
|
|
2132
2109
|
if (supportsResultCaching(store)) {
|
|
2133
2110
|
var optimistic = c.optimistic, id = c.id, variables = c.variables;
|
|
2134
|
-
return store.makeCacheKey(c.query, c.callback, canonicalStringify({ optimistic: optimistic, id: id, variables: variables }));
|
|
2111
|
+
return store.makeCacheKey(c.query, c.callback, utilities.canonicalStringify({ optimistic: optimistic, id: id, variables: variables }));
|
|
2135
2112
|
}
|
|
2136
2113
|
},
|
|
2137
2114
|
});
|
|
@@ -2209,7 +2186,7 @@ var InMemoryCache = (function (_super) {
|
|
|
2209
2186
|
};
|
|
2210
2187
|
};
|
|
2211
2188
|
InMemoryCache.prototype.gc = function (options) {
|
|
2212
|
-
canonicalStringify.reset();
|
|
2189
|
+
utilities.canonicalStringify.reset();
|
|
2213
2190
|
var ids = this.optimisticData.gc();
|
|
2214
2191
|
if (options && !this.txCount) {
|
|
2215
2192
|
if (options.resetResultCache) {
|
|
@@ -2257,7 +2234,7 @@ var InMemoryCache = (function (_super) {
|
|
|
2257
2234
|
InMemoryCache.prototype.reset = function (options) {
|
|
2258
2235
|
var _this = this;
|
|
2259
2236
|
this.init();
|
|
2260
|
-
canonicalStringify.reset();
|
|
2237
|
+
utilities.canonicalStringify.reset();
|
|
2261
2238
|
if (options && options.discardWatches) {
|
|
2262
2239
|
this.watches.forEach(function (watch) { return _this.maybeBroadcastWatch.forget(watch); });
|
|
2263
2240
|
this.watches.clear();
|
|
@@ -2485,6 +2462,7 @@ var FragmentRegistry = (function () {
|
|
|
2485
2462
|
return FragmentRegistry;
|
|
2486
2463
|
}());
|
|
2487
2464
|
|
|
2465
|
+
exports.canonicalStringify = utilities.canonicalStringify;
|
|
2488
2466
|
exports.isReference = utilities.isReference;
|
|
2489
2467
|
exports.makeReference = utilities.makeReference;
|
|
2490
2468
|
exports.ApolloCache = ApolloCache;
|
|
@@ -2492,7 +2470,6 @@ exports.InMemoryCache = InMemoryCache;
|
|
|
2492
2470
|
exports.MissingFieldError = MissingFieldError;
|
|
2493
2471
|
exports.Policies = Policies;
|
|
2494
2472
|
exports.cacheSlot = cacheSlot;
|
|
2495
|
-
exports.canonicalStringify = canonicalStringify;
|
|
2496
2473
|
exports.createFragmentRegistry = createFragmentRegistry;
|
|
2497
2474
|
exports.defaultDataIdFromObject = defaultDataIdFromObject;
|
|
2498
2475
|
exports.fieldNameFromStoreName = fieldNameFromStoreName;
|