@omnigraph/json-schema 0.102.2 → 0.102.3
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.
|
@@ -509,8 +509,17 @@ function getComposerFromJSONSchema({ subgraphName, schema, logger, getScalarForF
|
|
|
509
509
|
deprecated: subSchema.deprecated,
|
|
510
510
|
};
|
|
511
511
|
}
|
|
512
|
-
if (subSchema.minLength || subSchema.maxLength) {
|
|
512
|
+
if (subSchema.minLength != null || subSchema.maxLength != null) {
|
|
513
513
|
schemaComposer.addDirective(directives_js_1.LengthDirective);
|
|
514
|
+
const lengthArgs = {
|
|
515
|
+
subgraph: subgraphName,
|
|
516
|
+
};
|
|
517
|
+
if (subSchema.minLength != null) {
|
|
518
|
+
lengthArgs.min = subSchema.minLength;
|
|
519
|
+
}
|
|
520
|
+
if (subSchema.maxLength != null) {
|
|
521
|
+
lengthArgs.max = subSchema.maxLength;
|
|
522
|
+
}
|
|
514
523
|
const typeComposer = schemaComposer.createScalarTC({
|
|
515
524
|
name: (0, getValidTypeName_js_1.getValidTypeName)({
|
|
516
525
|
schemaComposer,
|
|
@@ -521,11 +530,7 @@ function getComposerFromJSONSchema({ subgraphName, schema, logger, getScalarForF
|
|
|
521
530
|
directives: [
|
|
522
531
|
{
|
|
523
532
|
name: 'length',
|
|
524
|
-
args:
|
|
525
|
-
subgraph: subgraphName,
|
|
526
|
-
min: subSchema.minLength,
|
|
527
|
-
max: subSchema.maxLength,
|
|
528
|
-
},
|
|
533
|
+
args: lengthArgs,
|
|
529
534
|
},
|
|
530
535
|
],
|
|
531
536
|
});
|
|
@@ -506,8 +506,17 @@ export function getComposerFromJSONSchema({ subgraphName, schema, logger, getSca
|
|
|
506
506
|
deprecated: subSchema.deprecated,
|
|
507
507
|
};
|
|
508
508
|
}
|
|
509
|
-
if (subSchema.minLength || subSchema.maxLength) {
|
|
509
|
+
if (subSchema.minLength != null || subSchema.maxLength != null) {
|
|
510
510
|
schemaComposer.addDirective(LengthDirective);
|
|
511
|
+
const lengthArgs = {
|
|
512
|
+
subgraph: subgraphName,
|
|
513
|
+
};
|
|
514
|
+
if (subSchema.minLength != null) {
|
|
515
|
+
lengthArgs.min = subSchema.minLength;
|
|
516
|
+
}
|
|
517
|
+
if (subSchema.maxLength != null) {
|
|
518
|
+
lengthArgs.max = subSchema.maxLength;
|
|
519
|
+
}
|
|
511
520
|
const typeComposer = schemaComposer.createScalarTC({
|
|
512
521
|
name: getValidTypeName({
|
|
513
522
|
schemaComposer,
|
|
@@ -518,11 +527,7 @@ export function getComposerFromJSONSchema({ subgraphName, schema, logger, getSca
|
|
|
518
527
|
directives: [
|
|
519
528
|
{
|
|
520
529
|
name: 'length',
|
|
521
|
-
args:
|
|
522
|
-
subgraph: subgraphName,
|
|
523
|
-
min: subSchema.minLength,
|
|
524
|
-
max: subSchema.maxLength,
|
|
525
|
-
},
|
|
530
|
+
args: lengthArgs,
|
|
526
531
|
},
|
|
527
532
|
],
|
|
528
533
|
});
|