@wundergraph/composition 0.26.2 → 0.27.1
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/dist/ast/utils.d.ts +1 -1
- package/dist/ast/utils.js +22 -22
- package/dist/ast/utils.js.map +1 -1
- package/dist/buildASTSchema/buildASTSchema.js +1 -2
- package/dist/buildASTSchema/buildASTSchema.js.map +1 -1
- package/dist/buildASTSchema/extendSchema.js +3 -3
- package/dist/buildASTSchema/extendSchema.js.map +1 -1
- package/dist/errors/errors.js +128 -130
- package/dist/errors/errors.js.map +1 -1
- package/dist/federation/federation-factory.d.ts +3 -3
- package/dist/federation/federation-factory.js +26 -18
- package/dist/federation/federation-factory.js.map +1 -1
- package/dist/federation/utils.d.ts +12 -1
- package/dist/federation/utils.js +2 -3
- package/dist/federation/utils.js.map +1 -1
- package/dist/federation/walkers.js +1 -2
- package/dist/federation/walkers.js.map +1 -1
- package/dist/normalization/normalization-factory.d.ts +3 -3
- package/dist/normalization/normalization-factory.js +10 -10
- package/dist/normalization/normalization-factory.js.map +1 -1
- package/dist/normalization/utils.js +8 -9
- package/dist/normalization/utils.js.map +1 -1
- package/dist/normalization/walkers.js +3 -4
- package/dist/normalization/walkers.js.map +1 -1
- package/dist/schema-building/ast.js +13 -14
- package/dist/schema-building/ast.js.map +1 -1
- package/dist/schema-building/type-merging.js +3 -4
- package/dist/schema-building/type-merging.js.map +1 -1
- package/dist/schema-building/utils.js +55 -56
- package/dist/schema-building/utils.js.map +1 -1
- package/dist/subgraph/subgraph.js +1 -2
- package/dist/subgraph/subgraph.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/utils/utils.d.ts +3 -4
- package/dist/utils/utils.js +34 -34
- package/dist/utils/utils.js.map +1 -1
- package/dist/warnings/warnings.js +1 -2
- package/dist/warnings/warnings.js.map +1 -1
- package/package.json +5 -5
|
@@ -1,6 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.getMutableDirectiveDefinitionNode = getMutableDirectiveDefinitionNode;
|
|
4
|
+
exports.getMutableEnumNode = getMutableEnumNode;
|
|
5
|
+
exports.getMutableEnumValueNode = getMutableEnumValueNode;
|
|
6
|
+
exports.getMutableFieldNode = getMutableFieldNode;
|
|
7
|
+
exports.getMutableInputObjectNode = getMutableInputObjectNode;
|
|
8
|
+
exports.getMutableInputValueNode = getMutableInputValueNode;
|
|
9
|
+
exports.getMutableInterfaceNode = getMutableInterfaceNode;
|
|
10
|
+
exports.getMutableObjectNode = getMutableObjectNode;
|
|
11
|
+
exports.getMutableObjectExtensionNode = getMutableObjectExtensionNode;
|
|
12
|
+
exports.getMutableScalarNode = getMutableScalarNode;
|
|
13
|
+
exports.getMutableTypeNode = getMutableTypeNode;
|
|
14
|
+
exports.getMutableUnionNode = getMutableUnionNode;
|
|
15
|
+
exports.getTypeNodeNamedTypeName = getTypeNodeNamedTypeName;
|
|
4
16
|
const graphql_1 = require("graphql");
|
|
5
17
|
const utils_1 = require("../ast/utils");
|
|
6
18
|
const errors_1 = require("../errors/errors");
|
|
@@ -15,7 +27,6 @@ function getMutableDirectiveDefinitionNode(node) {
|
|
|
15
27
|
description: (0, utils_1.formatDescription)(node.description),
|
|
16
28
|
};
|
|
17
29
|
}
|
|
18
|
-
exports.getMutableDirectiveDefinitionNode = getMutableDirectiveDefinitionNode;
|
|
19
30
|
function getMutableEnumNode(node) {
|
|
20
31
|
return {
|
|
21
32
|
kind: node.kind,
|
|
@@ -24,7 +35,6 @@ function getMutableEnumNode(node) {
|
|
|
24
35
|
values: node.values?.map((value) => getMutableEnumValueNode(value)),
|
|
25
36
|
};
|
|
26
37
|
}
|
|
27
|
-
exports.getMutableEnumNode = getMutableEnumNode;
|
|
28
38
|
function getMutableEnumValueNode(node) {
|
|
29
39
|
return {
|
|
30
40
|
directives: [],
|
|
@@ -33,7 +43,6 @@ function getMutableEnumValueNode(node) {
|
|
|
33
43
|
description: (0, utils_1.formatDescription)(node.description),
|
|
34
44
|
};
|
|
35
45
|
}
|
|
36
|
-
exports.getMutableEnumValueNode = getMutableEnumValueNode;
|
|
37
46
|
function getMutableFieldNode(node, hostPath, errors) {
|
|
38
47
|
return {
|
|
39
48
|
arguments: [],
|
|
@@ -44,7 +53,6 @@ function getMutableFieldNode(node, hostPath, errors) {
|
|
|
44
53
|
description: (0, utils_1.formatDescription)(node.description),
|
|
45
54
|
};
|
|
46
55
|
}
|
|
47
|
-
exports.getMutableFieldNode = getMutableFieldNode;
|
|
48
56
|
function getMutableInputObjectNode(node) {
|
|
49
57
|
return {
|
|
50
58
|
kind: node.kind,
|
|
@@ -52,7 +60,6 @@ function getMutableInputObjectNode(node) {
|
|
|
52
60
|
description: (0, utils_1.formatDescription)(node.description),
|
|
53
61
|
};
|
|
54
62
|
}
|
|
55
|
-
exports.getMutableInputObjectNode = getMutableInputObjectNode;
|
|
56
63
|
function getMutableInputValueNode(node, hostPath, errors) {
|
|
57
64
|
return {
|
|
58
65
|
directives: [],
|
|
@@ -63,7 +70,6 @@ function getMutableInputValueNode(node, hostPath, errors) {
|
|
|
63
70
|
description: (0, utils_1.formatDescription)(node.description),
|
|
64
71
|
};
|
|
65
72
|
}
|
|
66
|
-
exports.getMutableInputValueNode = getMutableInputValueNode;
|
|
67
73
|
function getMutableInterfaceNode(node) {
|
|
68
74
|
return {
|
|
69
75
|
kind: node.kind,
|
|
@@ -71,7 +77,6 @@ function getMutableInterfaceNode(node) {
|
|
|
71
77
|
description: (0, utils_1.formatDescription)(node.description),
|
|
72
78
|
};
|
|
73
79
|
}
|
|
74
|
-
exports.getMutableInterfaceNode = getMutableInterfaceNode;
|
|
75
80
|
function getMutableObjectNode(node) {
|
|
76
81
|
return {
|
|
77
82
|
kind: node.kind,
|
|
@@ -79,7 +84,6 @@ function getMutableObjectNode(node) {
|
|
|
79
84
|
description: (0, utils_1.formatDescription)(node.description),
|
|
80
85
|
};
|
|
81
86
|
}
|
|
82
|
-
exports.getMutableObjectNode = getMutableObjectNode;
|
|
83
87
|
function getMutableObjectExtensionNode(node) {
|
|
84
88
|
const description = node.kind === graphql_1.Kind.OBJECT_TYPE_DEFINITION ? node.description : undefined;
|
|
85
89
|
return {
|
|
@@ -88,7 +92,6 @@ function getMutableObjectExtensionNode(node) {
|
|
|
88
92
|
description: (0, utils_1.formatDescription)(description),
|
|
89
93
|
};
|
|
90
94
|
}
|
|
91
|
-
exports.getMutableObjectExtensionNode = getMutableObjectExtensionNode;
|
|
92
95
|
function getMutableScalarNode(node) {
|
|
93
96
|
return {
|
|
94
97
|
kind: node.kind,
|
|
@@ -96,7 +99,6 @@ function getMutableScalarNode(node) {
|
|
|
96
99
|
description: (0, utils_1.formatDescription)(node.description),
|
|
97
100
|
};
|
|
98
101
|
}
|
|
99
|
-
exports.getMutableScalarNode = getMutableScalarNode;
|
|
100
102
|
function getMutableTypeNode(node, typePath, errors) {
|
|
101
103
|
const deepCopy = { kind: node.kind };
|
|
102
104
|
let lastTypeNode = deepCopy;
|
|
@@ -125,7 +127,6 @@ function getMutableTypeNode(node, typePath, errors) {
|
|
|
125
127
|
// Return a dummy type when the type has exceeded nesting
|
|
126
128
|
return { kind: graphql_1.Kind.NAMED_TYPE, name: (0, utils_1.stringToNameNode)(getTypeNodeNamedTypeName(node)) };
|
|
127
129
|
}
|
|
128
|
-
exports.getMutableTypeNode = getMutableTypeNode;
|
|
129
130
|
function getMutableUnionNode(node) {
|
|
130
131
|
return {
|
|
131
132
|
kind: node.kind,
|
|
@@ -133,7 +134,6 @@ function getMutableUnionNode(node) {
|
|
|
133
134
|
description: (0, utils_1.formatDescription)(node.description),
|
|
134
135
|
};
|
|
135
136
|
}
|
|
136
|
-
exports.getMutableUnionNode = getMutableUnionNode;
|
|
137
137
|
function getTypeNodeNamedTypeName(typeNode) {
|
|
138
138
|
switch (typeNode.kind) {
|
|
139
139
|
case graphql_1.Kind.NAMED_TYPE:
|
|
@@ -144,5 +144,4 @@ function getTypeNodeNamedTypeName(typeNode) {
|
|
|
144
144
|
return getTypeNodeNamedTypeName(typeNode.type);
|
|
145
145
|
}
|
|
146
146
|
}
|
|
147
|
-
exports.getTypeNodeNamedTypeName = getTypeNodeNamedTypeName;
|
|
148
147
|
//# sourceMappingURL=ast.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ast.js","sourceRoot":"","sources":["../../src/schema-building/ast.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ast.js","sourceRoot":"","sources":["../../src/schema-building/ast.ts"],"names":[],"mappings":";;AAkCA,8EASC;AAUD,gDAOC;AASD,0DAOC;AAWD,kDASC;AAUD,8DAMC;AAWD,4DAaC;AAWD,0DAMC;AAWD,oDAMC;AAWD,sEASC;AASD,oDAMC;AA0BD,gDA2BC;AAUD,kDAMC;AAiBD,4DASC;AA5SD,qCAoBiB;AACjB,wCAAmE;AACnE,6CAAqG;AACrG,kEAAkE;AAWlE,SAAgB,iCAAiC,CAAC,IAA6B;IAC7E,OAAO;QACL,SAAS,EAAE,EAAE;QACb,IAAI,EAAE,IAAI,CAAC,IAAI;QACf,SAAS,EAAE,EAAE;QACb,IAAI,EAAE,EAAE,GAAG,IAAI,CAAC,IAAI,EAAE;QACtB,UAAU,EAAE,IAAI,CAAC,UAAU;QAC3B,WAAW,EAAE,IAAA,yBAAiB,EAAC,IAAI,CAAC,WAAW,CAAC;KACjD,CAAC;AACJ,CAAC;AAUD,SAAgB,kBAAkB,CAAC,IAA4B;IAC7D,OAAO;QACL,IAAI,EAAE,IAAI,CAAC,IAAI;QACf,IAAI,EAAE,EAAE,GAAG,IAAI,CAAC,IAAI,EAAE;QACtB,WAAW,EAAE,IAAA,yBAAiB,EAAC,IAAI,CAAC,WAAW,CAAC;QAChD,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,uBAAuB,CAAC,KAAK,CAAC,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,IAAI,CAAC,IAAI,EAAE;QACtB,WAAW,EAAE,IAAA,yBAAiB,EAAC,IAAI,CAAC,WAAW,CAAC;KACjD,CAAC;AACJ,CAAC;AAiBD,SAAgB,wBAAwB,CAAC,QAAkB;IACzD,QAAQ,QAAQ,CAAC,IAAI,EAAE,CAAC;QACtB,KAAK,cAAI,CAAC,UAAU;YAClB,OAAO,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC;QAC7B,KAAK,cAAI,CAAC,SAAS,CAAC;QACpB,0BAA0B;QAC1B,KAAK,cAAI,CAAC,aAAa;YACrB,OAAO,wBAAwB,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;IACnD,CAAC;AACH,CAAC"}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.getLeastRestrictiveMergedTypeNode = getLeastRestrictiveMergedTypeNode;
|
|
4
|
+
exports.getMostRestrictiveMergedTypeNode = getMostRestrictiveMergedTypeNode;
|
|
5
|
+
exports.renameNamedTypeName = renameNamedTypeName;
|
|
4
6
|
const graphql_1 = require("graphql");
|
|
5
7
|
const errors_1 = require("../errors/errors");
|
|
6
8
|
const ast_1 = require("./ast");
|
|
@@ -88,11 +90,9 @@ function getMergedTypeNode(current, other, hostPath, mostRestrictive, errors) {
|
|
|
88
90
|
function getLeastRestrictiveMergedTypeNode(current, other, hostPath, errors) {
|
|
89
91
|
return getMergedTypeNode(current, other, hostPath, false, errors);
|
|
90
92
|
}
|
|
91
|
-
exports.getLeastRestrictiveMergedTypeNode = getLeastRestrictiveMergedTypeNode;
|
|
92
93
|
function getMostRestrictiveMergedTypeNode(current, other, hostPath, errors) {
|
|
93
94
|
return getMergedTypeNode(current, other, hostPath, true, errors);
|
|
94
95
|
}
|
|
95
|
-
exports.getMostRestrictiveMergedTypeNode = getMostRestrictiveMergedTypeNode;
|
|
96
96
|
function renameNamedTypeName(fieldData, newNamedTypeName, errors) {
|
|
97
97
|
let typeNode = fieldData.type;
|
|
98
98
|
for (let i = 0; i < integer_constants_1.MAXIMUM_TYPE_NESTING; i++) {
|
|
@@ -107,5 +107,4 @@ function renameNamedTypeName(fieldData, newNamedTypeName, errors) {
|
|
|
107
107
|
fieldData.type = { kind: graphql_1.Kind.NAMED_TYPE, name: (0, utils_1.stringToNameNode)(newNamedTypeName) };
|
|
108
108
|
errors.push((0, errors_1.maximumTypeNestingExceededError)(`${fieldData.originalParentTypeName}.${fieldData.name}`));
|
|
109
109
|
}
|
|
110
|
-
exports.renameNamedTypeName = renameNamedTypeName;
|
|
111
110
|
//# sourceMappingURL=type-merging.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"type-merging.js","sourceRoot":"","sources":["../../src/schema-building/type-merging.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"type-merging.js","sourceRoot":"","sources":["../../src/schema-building/type-merging.ts"],"names":[],"mappings":";;AAgGA,8EAOC;AAED,4EAOC;AAED,kDAaC;AA/HD,qCAAuF;AACvF,6CAAmE;AACnE,+BAAwE;AACxE,wCAAgD;AAEhD,kEAAkE;AAElE,IAAK,aAIJ;AAJD,WAAK,aAAa;IAChB,iDAAI,CAAA;IACJ,uDAAO,CAAA;IACP,mDAAK,CAAA;AACP,CAAC,EAJI,aAAa,KAAb,aAAa,QAIjB;AAOD,SAAS,iBAAiB,CACxB,OAAiB,EACjB,KAAe,EACf,QAAgB,EAChB,eAAwB,EACxB,MAAe;IAEf,KAAK,GAAG,IAAA,wBAAkB,EAAC,KAAK,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC,CAAC,iCAAiC;IACtF,mGAAmG;IACnG,iEAAiE;IACjE,sFAAsF;IACtF,MAAM,cAAc,GAAgC,EAAE,IAAI,EAAE,OAAO,CAAC,IAAI,EAAE,CAAC;IAC3E,IAAI,aAAa,GAAG,aAAa,CAAC,IAAI,CAAC;IACvC,IAAI,YAAY,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BAAgB,EAAC,gBAAgB,CAAC,EAAE,CAAC;IACrF,MAAM,CAAC,IAAI,CAAC,IAAA,wCAA+B,EAAC,GAAG,SAAS,CAAC,sBAAsB,IAAI,SAAS,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;AACxG,CAAC"}
|
|
@@ -1,7 +1,59 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.MergeMethod =
|
|
4
|
-
exports.
|
|
3
|
+
exports.MergeMethod = void 0;
|
|
4
|
+
exports.isNodeExternalOrShareable = isNodeExternalOrShareable;
|
|
5
|
+
exports.getDefinedArgumentsForDirective = getDefinedArgumentsForDirective;
|
|
6
|
+
exports.getDirectiveValidationErrors = getDirectiveValidationErrors;
|
|
7
|
+
exports.extractDirectives = extractDirectives;
|
|
8
|
+
exports.extractArguments = extractArguments;
|
|
9
|
+
exports.isTypeRequired = isTypeRequired;
|
|
10
|
+
exports.compareAndValidateInputValueDefaultValues = compareAndValidateInputValueDefaultValues;
|
|
11
|
+
exports.addEnumDefinitionDataByNode = addEnumDefinitionDataByNode;
|
|
12
|
+
exports.addEnumExtensionDataByNode = addEnumExtensionDataByNode;
|
|
13
|
+
exports.addEnumValueDataByNode = addEnumValueDataByNode;
|
|
14
|
+
exports.addInheritedDirectivesToFieldData = addInheritedDirectivesToFieldData;
|
|
15
|
+
exports.addFieldDataByNode = addFieldDataByNode;
|
|
16
|
+
exports.addExtensionWithFieldsDataByNode = addExtensionWithFieldsDataByNode;
|
|
17
|
+
exports.addInputObjectDefinitionDataByNode = addInputObjectDefinitionDataByNode;
|
|
18
|
+
exports.addInputObjectExtensionDataByNode = addInputObjectExtensionDataByNode;
|
|
19
|
+
exports.addInputValueDataByNode = addInputValueDataByNode;
|
|
20
|
+
exports.addInterfaceDefinitionDataByNode = addInterfaceDefinitionDataByNode;
|
|
21
|
+
exports.addObjectDefinitionDataByNode = addObjectDefinitionDataByNode;
|
|
22
|
+
exports.addPersistedDirectiveDefinitionDataByNode = addPersistedDirectiveDefinitionDataByNode;
|
|
23
|
+
exports.setMutualExecutableLocations = setMutualExecutableLocations;
|
|
24
|
+
exports.addScalarDefinitionDataByNode = addScalarDefinitionDataByNode;
|
|
25
|
+
exports.addScalarExtensionDataByNode = addScalarExtensionDataByNode;
|
|
26
|
+
exports.extractUniqueUnionMembers = extractUniqueUnionMembers;
|
|
27
|
+
exports.addUnionDefinitionDataByNode = addUnionDefinitionDataByNode;
|
|
28
|
+
exports.addUnionExtensionDataByNode = addUnionExtensionDataByNode;
|
|
29
|
+
exports.isTypeNameRootType = isTypeNameRootType;
|
|
30
|
+
exports.getRenamedRootTypeName = getRenamedRootTypeName;
|
|
31
|
+
exports.convertKindForExtension = convertKindForExtension;
|
|
32
|
+
exports.extractImplementedInterfaceTypeNames = extractImplementedInterfaceTypeNames;
|
|
33
|
+
exports.getEnumNodeByData = getEnumNodeByData;
|
|
34
|
+
exports.getInputObjectNodeByData = getInputObjectNodeByData;
|
|
35
|
+
exports.getParentWithFieldsNodeByData = getParentWithFieldsNodeByData;
|
|
36
|
+
exports.getScalarNodeByData = getScalarNodeByData;
|
|
37
|
+
exports.getSchemaNodeByData = getSchemaNodeByData;
|
|
38
|
+
exports.getUnionNodeByData = getUnionNodeByData;
|
|
39
|
+
exports.removeInheritableDirectivesFromParentWithFieldsData = removeInheritableDirectivesFromParentWithFieldsData;
|
|
40
|
+
exports.setLongestDescription = setLongestDescription;
|
|
41
|
+
exports.extractPersistedDirectives = extractPersistedDirectives;
|
|
42
|
+
exports.upsertPersistedDirectivesData = upsertPersistedDirectivesData;
|
|
43
|
+
exports.pushAuthorizationDirectives = pushAuthorizationDirectives;
|
|
44
|
+
exports.getClientPersistedDirectiveNodes = getClientPersistedDirectiveNodes;
|
|
45
|
+
exports.getNodeForRouterSchemaByData = getNodeForRouterSchemaByData;
|
|
46
|
+
exports.getNodeWithPersistedDirectivesByFieldData = getNodeWithPersistedDirectivesByFieldData;
|
|
47
|
+
exports.getClientSchemaFieldNodeByFieldData = getClientSchemaFieldNodeByFieldData;
|
|
48
|
+
exports.getNodeWithPersistedDirectivesByInputValueData = getNodeWithPersistedDirectivesByInputValueData;
|
|
49
|
+
exports.getValidFieldArgumentNodes = getValidFieldArgumentNodes;
|
|
50
|
+
exports.addValidPersistedDirectiveDefinitionNodeByData = addValidPersistedDirectiveDefinitionNodeByData;
|
|
51
|
+
exports.isShareabilityOfAllFieldInstancesValid = isShareabilityOfAllFieldInstancesValid;
|
|
52
|
+
exports.isFieldExternalInAllMutualSubgraphs = isFieldExternalInAllMutualSubgraphs;
|
|
53
|
+
exports.isTypeValidImplementation = isTypeValidImplementation;
|
|
54
|
+
exports.isNodeDataInaccessible = isNodeDataInaccessible;
|
|
55
|
+
exports.isLeafKind = isLeafKind;
|
|
56
|
+
exports.getSubscriptionFilterValue = getSubscriptionFilterValue;
|
|
5
57
|
const graphql_1 = require("graphql");
|
|
6
58
|
const ast_1 = require("./ast");
|
|
7
59
|
const utils_1 = require("../ast/utils");
|
|
@@ -39,7 +91,6 @@ function isNodeExternalOrShareable(node, areAllFieldsShareable, directivesByDire
|
|
|
39
91
|
}
|
|
40
92
|
return result;
|
|
41
93
|
}
|
|
42
|
-
exports.isNodeExternalOrShareable = isNodeExternalOrShareable;
|
|
43
94
|
function getDefinedArgumentsForDirective(directiveNode, argumentTypeNodeByArgumentName, requiredArguments, hostPath, errorMessages) {
|
|
44
95
|
const directiveArguments = directiveNode.arguments || [];
|
|
45
96
|
const directiveName = directiveNode.name.value;
|
|
@@ -75,7 +126,6 @@ function getDefinedArgumentsForDirective(directiveNode, argumentTypeNodeByArgume
|
|
|
75
126
|
}
|
|
76
127
|
return definedArguments;
|
|
77
128
|
}
|
|
78
|
-
exports.getDefinedArgumentsForDirective = getDefinedArgumentsForDirective;
|
|
79
129
|
function getDirectiveValidationErrors(directiveNode, hostKind, directivesByDirectiveName, directiveDefinitionByDirectiveName, handledRepeatedDirectivesByHostPath, hostPath, isArgument = false) {
|
|
80
130
|
const directiveName = directiveNode.name.value;
|
|
81
131
|
const directiveDefinition = directiveDefinitionByDirectiveName.get(directiveName) ||
|
|
@@ -118,7 +168,6 @@ function getDirectiveValidationErrors(directiveNode, hostKind, directivesByDirec
|
|
|
118
168
|
}
|
|
119
169
|
return errorMessages;
|
|
120
170
|
}
|
|
121
|
-
exports.getDirectiveValidationErrors = getDirectiveValidationErrors;
|
|
122
171
|
function extractDirectives(node, directivesByDirectiveName, errors, directiveDefinitionByDirectiveName, handledRepeatedDirectivesByHostPath, hostPath, isArgument = false) {
|
|
123
172
|
if (!node.directives) {
|
|
124
173
|
return directivesByDirectiveName;
|
|
@@ -149,7 +198,6 @@ function extractDirectives(node, directivesByDirectiveName, errors, directiveDef
|
|
|
149
198
|
}
|
|
150
199
|
return directivesByDirectiveName;
|
|
151
200
|
}
|
|
152
|
-
exports.extractDirectives = extractDirectives;
|
|
153
201
|
function extractArguments(argumentDataByArgumentName, node, errors, directiveDefinitionByDirectiveName, handledRepeatedDirectivesByHostPath, parentsWithChildArguments, originalParentTypeName, renamedParentTypeName, subgraphName) {
|
|
154
202
|
if (!node.arguments?.length) {
|
|
155
203
|
return argumentDataByArgumentName;
|
|
@@ -172,11 +220,9 @@ function extractArguments(argumentDataByArgumentName, node, errors, directiveDef
|
|
|
172
220
|
}
|
|
173
221
|
return argumentDataByArgumentName;
|
|
174
222
|
}
|
|
175
|
-
exports.extractArguments = extractArguments;
|
|
176
223
|
function isTypeRequired(node) {
|
|
177
224
|
return node.kind === graphql_1.Kind.NON_NULL_TYPE;
|
|
178
225
|
}
|
|
179
|
-
exports.isTypeRequired = isTypeRequired;
|
|
180
226
|
// TODO replace naïve comparison
|
|
181
227
|
function areDefaultValuesCompatible(typeNode, incomingDefaultValue) {
|
|
182
228
|
switch (typeNode.kind) {
|
|
@@ -222,7 +268,6 @@ function compareAndValidateInputValueDefaultValues(existingData, incomingData, e
|
|
|
222
268
|
return;
|
|
223
269
|
}
|
|
224
270
|
}
|
|
225
|
-
exports.compareAndValidateInputValueDefaultValues = compareAndValidateInputValueDefaultValues;
|
|
226
271
|
function addEnumDefinitionDataByNode(parentDefinitionDataByTypeName, node, directivesByDirectiveName) {
|
|
227
272
|
const name = node.name.value;
|
|
228
273
|
parentDefinitionDataByTypeName.set(name, {
|
|
@@ -236,7 +281,6 @@ function addEnumDefinitionDataByNode(parentDefinitionDataByTypeName, node, direc
|
|
|
236
281
|
description: (0, utils_1.formatDescription)(node.description),
|
|
237
282
|
});
|
|
238
283
|
}
|
|
239
|
-
exports.addEnumDefinitionDataByNode = addEnumDefinitionDataByNode;
|
|
240
284
|
function addEnumExtensionDataByNode(parentExtensionDataByTypeName, node, directivesByDirectiveName) {
|
|
241
285
|
const name = node.name.value;
|
|
242
286
|
parentExtensionDataByTypeName.set(name, {
|
|
@@ -246,7 +290,6 @@ function addEnumExtensionDataByNode(parentExtensionDataByTypeName, node, directi
|
|
|
246
290
|
name,
|
|
247
291
|
});
|
|
248
292
|
}
|
|
249
|
-
exports.addEnumExtensionDataByNode = addEnumExtensionDataByNode;
|
|
250
293
|
function addEnumValueDataByNode(enumValueDataByValueName, node, errors, directiveDefinitionByDirectiveName, handledRepeatedDirectivesByHostPath, parentTypeName) {
|
|
251
294
|
const name = node.name.value;
|
|
252
295
|
enumValueDataByValueName.set(name, {
|
|
@@ -259,7 +302,6 @@ function addEnumValueDataByNode(enumValueDataByValueName, node, errors, directiv
|
|
|
259
302
|
description: (0, utils_1.formatDescription)(node.description),
|
|
260
303
|
});
|
|
261
304
|
}
|
|
262
|
-
exports.addEnumValueDataByNode = addEnumValueDataByNode;
|
|
263
305
|
function addInheritedDirectivesToFieldData(parentDirectivesByDirectiveName, fieldDirectivesByDirectiveName) {
|
|
264
306
|
for (const directiveName of constants_1.INHERITABLE_DIRECTIVE_NAMES) {
|
|
265
307
|
if (parentDirectivesByDirectiveName.get(directiveName)) {
|
|
@@ -268,7 +310,6 @@ function addInheritedDirectivesToFieldData(parentDirectivesByDirectiveName, fiel
|
|
|
268
310
|
}
|
|
269
311
|
return fieldDirectivesByDirectiveName;
|
|
270
312
|
}
|
|
271
|
-
exports.addInheritedDirectivesToFieldData = addInheritedDirectivesToFieldData;
|
|
272
313
|
function addFieldDataByNode(fieldDataByFieldName, node, argumentDataByArgumentName, directivesByDirectiveName, originalParentTypeName, renamedParentTypeName, subgraphName, isSubgraphVersionTwo, errors) {
|
|
273
314
|
const name = node.name.value;
|
|
274
315
|
const fieldPath = `${originalParentTypeName}.${name}`;
|
|
@@ -292,7 +333,6 @@ function addFieldDataByNode(fieldDataByFieldName, node, argumentDataByArgumentNa
|
|
|
292
333
|
fieldDataByFieldName.set(name, fieldData);
|
|
293
334
|
return fieldData;
|
|
294
335
|
}
|
|
295
|
-
exports.addFieldDataByNode = addFieldDataByNode;
|
|
296
336
|
function addExtensionWithFieldsDataByNode(parentExtensionDataByTypeName, node, errors, directiveDefinitionByDirectiveName, handledRepeatedDirectivesByHostPath, isEntity, isRootType, subgraphName, renamedTypeName) {
|
|
297
337
|
const name = node.name.value;
|
|
298
338
|
const kind = convertKindForExtension(node);
|
|
@@ -325,7 +365,6 @@ function addExtensionWithFieldsDataByNode(parentExtensionDataByTypeName, node, e
|
|
|
325
365
|
});
|
|
326
366
|
}
|
|
327
367
|
}
|
|
328
|
-
exports.addExtensionWithFieldsDataByNode = addExtensionWithFieldsDataByNode;
|
|
329
368
|
function addInputObjectDefinitionDataByNode(parentDefinitionDataByTypeName, node, directiveDefinitionByDirectiveName, handledRepeatedDirectivesByHostPath, subgraphName, errors) {
|
|
330
369
|
const name = node.name.value;
|
|
331
370
|
const directivesByDirectiveName = extractDirectives(node, new Map(), errors, directiveDefinitionByDirectiveName, handledRepeatedDirectivesByHostPath, name);
|
|
@@ -341,7 +380,6 @@ function addInputObjectDefinitionDataByNode(parentDefinitionDataByTypeName, node
|
|
|
341
380
|
description: (0, utils_1.formatDescription)(node.description),
|
|
342
381
|
});
|
|
343
382
|
}
|
|
344
|
-
exports.addInputObjectDefinitionDataByNode = addInputObjectDefinitionDataByNode;
|
|
345
383
|
function addInputObjectExtensionDataByNode(parentExtensionDataByTypeName, node, directiveDefinitionByDirectiveName, handledRepeatedDirectivesByHostPath, errors) {
|
|
346
384
|
const name = node.name.value;
|
|
347
385
|
parentExtensionDataByTypeName.set(name, {
|
|
@@ -351,7 +389,6 @@ function addInputObjectExtensionDataByNode(parentExtensionDataByTypeName, node,
|
|
|
351
389
|
name,
|
|
352
390
|
});
|
|
353
391
|
}
|
|
354
|
-
exports.addInputObjectExtensionDataByNode = addInputObjectExtensionDataByNode;
|
|
355
392
|
function addInputValueDataByNode(inputValueDataByValueName, node, directiveDefinitionByDirectiveName, handledRepeatedDirectivesByHostPath, originalPath, subgraphName, errors, renamedPath) {
|
|
356
393
|
const name = node.name.value;
|
|
357
394
|
// Only arguments have renamed paths
|
|
@@ -371,11 +408,10 @@ function addInputValueDataByNode(inputValueDataByValueName, node, directiveDefin
|
|
|
371
408
|
requiredSubgraphNames: new Set(isTypeRequired(node.type) ? [subgraphName] : []),
|
|
372
409
|
subgraphNames: new Set([subgraphName]),
|
|
373
410
|
type: (0, ast_1.getMutableTypeNode)(node.type, originalPath, errors),
|
|
374
|
-
defaultValue: node.defaultValue,
|
|
411
|
+
defaultValue: node.defaultValue, // TODO validate
|
|
375
412
|
description: (0, utils_1.formatDescription)(node.description),
|
|
376
413
|
});
|
|
377
414
|
}
|
|
378
|
-
exports.addInputValueDataByNode = addInputValueDataByNode;
|
|
379
415
|
function addInterfaceDefinitionDataByNode(parentDefinitionDataByTypeName, node, errors, directiveDefinitionByDirectiveName, handledRepeatedDirectivesByHostPath, isEntity, subgraphName) {
|
|
380
416
|
const name = node.name.value;
|
|
381
417
|
const directivesByDirectiveName = extractDirectives(node, new Map(), errors, directiveDefinitionByDirectiveName, handledRepeatedDirectivesByHostPath, name);
|
|
@@ -393,7 +429,6 @@ function addInterfaceDefinitionDataByNode(parentDefinitionDataByTypeName, node,
|
|
|
393
429
|
description: (0, utils_1.formatDescription)(node.description),
|
|
394
430
|
});
|
|
395
431
|
}
|
|
396
|
-
exports.addInterfaceDefinitionDataByNode = addInterfaceDefinitionDataByNode;
|
|
397
432
|
function addObjectDefinitionDataByNode(parentDefinitionDataByTypeName, node, errors, directiveDefinitionByDirectiveName, handledRepeatedDirectivesByHostPath, isEntity, isRootType, subgraphName, renamedTypeName) {
|
|
398
433
|
const name = node.name.value;
|
|
399
434
|
const directivesByDirectiveName = extractDirectives(node, new Map(), errors, directiveDefinitionByDirectiveName, handledRepeatedDirectivesByHostPath, name);
|
|
@@ -413,7 +448,6 @@ function addObjectDefinitionDataByNode(parentDefinitionDataByTypeName, node, err
|
|
|
413
448
|
description: (0, utils_1.formatDescription)(node.description),
|
|
414
449
|
});
|
|
415
450
|
}
|
|
416
|
-
exports.addObjectDefinitionDataByNode = addObjectDefinitionDataByNode;
|
|
417
451
|
function addPersistedDirectiveDefinitionDataByNode(persistedDirectiveDefinitionDataByDirectiveName, node, errors, directiveDefinitionByDirectiveName, handledRepeatedDirectivesByHostPath, executableLocations, subgraphName) {
|
|
418
452
|
const name = node.name.value;
|
|
419
453
|
const argumentDataByArgumentName = new Map();
|
|
@@ -430,7 +464,6 @@ function addPersistedDirectiveDefinitionDataByNode(persistedDirectiveDefinitionD
|
|
|
430
464
|
description: (0, utils_1.formatDescription)(node.description),
|
|
431
465
|
});
|
|
432
466
|
}
|
|
433
|
-
exports.addPersistedDirectiveDefinitionDataByNode = addPersistedDirectiveDefinitionDataByNode;
|
|
434
467
|
function setMutualExecutableLocations(persistedDirectiveDefinitionData, incomingExecutableLocations) {
|
|
435
468
|
const mutualExecutableLocations = new Set();
|
|
436
469
|
for (const incomingExecutableLocation of incomingExecutableLocations) {
|
|
@@ -440,7 +473,6 @@ function setMutualExecutableLocations(persistedDirectiveDefinitionData, incoming
|
|
|
440
473
|
}
|
|
441
474
|
persistedDirectiveDefinitionData.executableLocations = mutualExecutableLocations;
|
|
442
475
|
}
|
|
443
|
-
exports.setMutualExecutableLocations = setMutualExecutableLocations;
|
|
444
476
|
function addScalarDefinitionDataByNode(parentDefinitionDataByTypeName, node, directivesByDirectiveName) {
|
|
445
477
|
const name = node.name.value;
|
|
446
478
|
parentDefinitionDataByTypeName.set(name, {
|
|
@@ -452,7 +484,6 @@ function addScalarDefinitionDataByNode(parentDefinitionDataByTypeName, node, dir
|
|
|
452
484
|
description: (0, utils_1.formatDescription)(node.description),
|
|
453
485
|
});
|
|
454
486
|
}
|
|
455
|
-
exports.addScalarDefinitionDataByNode = addScalarDefinitionDataByNode;
|
|
456
487
|
function addScalarExtensionDataByNode(parentExtensionDataByTypeName, node, directivesByDirectiveName) {
|
|
457
488
|
const name = node.name.value;
|
|
458
489
|
parentExtensionDataByTypeName.set(name, {
|
|
@@ -461,7 +492,6 @@ function addScalarExtensionDataByNode(parentExtensionDataByTypeName, node, direc
|
|
|
461
492
|
name,
|
|
462
493
|
});
|
|
463
494
|
}
|
|
464
|
-
exports.addScalarExtensionDataByNode = addScalarExtensionDataByNode;
|
|
465
495
|
function extractUniqueUnionMembers(members, membersByMemberTypeName, errors, unionTypeName, abstractToConcreteTypeNames, referencedTypeNames) {
|
|
466
496
|
for (const member of members) {
|
|
467
497
|
const memberTypeName = member.name.value;
|
|
@@ -483,7 +513,6 @@ function extractUniqueUnionMembers(members, membersByMemberTypeName, errors, uni
|
|
|
483
513
|
}
|
|
484
514
|
return membersByMemberTypeName;
|
|
485
515
|
}
|
|
486
|
-
exports.extractUniqueUnionMembers = extractUniqueUnionMembers;
|
|
487
516
|
function addUnionDefinitionDataByNode(parentDefinitionDataByTypeName, node, errors, directiveDefinitionByDirectiveName, handledRepeatedDirectivesByHostPath, abstractToConcreteTypeNames, referencedTypeNames) {
|
|
488
517
|
const name = node.name.value;
|
|
489
518
|
if (!node.types?.length) {
|
|
@@ -500,7 +529,6 @@ function addUnionDefinitionDataByNode(parentDefinitionDataByTypeName, node, erro
|
|
|
500
529
|
description: (0, utils_1.formatDescription)(node.description),
|
|
501
530
|
});
|
|
502
531
|
}
|
|
503
|
-
exports.addUnionDefinitionDataByNode = addUnionDefinitionDataByNode;
|
|
504
532
|
function addUnionExtensionDataByNode(parentExtensionDataByTypeName, node, errors, directiveDefinitionByDirectiveName, handledRepeatedDirectivesByHostPath, abstractToConcreteTypeNames, referencedTypeNames) {
|
|
505
533
|
const name = node.name.value;
|
|
506
534
|
parentExtensionDataByTypeName.set(name, {
|
|
@@ -512,11 +540,9 @@ function addUnionExtensionDataByNode(parentExtensionDataByTypeName, node, errors
|
|
|
512
540
|
name,
|
|
513
541
|
});
|
|
514
542
|
}
|
|
515
|
-
exports.addUnionExtensionDataByNode = addUnionExtensionDataByNode;
|
|
516
543
|
function isTypeNameRootType(typeName, operationByTypeName) {
|
|
517
544
|
return string_constants_1.ROOT_TYPES.has(typeName) || operationByTypeName.has(typeName);
|
|
518
545
|
}
|
|
519
|
-
exports.isTypeNameRootType = isTypeNameRootType;
|
|
520
546
|
function getRenamedRootTypeName(typeName, operationByTypeName) {
|
|
521
547
|
const operationTypeNode = operationByTypeName.get(typeName);
|
|
522
548
|
if (!operationTypeNode) {
|
|
@@ -531,7 +557,6 @@ function getRenamedRootTypeName(typeName, operationByTypeName) {
|
|
|
531
557
|
return string_constants_1.QUERY;
|
|
532
558
|
}
|
|
533
559
|
}
|
|
534
|
-
exports.getRenamedRootTypeName = getRenamedRootTypeName;
|
|
535
560
|
function convertKindForExtension(node) {
|
|
536
561
|
switch (node.kind) {
|
|
537
562
|
case graphql_1.Kind.INTERFACE_TYPE_DEFINITION:
|
|
@@ -542,7 +567,6 @@ function convertKindForExtension(node) {
|
|
|
542
567
|
return node.kind;
|
|
543
568
|
}
|
|
544
569
|
}
|
|
545
|
-
exports.convertKindForExtension = convertKindForExtension;
|
|
546
570
|
function extractImplementedInterfaceTypeNames(node, implementedInterfaceTypeNames, errors) {
|
|
547
571
|
if (!node.interfaces) {
|
|
548
572
|
return implementedInterfaceTypeNames;
|
|
@@ -558,7 +582,6 @@ function extractImplementedInterfaceTypeNames(node, implementedInterfaceTypeName
|
|
|
558
582
|
}
|
|
559
583
|
return implementedInterfaceTypeNames;
|
|
560
584
|
}
|
|
561
|
-
exports.extractImplementedInterfaceTypeNames = extractImplementedInterfaceTypeNames;
|
|
562
585
|
function addExtensionDirectivesToDefinition(directivesByDirectiveName, parentExtensionData) {
|
|
563
586
|
if (!parentExtensionData) {
|
|
564
587
|
return;
|
|
@@ -675,14 +698,12 @@ function getEnumNodeByData(enumDefinitionData, errors, directiveDefinitionByDire
|
|
|
675
698
|
enumDefinitionData.node.values = childMapToValueArray(enumDefinitionData.enumValueDataByValueName, authorizationDataByParentTypeName);
|
|
676
699
|
return enumDefinitionData.node;
|
|
677
700
|
}
|
|
678
|
-
exports.getEnumNodeByData = getEnumNodeByData;
|
|
679
701
|
function getInputObjectNodeByData(inputObjectDefinitionData, errors, directiveDefinitionByDirectiveName, authorizationDataByParentTypeName, inputObjectExtensionData) {
|
|
680
702
|
addExtensionDirectivesToDefinition(inputObjectDefinitionData.directivesByDirectiveName, inputObjectExtensionData);
|
|
681
703
|
inputObjectDefinitionData.node.directives = getValidFlattenedDirectiveArray(inputObjectDefinitionData.directivesByDirectiveName, errors, directiveDefinitionByDirectiveName, inputObjectDefinitionData.name);
|
|
682
704
|
inputObjectDefinitionData.node.fields = childMapToValueArray(inputObjectDefinitionData.inputValueDataByValueName, authorizationDataByParentTypeName);
|
|
683
705
|
return inputObjectDefinitionData.node;
|
|
684
706
|
}
|
|
685
|
-
exports.getInputObjectNodeByData = getInputObjectNodeByData;
|
|
686
707
|
function getParentWithFieldsNodeByData(parentWithFieldsData, errors, directiveDefinitionByDirectiveName, authorizationDataByParentTypeName, parentExtensionWithFieldsData) {
|
|
687
708
|
addExtensionDirectivesToDefinition(parentWithFieldsData.directivesByDirectiveName, parentExtensionWithFieldsData);
|
|
688
709
|
parentWithFieldsData.node.directives = getValidFlattenedDirectiveArray(parentWithFieldsData.directivesByDirectiveName, errors, directiveDefinitionByDirectiveName, parentWithFieldsData.name);
|
|
@@ -690,13 +711,11 @@ function getParentWithFieldsNodeByData(parentWithFieldsData, errors, directiveDe
|
|
|
690
711
|
parentWithFieldsData.node.interfaces = (0, utils_1.setToNamedTypeNodeArray)(parentWithFieldsData.implementedInterfaceTypeNames);
|
|
691
712
|
return parentWithFieldsData.node;
|
|
692
713
|
}
|
|
693
|
-
exports.getParentWithFieldsNodeByData = getParentWithFieldsNodeByData;
|
|
694
714
|
function getScalarNodeByData(scalarDefinitionData, errors, directiveDefinitionByDirectiveName, scalarExtensionData) {
|
|
695
715
|
addExtensionDirectivesToDefinition(scalarDefinitionData.directivesByDirectiveName, scalarExtensionData);
|
|
696
716
|
scalarDefinitionData.node.directives = getValidFlattenedDirectiveArray(scalarDefinitionData.directivesByDirectiveName, errors, directiveDefinitionByDirectiveName, scalarDefinitionData.name);
|
|
697
717
|
return scalarDefinitionData.node;
|
|
698
718
|
}
|
|
699
|
-
exports.getScalarNodeByData = getScalarNodeByData;
|
|
700
719
|
function getSchemaNodeByData(schemaData, errors, directiveDefinitionByDirectiveName) {
|
|
701
720
|
return {
|
|
702
721
|
description: schemaData.description,
|
|
@@ -705,7 +724,6 @@ function getSchemaNodeByData(schemaData, errors, directiveDefinitionByDirectiveN
|
|
|
705
724
|
operationTypes: (0, utils_3.mapToArrayOfValues)(schemaData.operationTypes),
|
|
706
725
|
};
|
|
707
726
|
}
|
|
708
|
-
exports.getSchemaNodeByData = getSchemaNodeByData;
|
|
709
727
|
function getUnionNodeByData(unionDefinitionData, errors, directiveDefinitionByDirectiveName, unionExtensionData) {
|
|
710
728
|
mergeUniqueUnionMembers(unionDefinitionData, errors, unionExtensionData);
|
|
711
729
|
addExtensionDirectivesToDefinition(unionDefinitionData.directivesByDirectiveName, unionExtensionData);
|
|
@@ -713,13 +731,11 @@ function getUnionNodeByData(unionDefinitionData, errors, directiveDefinitionByDi
|
|
|
713
731
|
unionDefinitionData.node.types = (0, utils_3.mapToArrayOfValues)(unionDefinitionData.memberByMemberTypeName);
|
|
714
732
|
return unionDefinitionData.node;
|
|
715
733
|
}
|
|
716
|
-
exports.getUnionNodeByData = getUnionNodeByData;
|
|
717
734
|
function removeInheritableDirectivesFromParentWithFieldsData(parentData) {
|
|
718
735
|
for (const directiveName of constants_1.INHERITABLE_DIRECTIVE_NAMES) {
|
|
719
736
|
parentData.directivesByDirectiveName.delete(directiveName);
|
|
720
737
|
}
|
|
721
738
|
}
|
|
722
|
-
exports.removeInheritableDirectivesFromParentWithFieldsData = removeInheritableDirectivesFromParentWithFieldsData;
|
|
723
739
|
function setLongestDescription(existingData, incomingData) {
|
|
724
740
|
if (!incomingData.description) {
|
|
725
741
|
return;
|
|
@@ -728,7 +744,6 @@ function setLongestDescription(existingData, incomingData) {
|
|
|
728
744
|
existingData.description = { ...incomingData.description, block: true };
|
|
729
745
|
}
|
|
730
746
|
}
|
|
731
|
-
exports.setLongestDescription = setLongestDescription;
|
|
732
747
|
function upsertDeprecatedDirective(persistedDirectivesData, incomingDirectiveNode) {
|
|
733
748
|
if (!incomingDirectiveNode.arguments?.length) {
|
|
734
749
|
return;
|
|
@@ -773,7 +788,6 @@ function extractPersistedDirectives(persistedDirectivesData, directivesByDirecti
|
|
|
773
788
|
}
|
|
774
789
|
return persistedDirectivesData;
|
|
775
790
|
}
|
|
776
|
-
exports.extractPersistedDirectives = extractPersistedDirectives;
|
|
777
791
|
function upsertPersistedDirectivesData(existingData, incomingData) {
|
|
778
792
|
if (incomingData.isDeprecated && existingData.deprecatedReason.length < incomingData.deprecatedReason.length) {
|
|
779
793
|
existingData.isDeprecated = true;
|
|
@@ -794,7 +808,6 @@ function upsertPersistedDirectivesData(existingData, incomingData) {
|
|
|
794
808
|
existingData.tags.set(tagName, tagDirectiveNode);
|
|
795
809
|
}
|
|
796
810
|
}
|
|
797
|
-
exports.upsertPersistedDirectivesData = upsertPersistedDirectivesData;
|
|
798
811
|
function pushAuthorizationDirectives(fieldData, authorizationData) {
|
|
799
812
|
if (!authorizationData) {
|
|
800
813
|
return;
|
|
@@ -812,7 +825,6 @@ function pushAuthorizationDirectives(fieldData, authorizationData) {
|
|
|
812
825
|
]);
|
|
813
826
|
}
|
|
814
827
|
}
|
|
815
|
-
exports.pushAuthorizationDirectives = pushAuthorizationDirectives;
|
|
816
828
|
function generateDeprecatedDirective(reason) {
|
|
817
829
|
return {
|
|
818
830
|
kind: graphql_1.Kind.DIRECTIVE,
|
|
@@ -873,14 +885,12 @@ function getClientPersistedDirectiveNodes(nodeData) {
|
|
|
873
885
|
}
|
|
874
886
|
return persistedDirectiveNodes;
|
|
875
887
|
}
|
|
876
|
-
exports.getClientPersistedDirectiveNodes = getClientPersistedDirectiveNodes;
|
|
877
888
|
function getNodeForRouterSchemaByData(data, persistedDirectiveDefinitionByDirectiveName, errors) {
|
|
878
889
|
data.node.name = (0, utils_1.stringToNameNode)(data.name);
|
|
879
890
|
data.node.description = data.description;
|
|
880
891
|
data.node.directives = getRouterPersistedDirectiveNodes(data, persistedDirectiveDefinitionByDirectiveName, errors);
|
|
881
892
|
return data.node;
|
|
882
893
|
}
|
|
883
|
-
exports.getNodeForRouterSchemaByData = getNodeForRouterSchemaByData;
|
|
884
894
|
function getNodeWithPersistedDirectivesByFieldData(fieldData, persistedDirectiveDefinitionByDirectiveName, argumentNodes, errors) {
|
|
885
895
|
fieldData.node.arguments = argumentNodes;
|
|
886
896
|
fieldData.node.name = (0, utils_1.stringToNameNode)(fieldData.name);
|
|
@@ -889,7 +899,6 @@ function getNodeWithPersistedDirectivesByFieldData(fieldData, persistedDirective
|
|
|
889
899
|
fieldData.node.directives = getRouterPersistedDirectiveNodes(fieldData, persistedDirectiveDefinitionByDirectiveName, errors);
|
|
890
900
|
return fieldData.node;
|
|
891
901
|
}
|
|
892
|
-
exports.getNodeWithPersistedDirectivesByFieldData = getNodeWithPersistedDirectivesByFieldData;
|
|
893
902
|
function getClientSchemaFieldNodeByFieldData(fieldData) {
|
|
894
903
|
const directives = getClientPersistedDirectiveNodes(fieldData);
|
|
895
904
|
const argumentNodes = [];
|
|
@@ -908,7 +917,6 @@ function getClientSchemaFieldNodeByFieldData(fieldData) {
|
|
|
908
917
|
arguments: argumentNodes,
|
|
909
918
|
};
|
|
910
919
|
}
|
|
911
|
-
exports.getClientSchemaFieldNodeByFieldData = getClientSchemaFieldNodeByFieldData;
|
|
912
920
|
function getNodeWithPersistedDirectivesByInputValueData(inputValueData, persistedDirectiveDefinitionByDirectiveName, errors) {
|
|
913
921
|
inputValueData.node.name = (0, utils_1.stringToNameNode)(inputValueData.name);
|
|
914
922
|
inputValueData.node.type = inputValueData.type;
|
|
@@ -919,7 +927,6 @@ function getNodeWithPersistedDirectivesByInputValueData(inputValueData, persiste
|
|
|
919
927
|
}
|
|
920
928
|
return inputValueData.node;
|
|
921
929
|
}
|
|
922
|
-
exports.getNodeWithPersistedDirectivesByInputValueData = getNodeWithPersistedDirectivesByInputValueData;
|
|
923
930
|
function getValidFieldArgumentNodes(fieldData, persistedDirectiveDefinitionByDirectiveName, fieldConfigurationByFieldPath, errors) {
|
|
924
931
|
const argumentNodes = [];
|
|
925
932
|
const argumentNames = [];
|
|
@@ -951,7 +958,6 @@ function getValidFieldArgumentNodes(fieldData, persistedDirectiveDefinitionByDir
|
|
|
951
958
|
}
|
|
952
959
|
return argumentNodes;
|
|
953
960
|
}
|
|
954
|
-
exports.getValidFieldArgumentNodes = getValidFieldArgumentNodes;
|
|
955
961
|
function addValidatedArgumentNodes(argumentNodes, hostData, persistedDirectiveDefinitionByDirectiveName, errors, argumentNamesForFieldConfiguration) {
|
|
956
962
|
const invalidRequiredArgumentErrors = [];
|
|
957
963
|
for (const [argumentName, argumentData] of hostData.argumentDataByArgumentName) {
|
|
@@ -994,7 +1000,6 @@ function addValidPersistedDirectiveDefinitionNodeByData(definitions, data, persi
|
|
|
994
1000
|
description: data.description,
|
|
995
1001
|
});
|
|
996
1002
|
}
|
|
997
|
-
exports.addValidPersistedDirectiveDefinitionNodeByData = addValidPersistedDirectiveDefinitionNodeByData;
|
|
998
1003
|
function isShareabilityOfAllFieldInstancesValid(fieldData) {
|
|
999
1004
|
let shareableFields = 0;
|
|
1000
1005
|
let unshareableFields = 0;
|
|
@@ -1021,7 +1026,6 @@ function isShareabilityOfAllFieldInstancesValid(fieldData) {
|
|
|
1021
1026
|
}
|
|
1022
1027
|
return true;
|
|
1023
1028
|
}
|
|
1024
|
-
exports.isShareabilityOfAllFieldInstancesValid = isShareabilityOfAllFieldInstancesValid;
|
|
1025
1029
|
function isFieldExternalInAllMutualSubgraphs(subgraphs, fieldData) {
|
|
1026
1030
|
const mutualSubgraphs = (0, utils_3.getAllMutualEntries)(subgraphs, fieldData.subgraphNames);
|
|
1027
1031
|
if (mutualSubgraphs.size < 1) {
|
|
@@ -1036,7 +1040,6 @@ function isFieldExternalInAllMutualSubgraphs(subgraphs, fieldData) {
|
|
|
1036
1040
|
}
|
|
1037
1041
|
return true;
|
|
1038
1042
|
}
|
|
1039
|
-
exports.isFieldExternalInAllMutualSubgraphs = isFieldExternalInAllMutualSubgraphs;
|
|
1040
1043
|
var MergeMethod;
|
|
1041
1044
|
(function (MergeMethod) {
|
|
1042
1045
|
MergeMethod[MergeMethod["UNION"] = 0] = "UNION";
|
|
@@ -1075,15 +1078,12 @@ function isTypeValidImplementation(originalType, implementationType, concreteTyp
|
|
|
1075
1078
|
return false;
|
|
1076
1079
|
}
|
|
1077
1080
|
}
|
|
1078
|
-
exports.isTypeValidImplementation = isTypeValidImplementation;
|
|
1079
1081
|
function isNodeDataInaccessible(data) {
|
|
1080
1082
|
return data.persistedDirectivesData.directives.has(string_constants_1.INACCESSIBLE);
|
|
1081
1083
|
}
|
|
1082
|
-
exports.isNodeDataInaccessible = isNodeDataInaccessible;
|
|
1083
1084
|
function isLeafKind(kind) {
|
|
1084
1085
|
return kind === graphql_1.Kind.SCALAR_TYPE_DEFINITION || kind === graphql_1.Kind.ENUM_TYPE_DEFINITION;
|
|
1085
1086
|
}
|
|
1086
|
-
exports.isLeafKind = isLeafKind;
|
|
1087
1087
|
function getSubscriptionFilterValue(valueNode) {
|
|
1088
1088
|
switch (valueNode.kind) {
|
|
1089
1089
|
case graphql_1.Kind.BOOLEAN: {
|
|
@@ -1110,5 +1110,4 @@ function getSubscriptionFilterValue(valueNode) {
|
|
|
1110
1110
|
}
|
|
1111
1111
|
}
|
|
1112
1112
|
}
|
|
1113
|
-
exports.getSubscriptionFilterValue = getSubscriptionFilterValue;
|
|
1114
1113
|
//# sourceMappingURL=utils.js.map
|