@graphql-tools/utils 8.5.0-alpha-dbd8abf5.0 → 8.5.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/index.js +3 -3
- package/index.mjs +3 -3
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -1013,10 +1013,10 @@ function astFromScalarType(type, schema, pathToDirectivesInExtensions) {
|
|
|
1013
1013
|
const directives = directivesInExtensions
|
|
1014
1014
|
? makeDirectiveNodes(schema, directivesInExtensions)
|
|
1015
1015
|
: ((_a = type.astNode) === null || _a === void 0 ? void 0 : _a.directives) || [];
|
|
1016
|
-
|
|
1017
|
-
|
|
1016
|
+
const specifiedByValue = (type['specifiedByUrl'] || type['specifiedByURL']);
|
|
1017
|
+
if (specifiedByValue && !directives.some(directiveNode => directiveNode.name.value === 'specifiedBy')) {
|
|
1018
1018
|
const specifiedByArgs = {
|
|
1019
|
-
url:
|
|
1019
|
+
url: specifiedByValue,
|
|
1020
1020
|
};
|
|
1021
1021
|
directives.push(makeDirectiveNode('specifiedBy', specifiedByArgs));
|
|
1022
1022
|
}
|
package/index.mjs
CHANGED
|
@@ -1009,10 +1009,10 @@ function astFromScalarType(type, schema, pathToDirectivesInExtensions) {
|
|
|
1009
1009
|
const directives = directivesInExtensions
|
|
1010
1010
|
? makeDirectiveNodes(schema, directivesInExtensions)
|
|
1011
1011
|
: ((_a = type.astNode) === null || _a === void 0 ? void 0 : _a.directives) || [];
|
|
1012
|
-
|
|
1013
|
-
|
|
1012
|
+
const specifiedByValue = (type['specifiedByUrl'] || type['specifiedByURL']);
|
|
1013
|
+
if (specifiedByValue && !directives.some(directiveNode => directiveNode.name.value === 'specifiedBy')) {
|
|
1014
1014
|
const specifiedByArgs = {
|
|
1015
|
-
url:
|
|
1015
|
+
url: specifiedByValue,
|
|
1016
1016
|
};
|
|
1017
1017
|
directives.push(makeDirectiveNode('specifiedBy', specifiedByArgs));
|
|
1018
1018
|
}
|