@apollo/client 3.7.9 → 3.7.10
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 +20 -9
- package/apollo-client.cjs.map +1 -1
- package/apollo-client.min.cjs +1 -1
- package/cache/core/types/DataProxy.d.ts +3 -2
- package/cache/core/types/DataProxy.d.ts.map +1 -1
- package/cache/core/types/DataProxy.js.map +1 -1
- package/core/ApolloClient.d.ts +3 -3
- package/core/ApolloClient.d.ts.map +1 -1
- package/core/ApolloClient.js +10 -4
- package/core/ApolloClient.js.map +1 -1
- package/core/core.cjs +11 -5
- package/core/core.cjs.map +1 -1
- package/core/core.cjs.native.js +11 -5
- package/invariantErrorCodes.js +1 -1
- package/package.json +8 -8
- package/react/hooks/hooks.cjs +2 -1
- package/react/hooks/hooks.cjs.map +1 -1
- package/react/hooks/hooks.cjs.native.js +2 -1
- package/react/hooks/useMutation.d.ts.map +1 -1
- package/react/hooks/useMutation.js +2 -1
- package/react/hooks/useMutation.js.map +1 -1
- package/utilities/graphql/getFromAST.d.ts.map +1 -1
- package/utilities/graphql/getFromAST.js +7 -3
- package/utilities/graphql/getFromAST.js.map +1 -1
- package/utilities/utilities.cjs +7 -3
- package/utilities/utilities.cjs.map +1 -1
- package/utilities/utilities.cjs.native.js +7 -3
- package/version.js +1 -1
package/apollo-client.cjs
CHANGED
|
@@ -380,17 +380,21 @@ function checkDocument(doc) {
|
|
|
380
380
|
}
|
|
381
381
|
function getOperationDefinition(doc) {
|
|
382
382
|
checkDocument(doc);
|
|
383
|
-
return doc.definitions.filter(function (definition) {
|
|
383
|
+
return doc.definitions.filter(function (definition) {
|
|
384
|
+
return definition.kind === 'OperationDefinition';
|
|
385
|
+
})[0];
|
|
384
386
|
}
|
|
385
387
|
function getOperationName(doc) {
|
|
386
388
|
return (doc.definitions
|
|
387
389
|
.filter(function (definition) {
|
|
388
|
-
return definition.kind === 'OperationDefinition' && definition.name;
|
|
390
|
+
return definition.kind === 'OperationDefinition' && !!definition.name;
|
|
389
391
|
})
|
|
390
392
|
.map(function (x) { return x.name.value; })[0] || null);
|
|
391
393
|
}
|
|
392
394
|
function getFragmentDefinitions(doc) {
|
|
393
|
-
return doc.definitions.filter(function (definition) {
|
|
395
|
+
return doc.definitions.filter(function (definition) {
|
|
396
|
+
return definition.kind === 'FragmentDefinition';
|
|
397
|
+
});
|
|
394
398
|
}
|
|
395
399
|
function getQueryDefinition(doc) {
|
|
396
400
|
var queryDef = getOperationDefinition(doc);
|
|
@@ -1353,7 +1357,7 @@ var concat = ApolloLink.concat;
|
|
|
1353
1357
|
|
|
1354
1358
|
var execute = ApolloLink.execute;
|
|
1355
1359
|
|
|
1356
|
-
var version = '3.7.
|
|
1360
|
+
var version = '3.7.10';
|
|
1357
1361
|
|
|
1358
1362
|
function isNodeResponse(value) {
|
|
1359
1363
|
return !!value.body;
|
|
@@ -6374,12 +6378,18 @@ var ApolloClient = (function () {
|
|
|
6374
6378
|
return this.cache.readFragment(options, optimistic);
|
|
6375
6379
|
};
|
|
6376
6380
|
ApolloClient.prototype.writeQuery = function (options) {
|
|
6377
|
-
this.cache.writeQuery(options);
|
|
6378
|
-
|
|
6381
|
+
var ref = this.cache.writeQuery(options);
|
|
6382
|
+
if (options.broadcast !== false) {
|
|
6383
|
+
this.queryManager.broadcastQueries();
|
|
6384
|
+
}
|
|
6385
|
+
return ref;
|
|
6379
6386
|
};
|
|
6380
6387
|
ApolloClient.prototype.writeFragment = function (options) {
|
|
6381
|
-
this.cache.writeFragment(options);
|
|
6382
|
-
|
|
6388
|
+
var ref = this.cache.writeFragment(options);
|
|
6389
|
+
if (options.broadcast !== false) {
|
|
6390
|
+
this.queryManager.broadcastQueries();
|
|
6391
|
+
}
|
|
6392
|
+
return ref;
|
|
6383
6393
|
};
|
|
6384
6394
|
ApolloClient.prototype.__actionHookForDevTools = function (cb) {
|
|
6385
6395
|
this.devToolsHookCb = cb;
|
|
@@ -7027,8 +7037,9 @@ function useMutation(mutation, options) {
|
|
|
7027
7037
|
}
|
|
7028
7038
|
var execute = React.useCallback(function (executeOptions) {
|
|
7029
7039
|
if (executeOptions === void 0) { executeOptions = {}; }
|
|
7030
|
-
var _a = ref.current,
|
|
7040
|
+
var _a = ref.current, options = _a.options, mutation = _a.mutation;
|
|
7031
7041
|
var baseOptions = tslib.__assign(tslib.__assign({}, options), { mutation: mutation });
|
|
7042
|
+
var client = executeOptions.client || ref.current.client;
|
|
7032
7043
|
if (!ref.current.result.loading && !baseOptions.ignoreResults && ref.current.isMounted) {
|
|
7033
7044
|
setResult(ref.current.result = {
|
|
7034
7045
|
loading: true,
|