@apollo/client 3.2.4 → 3.2.5
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 +11 -12
- package/apollo-client.cjs.js.map +1 -1
- package/apollo-client.cjs.min.js +1 -1
- package/cache/inmemory/policies.d.ts +1 -1
- package/core/LocalState.d.ts.map +1 -1
- package/core/LocalState.js +1 -1
- package/core/LocalState.js.map +1 -1
- package/core/core.cjs.js +3 -3
- package/core/core.cjs.js.map +1 -1
- package/invariantErrorCodes.js +1 -1
- package/link/core/types.d.ts +1 -2
- package/link/core/types.d.ts.map +1 -1
- package/link/core/types.js.map +1 -1
- package/link/http/http.cjs.js +2 -2
- package/link/http/http.cjs.js.map +1 -1
- package/link/http/selectHttpOptionsAndBody.js +1 -1
- package/link/http/selectHttpOptionsAndBody.js.map +1 -1
- package/link/persisted-queries/index.js +1 -1
- package/link/persisted-queries/index.js.map +1 -1
- package/link/persisted-queries/persisted-queries.cjs.js +2 -2
- package/link/persisted-queries/persisted-queries.cjs.js.map +1 -1
- package/link/schema/index.d.ts +1 -1
- package/link/schema/index.d.ts.map +1 -1
- package/link/schema/index.js +1 -1
- package/link/schema/index.js.map +1 -1
- package/link/schema/schema.cjs.js +2 -2
- package/link/schema/schema.cjs.js.map +1 -1
- package/package.json +9 -9
- package/testing/testing.cjs.js +3 -3
- package/testing/testing.cjs.js.map +1 -1
- package/utilities/graphql/directives.d.ts.map +1 -1
- package/utilities/graphql/directives.js +1 -1
- package/utilities/graphql/directives.js.map +1 -1
- package/utilities/graphql/transform.d.ts.map +1 -1
- package/utilities/graphql/transform.js +1 -1
- package/utilities/graphql/transform.js.map +1 -1
- package/utilities/testing/mocking/mockLink.js +1 -1
- package/utilities/testing/mocking/mockLink.js.map +1 -1
- package/utilities/utilities.cjs.js +8 -8
- package/utilities/utilities.cjs.js.map +1 -1
package/apollo-client.cjs.js
CHANGED
|
@@ -6,11 +6,10 @@ function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'defau
|
|
|
6
6
|
|
|
7
7
|
var tslib = require('tslib');
|
|
8
8
|
var tsInvariant = require('ts-invariant');
|
|
9
|
-
var
|
|
9
|
+
var graphql = require('graphql');
|
|
10
10
|
var stringify = _interopDefault(require('fast-json-stable-stringify'));
|
|
11
11
|
var Observable = _interopDefault(require('zen-observable'));
|
|
12
12
|
require('symbol-observable');
|
|
13
|
-
var printer = require('graphql/language/printer');
|
|
14
13
|
var equality = require('@wry/equality');
|
|
15
14
|
var optimism = require('optimism');
|
|
16
15
|
var context = require('@wry/context');
|
|
@@ -38,7 +37,7 @@ function shouldInclude(_a, variables) {
|
|
|
38
37
|
}
|
|
39
38
|
function getDirectiveNames(root) {
|
|
40
39
|
var names = [];
|
|
41
|
-
|
|
40
|
+
graphql.visit(root, {
|
|
42
41
|
Directive: function (node) {
|
|
43
42
|
names.push(node.name.value);
|
|
44
43
|
},
|
|
@@ -434,7 +433,7 @@ function removeDirectivesFromDocument(directives, doc) {
|
|
|
434
433
|
var variablesToRemove = [];
|
|
435
434
|
var fragmentSpreadsInUse = Object.create(null);
|
|
436
435
|
var fragmentSpreadsToRemove = [];
|
|
437
|
-
var modifiedDoc = nullIfDocIsEmpty(
|
|
436
|
+
var modifiedDoc = nullIfDocIsEmpty(graphql.visit(doc, {
|
|
438
437
|
Variable: {
|
|
439
438
|
enter: function (node, _key, parent) {
|
|
440
439
|
if (parent.kind !== 'VariableDefinition') {
|
|
@@ -495,7 +494,7 @@ function removeDirectivesFromDocument(directives, doc) {
|
|
|
495
494
|
return modifiedDoc;
|
|
496
495
|
}
|
|
497
496
|
function addTypenameToDocument(doc) {
|
|
498
|
-
return
|
|
497
|
+
return graphql.visit(checkDocument(doc), {
|
|
499
498
|
SelectionSet: {
|
|
500
499
|
enter: function (node, _key, parent) {
|
|
501
500
|
if (parent &&
|
|
@@ -557,7 +556,7 @@ function getArgumentMatcher(config) {
|
|
|
557
556
|
}
|
|
558
557
|
function removeArgumentsFromDocument(config, doc) {
|
|
559
558
|
var argMatcher = getArgumentMatcher(config);
|
|
560
|
-
return nullIfDocIsEmpty(
|
|
559
|
+
return nullIfDocIsEmpty(graphql.visit(doc, {
|
|
561
560
|
OperationDefinition: {
|
|
562
561
|
enter: function (node) {
|
|
563
562
|
return tslib.__assign(tslib.__assign({}, node), { variableDefinitions: node.variableDefinitions ? node.variableDefinitions.filter(function (varDef) {
|
|
@@ -598,7 +597,7 @@ function removeFragmentSpreadFromDocument(config, doc) {
|
|
|
598
597
|
return null;
|
|
599
598
|
}
|
|
600
599
|
}
|
|
601
|
-
return nullIfDocIsEmpty(
|
|
600
|
+
return nullIfDocIsEmpty(graphql.visit(doc, {
|
|
602
601
|
FragmentSpread: { enter: enter },
|
|
603
602
|
FragmentDefinition: { enter: enter },
|
|
604
603
|
}));
|
|
@@ -622,7 +621,7 @@ function buildQueryFromSelectionSet(document) {
|
|
|
622
621
|
if (definitionOperation === 'query') {
|
|
623
622
|
return document;
|
|
624
623
|
}
|
|
625
|
-
var modifiedDoc =
|
|
624
|
+
var modifiedDoc = graphql.visit(document, {
|
|
626
625
|
OperationDefinition: {
|
|
627
626
|
enter: function (node) {
|
|
628
627
|
return tslib.__assign(tslib.__assign({}, node), { operation: 'query' });
|
|
@@ -640,7 +639,7 @@ function removeClientSetsFromDocument(document) {
|
|
|
640
639
|
},
|
|
641
640
|
], document);
|
|
642
641
|
if (modifiedDoc) {
|
|
643
|
-
modifiedDoc =
|
|
642
|
+
modifiedDoc = graphql.visit(modifiedDoc, {
|
|
644
643
|
FragmentDefinition: {
|
|
645
644
|
enter: function (node) {
|
|
646
645
|
if (node.selectionSet) {
|
|
@@ -1291,7 +1290,7 @@ var selectHttpOptionsAndBody = function (operation, fallbackConfig) {
|
|
|
1291
1290
|
if (http.includeExtensions)
|
|
1292
1291
|
body.extensions = extensions;
|
|
1293
1292
|
if (http.includeQuery)
|
|
1294
|
-
body.query =
|
|
1293
|
+
body.query = graphql.print(query);
|
|
1295
1294
|
return {
|
|
1296
1295
|
options: options,
|
|
1297
1296
|
body: body,
|
|
@@ -3664,7 +3663,7 @@ var LocalState = (function () {
|
|
|
3664
3663
|
};
|
|
3665
3664
|
LocalState.prototype.shouldForceResolvers = function (document) {
|
|
3666
3665
|
var forceResolvers = false;
|
|
3667
|
-
|
|
3666
|
+
graphql.visit(document, {
|
|
3668
3667
|
Directive: {
|
|
3669
3668
|
enter: function (node) {
|
|
3670
3669
|
if (node.name.value === 'client' && node.arguments) {
|
|
@@ -3674,7 +3673,7 @@ var LocalState = (function () {
|
|
|
3674
3673
|
arg.value.value === true;
|
|
3675
3674
|
});
|
|
3676
3675
|
if (forceResolvers) {
|
|
3677
|
-
return
|
|
3676
|
+
return graphql.BREAK;
|
|
3678
3677
|
}
|
|
3679
3678
|
}
|
|
3680
3679
|
},
|