@apollo/client 3.3.0-rc.2 → 3.3.0
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.js +68 -45
- package/apollo-client.cjs.js.map +1 -1
- package/apollo-client.cjs.min.js +1 -1
- package/cache/cache.cjs.js +40 -14
- package/cache/cache.cjs.js.map +1 -1
- package/cache/core/cache.js.map +1 -1
- package/cache/core/types/Cache.js.map +1 -1
- package/cache/core/types/DataProxy.js.map +1 -1
- package/cache/core/types/common.js.map +1 -1
- package/cache/index.js.map +1 -1
- package/cache/inmemory/entityStore.d.ts.map +1 -1
- package/cache/inmemory/entityStore.js +11 -2
- package/cache/inmemory/entityStore.js.map +1 -1
- package/cache/inmemory/fixPolyfills.js.map +1 -1
- package/cache/inmemory/fixPolyfills.native.js.map +1 -1
- package/cache/inmemory/helpers.js.map +1 -1
- package/cache/inmemory/inMemoryCache.js.map +1 -1
- package/cache/inmemory/policies.d.ts +1 -0
- package/cache/inmemory/policies.d.ts.map +1 -1
- package/cache/inmemory/policies.js +4 -0
- package/cache/inmemory/policies.js.map +1 -1
- package/cache/inmemory/reactiveVars.d.ts +1 -0
- package/cache/inmemory/reactiveVars.d.ts.map +1 -1
- package/cache/inmemory/reactiveVars.js +25 -12
- package/cache/inmemory/reactiveVars.js.map +1 -1
- package/cache/inmemory/readFromStore.js.map +1 -1
- package/cache/inmemory/types.js.map +1 -1
- package/cache/inmemory/writeToStore.js.map +1 -1
- package/config/jest/setup.js.map +1 -1
- package/core/ApolloClient.js.map +1 -1
- package/core/LocalState.js.map +1 -1
- package/core/ObservableQuery.d.ts.map +1 -1
- package/core/ObservableQuery.js +3 -3
- package/core/ObservableQuery.js.map +1 -1
- package/core/QueryInfo.d.ts.map +1 -1
- package/core/QueryInfo.js +9 -4
- package/core/QueryInfo.js.map +1 -1
- package/core/QueryManager.js.map +1 -1
- package/core/Reobserver.js.map +1 -1
- package/core/core.cjs.js +12 -7
- package/core/core.cjs.js.map +1 -1
- package/core/index.js.map +1 -1
- package/core/networkStatus.js.map +1 -1
- package/core/types.js.map +1 -1
- package/core/watchQueryOptions.js.map +1 -1
- package/errors/index.js.map +1 -1
- package/index.js.map +1 -1
- package/invariantErrorCodes.js +1 -1
- package/link/batch/batchLink.js.map +1 -1
- package/link/batch/batching.js.map +1 -1
- package/link/batch/index.js.map +1 -1
- package/link/batch-http/batchHttpLink.js.map +1 -1
- package/link/batch-http/index.js.map +1 -1
- package/link/context/index.js.map +1 -1
- package/link/core/ApolloLink.js.map +1 -1
- package/link/core/concat.js.map +1 -1
- package/link/core/empty.js.map +1 -1
- package/link/core/execute.js.map +1 -1
- package/link/core/from.js.map +1 -1
- package/link/core/index.js.map +1 -1
- package/link/core/split.js.map +1 -1
- package/link/core/types.js.map +1 -1
- package/link/error/index.js.map +1 -1
- package/link/http/HttpLink.js.map +1 -1
- package/link/http/checkFetcher.js.map +1 -1
- package/link/http/createHttpLink.js.map +1 -1
- package/link/http/createSignalIfSupported.js.map +1 -1
- package/link/http/index.js.map +1 -1
- package/link/http/parseAndCheckHttpResponse.js.map +1 -1
- package/link/http/rewriteURIForGET.js.map +1 -1
- package/link/http/selectHttpOptionsAndBody.js.map +1 -1
- package/link/http/selectURI.js.map +1 -1
- package/link/http/serializeFetchParameter.js.map +1 -1
- package/link/persisted-queries/index.js.map +1 -1
- package/link/retry/delayFunction.js.map +1 -1
- package/link/retry/index.js.map +1 -1
- package/link/retry/retryFunction.js.map +1 -1
- package/link/retry/retryLink.js.map +1 -1
- package/link/schema/index.d.ts +2 -0
- package/link/schema/index.d.ts.map +1 -1
- package/link/schema/index.js +6 -3
- package/link/schema/index.js.map +1 -1
- package/link/schema/schema.cjs.js +6 -3
- package/link/schema/schema.cjs.js.map +1 -1
- package/link/utils/createOperation.js.map +1 -1
- package/link/utils/fromError.js.map +1 -1
- package/link/utils/fromPromise.js.map +1 -1
- package/link/utils/index.js.map +1 -1
- package/link/utils/throwServerError.js.map +1 -1
- package/link/utils/toPromise.js.map +1 -1
- package/link/utils/transformOperation.js.map +1 -1
- package/link/utils/validateOperation.js.map +1 -1
- package/link/ws/index.js.map +1 -1
- package/package.json +5 -5
- package/react/components/Mutation.js.map +1 -1
- package/react/components/Query.js.map +1 -1
- package/react/components/Subscription.js.map +1 -1
- package/react/components/index.js.map +1 -1
- package/react/components/types.js.map +1 -1
- package/react/context/ApolloConsumer.d.ts +1 -1
- package/react/context/ApolloConsumer.d.ts.map +1 -1
- package/react/context/ApolloConsumer.js +1 -1
- package/react/context/ApolloConsumer.js.map +1 -1
- package/react/context/ApolloContext.d.ts +2 -2
- package/react/context/ApolloContext.d.ts.map +1 -1
- package/react/context/ApolloContext.js +9 -15
- package/react/context/ApolloContext.js.map +1 -1
- package/react/context/ApolloProvider.d.ts +1 -1
- package/react/context/ApolloProvider.d.ts.map +1 -1
- package/react/context/ApolloProvider.js +1 -1
- package/react/context/ApolloProvider.js.map +1 -1
- package/react/context/context.cjs.js +9 -18
- package/react/context/context.cjs.js.map +1 -1
- package/react/context/index.js.map +1 -1
- package/react/data/MutationData.js.map +1 -1
- package/react/data/OperationData.js.map +1 -1
- package/react/data/QueryData.d.ts.map +1 -1
- package/react/data/QueryData.js +2 -1
- package/react/data/QueryData.js.map +1 -1
- package/react/data/SubscriptionData.js.map +1 -1
- package/react/data/data.cjs.js +2 -1
- package/react/data/data.cjs.js.map +1 -1
- package/react/data/index.js.map +1 -1
- package/react/hoc/graphql.js.map +1 -1
- package/react/hoc/hoc-utils.js.map +1 -1
- package/react/hoc/index.js.map +1 -1
- package/react/hoc/mutation-hoc.js.map +1 -1
- package/react/hoc/query-hoc.js.map +1 -1
- package/react/hoc/subscription-hoc.js.map +1 -1
- package/react/hoc/types.js.map +1 -1
- package/react/hoc/withApollo.js.map +1 -1
- package/react/hooks/hooks.cjs.js +1 -4
- package/react/hooks/hooks.cjs.js.map +1 -1
- package/react/hooks/index.js.map +1 -1
- package/react/hooks/useApolloClient.js +1 -1
- package/react/hooks/useApolloClient.js.map +1 -1
- package/react/hooks/useLazyQuery.js.map +1 -1
- package/react/hooks/useMutation.js.map +1 -1
- package/react/hooks/useQuery.js.map +1 -1
- package/react/hooks/useReactiveVar.js.map +1 -1
- package/react/hooks/useSubscription.js.map +1 -1
- package/react/hooks/utils/useBaseQuery.js.map +1 -1
- package/react/hooks/utils/useDeepMemo.js.map +1 -1
- package/react/index.js.map +1 -1
- package/react/parser/index.js.map +1 -1
- package/react/ssr/RenderPromises.js.map +1 -1
- package/react/ssr/getDataFromTree.js.map +1 -1
- package/react/ssr/index.js.map +1 -1
- package/react/ssr/renderToStringWithData.js.map +1 -1
- package/react/types/types.js.map +1 -1
- package/testing/index.js.map +1 -1
- package/utilities/common/arrays.js.map +1 -1
- package/utilities/common/canUse.js.map +1 -1
- package/utilities/common/cloneDeep.js.map +1 -1
- package/utilities/common/compact.js.map +1 -1
- package/utilities/common/environment.js.map +1 -1
- package/utilities/common/errorHandling.js.map +1 -1
- package/utilities/common/filterInPlace.js.map +1 -1
- package/utilities/common/maybeDeepFreeze.js.map +1 -1
- package/utilities/common/mergeDeep.js.map +1 -1
- package/utilities/graphql/directives.js.map +1 -1
- package/utilities/graphql/fragments.js.map +1 -1
- package/utilities/graphql/getFromAST.js.map +1 -1
- package/utilities/graphql/storeUtils.js.map +1 -1
- package/utilities/graphql/transform.js.map +1 -1
- package/utilities/index.js.map +1 -1
- package/utilities/observables/Concast.js.map +1 -1
- package/utilities/observables/Observable.js.map +1 -1
- package/utilities/observables/asyncMap.js.map +1 -1
- package/utilities/observables/iteration.js.map +1 -1
- package/utilities/policies/pagination.d.ts +9 -9
- package/utilities/policies/pagination.d.ts.map +1 -1
- package/utilities/policies/pagination.js +3 -2
- package/utilities/policies/pagination.js.map +1 -1
- package/utilities/testing/index.js.map +1 -1
- package/utilities/testing/itAsync.js.map +1 -1
- package/utilities/testing/mocking/MockedProvider.js.map +1 -1
- package/utilities/testing/mocking/mockClient.js.map +1 -1
- package/utilities/testing/mocking/mockFetch.js.map +1 -1
- package/utilities/testing/mocking/mockLink.js.map +1 -1
- package/utilities/testing/mocking/mockQueryManager.js.map +1 -1
- package/utilities/testing/mocking/mockSubscriptionLink.js.map +1 -1
- package/utilities/testing/mocking/mockWatchQuery.js.map +1 -1
- package/utilities/testing/observableToPromise.js.map +1 -1
- package/utilities/testing/stripSymbols.js.map +1 -1
- package/utilities/testing/subscribeAndCount.js.map +1 -1
- package/utilities/testing/wrap.js.map +1 -1
- package/utilities/utilities.cjs.js +2 -1
- package/utilities/utilities.cjs.js.map +1 -1
- package/version.js.map +1 -1
package/apollo-client.cjs.js
CHANGED
|
@@ -16,7 +16,6 @@ var optimism = require('optimism');
|
|
|
16
16
|
var context = require('@wry/context');
|
|
17
17
|
var gql = _interopDefault(require('graphql-tag'));
|
|
18
18
|
var React = require('react');
|
|
19
|
-
var React__default = _interopDefault(React);
|
|
20
19
|
|
|
21
20
|
function shouldInclude(_a, variables) {
|
|
22
21
|
var directives = _a.directives;
|
|
@@ -1943,16 +1942,16 @@ var ObservableQuery = (function (_super) {
|
|
|
1943
1942
|
ObservableQuery.prototype.tearDownQuery = function () {
|
|
1944
1943
|
if (this.isTornDown)
|
|
1945
1944
|
return;
|
|
1946
|
-
var queryManager = this.queryManager;
|
|
1947
1945
|
if (this.reobserver) {
|
|
1948
1946
|
this.reobserver.stop();
|
|
1949
1947
|
delete this.reobserver;
|
|
1950
1948
|
}
|
|
1951
|
-
this.
|
|
1949
|
+
delete this.options.context;
|
|
1952
1950
|
this.subscriptions.forEach(function (sub) { return sub.unsubscribe(); });
|
|
1953
1951
|
this.subscriptions.clear();
|
|
1954
|
-
queryManager.stopQuery(this.queryId);
|
|
1952
|
+
this.queryManager.stopQuery(this.queryId);
|
|
1955
1953
|
this.observers.clear();
|
|
1954
|
+
this.isTornDown = true;
|
|
1956
1955
|
};
|
|
1957
1956
|
return ObservableQuery;
|
|
1958
1957
|
}(Observable));
|
|
@@ -2158,7 +2157,12 @@ var EntityStore = (function () {
|
|
|
2158
2157
|
fieldsToDirty_1.__exists = 1;
|
|
2159
2158
|
Object.keys(incoming).forEach(function (storeFieldName) {
|
|
2160
2159
|
if (!existing || existing[storeFieldName] !== merged[storeFieldName]) {
|
|
2161
|
-
fieldsToDirty_1[
|
|
2160
|
+
fieldsToDirty_1[storeFieldName] = 1;
|
|
2161
|
+
var fieldName = fieldNameFromStoreName(storeFieldName);
|
|
2162
|
+
if (fieldName !== storeFieldName &&
|
|
2163
|
+
!_this.policies.hasKeyArgs(merged.__typename, fieldName)) {
|
|
2164
|
+
fieldsToDirty_1[fieldName] = 1;
|
|
2165
|
+
}
|
|
2162
2166
|
if (merged[storeFieldName] === void 0 && !(_this instanceof Layer)) {
|
|
2163
2167
|
delete merged[storeFieldName];
|
|
2164
2168
|
}
|
|
@@ -2373,6 +2377,10 @@ var CacheGroup = (function () {
|
|
|
2373
2377
|
CacheGroup.prototype.depend = function (dataId, storeFieldName) {
|
|
2374
2378
|
if (this.d) {
|
|
2375
2379
|
this.d(makeDepKey(dataId, storeFieldName));
|
|
2380
|
+
var fieldName = fieldNameFromStoreName(storeFieldName);
|
|
2381
|
+
if (fieldName !== storeFieldName) {
|
|
2382
|
+
this.d(makeDepKey(dataId, fieldName));
|
|
2383
|
+
}
|
|
2376
2384
|
}
|
|
2377
2385
|
};
|
|
2378
2386
|
CacheGroup.prototype.dirty = function (dataId, storeFieldName) {
|
|
@@ -2383,7 +2391,7 @@ var CacheGroup = (function () {
|
|
|
2383
2391
|
return CacheGroup;
|
|
2384
2392
|
}());
|
|
2385
2393
|
function makeDepKey(dataId, storeFieldName) {
|
|
2386
|
-
return
|
|
2394
|
+
return storeFieldName + '#' + dataId;
|
|
2387
2395
|
}
|
|
2388
2396
|
(function (EntityStore) {
|
|
2389
2397
|
var Root = (function (_super) {
|
|
@@ -2954,10 +2962,12 @@ function warnAboutDataLoss(existingRef, incomingObj, storeFieldName, store) {
|
|
|
2954
2962
|
var varDep = optimism.dep();
|
|
2955
2963
|
var cacheSlot = new context.Slot();
|
|
2956
2964
|
function consumeAndIterate(set, callback) {
|
|
2957
|
-
|
|
2958
|
-
|
|
2959
|
-
|
|
2960
|
-
|
|
2965
|
+
if (set.size) {
|
|
2966
|
+
var items_1 = [];
|
|
2967
|
+
set.forEach(function (item) { return items_1.push(item); });
|
|
2968
|
+
set.clear();
|
|
2969
|
+
items_1.forEach(callback);
|
|
2970
|
+
}
|
|
2961
2971
|
}
|
|
2962
2972
|
var varsByCache = new WeakMap();
|
|
2963
2973
|
function forgetCache(cache) {
|
|
@@ -2981,13 +2991,8 @@ function makeVar(value) {
|
|
|
2981
2991
|
}
|
|
2982
2992
|
else {
|
|
2983
2993
|
var cache = cacheSlot.getValue();
|
|
2984
|
-
if (cache)
|
|
2985
|
-
|
|
2986
|
-
var vars = varsByCache.get(cache);
|
|
2987
|
-
if (!vars)
|
|
2988
|
-
varsByCache.set(cache, vars = new Set);
|
|
2989
|
-
vars.add(rv);
|
|
2990
|
-
}
|
|
2994
|
+
if (cache)
|
|
2995
|
+
attach(cache);
|
|
2991
2996
|
varDep(rv);
|
|
2992
2997
|
}
|
|
2993
2998
|
return value;
|
|
@@ -2998,7 +3003,23 @@ function makeVar(value) {
|
|
|
2998
3003
|
listeners.delete(listener);
|
|
2999
3004
|
};
|
|
3000
3005
|
};
|
|
3001
|
-
rv.
|
|
3006
|
+
var attach = rv.attachCache = function (cache) {
|
|
3007
|
+
caches.add(cache);
|
|
3008
|
+
var vars = varsByCache.get(cache);
|
|
3009
|
+
if (!vars)
|
|
3010
|
+
varsByCache.set(cache, vars = new Set);
|
|
3011
|
+
vars.add(rv);
|
|
3012
|
+
return rv;
|
|
3013
|
+
};
|
|
3014
|
+
rv.forgetCache = function (cache) {
|
|
3015
|
+
var deleted = caches.delete(cache);
|
|
3016
|
+
if (deleted) {
|
|
3017
|
+
var vars = varsByCache.get(cache);
|
|
3018
|
+
if (vars)
|
|
3019
|
+
vars.delete(rv);
|
|
3020
|
+
}
|
|
3021
|
+
return deleted;
|
|
3022
|
+
};
|
|
3002
3023
|
return rv;
|
|
3003
3024
|
}
|
|
3004
3025
|
function broadcast(cache) {
|
|
@@ -3255,6 +3276,10 @@ var Policies = (function () {
|
|
|
3255
3276
|
}
|
|
3256
3277
|
return false;
|
|
3257
3278
|
};
|
|
3279
|
+
Policies.prototype.hasKeyArgs = function (typename, fieldName) {
|
|
3280
|
+
var policy = this.getFieldPolicy(typename, fieldName, false);
|
|
3281
|
+
return !!(policy && policy.keyFn);
|
|
3282
|
+
};
|
|
3258
3283
|
Policies.prototype.getStoreFieldName = function (fieldSpec) {
|
|
3259
3284
|
var typename = fieldSpec.typename, fieldName = fieldSpec.fieldName;
|
|
3260
3285
|
var policy = this.getFieldPolicy(typename, fieldName, false);
|
|
@@ -3975,6 +4000,12 @@ function wrapDestructiveCacheMethod(cache, methodName) {
|
|
|
3975
4000
|
};
|
|
3976
4001
|
}
|
|
3977
4002
|
}
|
|
4003
|
+
function cancelNotifyTimeout(info) {
|
|
4004
|
+
if (info["notifyTimeout"]) {
|
|
4005
|
+
clearTimeout(info["notifyTimeout"]);
|
|
4006
|
+
info["notifyTimeout"] = void 0;
|
|
4007
|
+
}
|
|
4008
|
+
}
|
|
3978
4009
|
var QueryInfo = (function () {
|
|
3979
4010
|
function QueryInfo(cache) {
|
|
3980
4011
|
this.cache = cache;
|
|
@@ -4068,10 +4099,7 @@ var QueryInfo = (function () {
|
|
|
4068
4099
|
};
|
|
4069
4100
|
QueryInfo.prototype.notify = function () {
|
|
4070
4101
|
var _this = this;
|
|
4071
|
-
|
|
4072
|
-
clearTimeout(this.notifyTimeout);
|
|
4073
|
-
this.notifyTimeout = void 0;
|
|
4074
|
-
}
|
|
4102
|
+
cancelNotifyTimeout(this);
|
|
4075
4103
|
if (this.shouldNotify()) {
|
|
4076
4104
|
this.listeners.forEach(function (listener) { return listener(_this); });
|
|
4077
4105
|
}
|
|
@@ -4132,6 +4160,7 @@ var QueryInfo = (function () {
|
|
|
4132
4160
|
QueryInfo.prototype.markResult = function (result, options, allowCacheWrite) {
|
|
4133
4161
|
var _this = this;
|
|
4134
4162
|
this.graphQLErrors = isNonEmptyArray(result.errors) ? result.errors : [];
|
|
4163
|
+
cancelNotifyTimeout(this);
|
|
4135
4164
|
if (options.fetchPolicy === 'no-cache') {
|
|
4136
4165
|
this.diff = { result: result.data, complete: true };
|
|
4137
4166
|
}
|
|
@@ -4183,6 +4212,7 @@ var QueryInfo = (function () {
|
|
|
4183
4212
|
QueryInfo.prototype.markError = function (error) {
|
|
4184
4213
|
this.networkStatus = exports.NetworkStatus.error;
|
|
4185
4214
|
this.lastWrite = void 0;
|
|
4215
|
+
cancelNotifyTimeout(this);
|
|
4186
4216
|
if (error.graphQLErrors) {
|
|
4187
4217
|
this.graphQLErrors = error.graphQLErrors;
|
|
4188
4218
|
}
|
|
@@ -5090,27 +5120,19 @@ var ApolloClient = (function () {
|
|
|
5090
5120
|
tsInvariant.setVerbosity("warn");
|
|
5091
5121
|
var resetCaches = gql.resetCaches, disableFragmentWarnings = gql.disableFragmentWarnings, enableExperimentalFragmentVariables = gql.enableExperimentalFragmentVariables, disableExperimentalFragmentVariables = gql.disableExperimentalFragmentVariables;
|
|
5092
5122
|
|
|
5093
|
-
var
|
|
5094
|
-
Symbol.for('__APOLLO_CONTEXT__') :
|
|
5095
|
-
'__APOLLO_CONTEXT__';
|
|
5096
|
-
function resetApolloContext() {
|
|
5097
|
-
Object.defineProperty(React__default, contextSymbol, {
|
|
5098
|
-
value: React__default.createContext({}),
|
|
5099
|
-
enumerable: false,
|
|
5100
|
-
configurable: true,
|
|
5101
|
-
writable: false,
|
|
5102
|
-
});
|
|
5103
|
-
}
|
|
5123
|
+
var cache = new (canUseWeakMap ? WeakMap : Map)();
|
|
5104
5124
|
function getApolloContext() {
|
|
5105
|
-
|
|
5106
|
-
|
|
5125
|
+
var context = cache.get(React.createContext);
|
|
5126
|
+
if (!context) {
|
|
5127
|
+
context = React.createContext({});
|
|
5128
|
+
cache.set(React.createContext, context);
|
|
5107
5129
|
}
|
|
5108
|
-
return
|
|
5130
|
+
return context;
|
|
5109
5131
|
}
|
|
5110
5132
|
|
|
5111
5133
|
var ApolloConsumer = function (props) {
|
|
5112
5134
|
var ApolloContext = getApolloContext();
|
|
5113
|
-
return
|
|
5135
|
+
return React.createElement(ApolloContext.Consumer, null, function (context) {
|
|
5114
5136
|
process.env.NODE_ENV === "production" ? tsInvariant.invariant(context && context.client, 27) : tsInvariant.invariant(context && context.client, 'Could not find "client" in the context of ApolloConsumer. ' +
|
|
5115
5137
|
'Wrap the root component in an <ApolloProvider>.');
|
|
5116
5138
|
return props.children(context.client);
|
|
@@ -5120,19 +5142,19 @@ var ApolloConsumer = function (props) {
|
|
|
5120
5142
|
var ApolloProvider = function (_a) {
|
|
5121
5143
|
var client = _a.client, children = _a.children;
|
|
5122
5144
|
var ApolloContext = getApolloContext();
|
|
5123
|
-
return
|
|
5145
|
+
return React.createElement(ApolloContext.Consumer, null, function (context) {
|
|
5124
5146
|
if (context === void 0) { context = {}; }
|
|
5125
5147
|
if (client && context.client !== client) {
|
|
5126
5148
|
context = Object.assign({}, context, { client: client });
|
|
5127
5149
|
}
|
|
5128
5150
|
process.env.NODE_ENV === "production" ? tsInvariant.invariant(context.client, 28) : tsInvariant.invariant(context.client, 'ApolloProvider was not passed a client instance. Make ' +
|
|
5129
5151
|
'sure you pass in your client via the "client" prop.');
|
|
5130
|
-
return (
|
|
5152
|
+
return (React.createElement(ApolloContext.Provider, { value: context }, children));
|
|
5131
5153
|
});
|
|
5132
5154
|
};
|
|
5133
5155
|
|
|
5134
5156
|
function useApolloClient() {
|
|
5135
|
-
var client =
|
|
5157
|
+
var client = React.useContext(getApolloContext()).client;
|
|
5136
5158
|
process.env.NODE_ENV === "production" ? tsInvariant.invariant(client, 33) : tsInvariant.invariant(client, 'No Apollo Client instance can be found. Please ensure that you ' +
|
|
5137
5159
|
'have called `ApolloProvider` higher up in your tree.');
|
|
5138
5160
|
return client;
|
|
@@ -5143,7 +5165,7 @@ function useApolloClient() {
|
|
|
5143
5165
|
DocumentType[DocumentType["Mutation"] = 1] = "Mutation";
|
|
5144
5166
|
DocumentType[DocumentType["Subscription"] = 2] = "Subscription";
|
|
5145
5167
|
})(exports.DocumentType || (exports.DocumentType = {}));
|
|
5146
|
-
var cache = new Map();
|
|
5168
|
+
var cache$1 = new Map();
|
|
5147
5169
|
function operationName(type) {
|
|
5148
5170
|
var name;
|
|
5149
5171
|
switch (type) {
|
|
@@ -5160,7 +5182,7 @@ function operationName(type) {
|
|
|
5160
5182
|
return name;
|
|
5161
5183
|
}
|
|
5162
5184
|
function parser(document) {
|
|
5163
|
-
var cached = cache.get(document);
|
|
5185
|
+
var cached = cache$1.get(document);
|
|
5164
5186
|
if (cached)
|
|
5165
5187
|
return cached;
|
|
5166
5188
|
var variables, type, name;
|
|
@@ -5205,7 +5227,7 @@ function parser(document) {
|
|
|
5205
5227
|
name = 'data';
|
|
5206
5228
|
}
|
|
5207
5229
|
var payload = { name: name, type: type, variables: variables };
|
|
5208
|
-
cache.set(document, payload);
|
|
5230
|
+
cache$1.set(document, payload);
|
|
5209
5231
|
return payload;
|
|
5210
5232
|
}
|
|
5211
5233
|
|
|
@@ -5620,7 +5642,8 @@ var QueryData = (function (_super) {
|
|
|
5620
5642
|
return result;
|
|
5621
5643
|
};
|
|
5622
5644
|
QueryData.prototype.getExecuteSsrResult = function () {
|
|
5623
|
-
var
|
|
5645
|
+
var _a = this.getOptions(), ssr = _a.ssr, skip = _a.skip;
|
|
5646
|
+
var ssrDisabled = ssr === false || skip;
|
|
5624
5647
|
var fetchDisabled = this.refreshClient().client.disableNetworkFetches;
|
|
5625
5648
|
var ssrLoading = tslib.__assign({ loading: true, networkStatus: exports.NetworkStatus.loading, called: true, data: undefined, stale: false, client: this.client }, this.observableQueryFields());
|
|
5626
5649
|
if (ssrDisabled && (this.ssrInitiated() || fetchDisabled)) {
|
|
@@ -5924,7 +5947,7 @@ exports.mergeOptions = mergeOptions;
|
|
|
5924
5947
|
exports.operationName = operationName;
|
|
5925
5948
|
exports.parseAndCheckHttpResponse = parseAndCheckHttpResponse;
|
|
5926
5949
|
exports.parser = parser;
|
|
5927
|
-
exports.resetApolloContext =
|
|
5950
|
+
exports.resetApolloContext = getApolloContext;
|
|
5928
5951
|
exports.resetCaches = resetCaches;
|
|
5929
5952
|
exports.rewriteURIForGET = rewriteURIForGET;
|
|
5930
5953
|
exports.selectHttpOptionsAndBody = selectHttpOptionsAndBody;
|