fix: exclude GQL scalar types from the name validation of object and field metadata (#4467)

This commit is contained in:
Mohamed Houssein Douici
2024-03-14 10:41:48 +01:00
committed by GitHub
parent a02e11f81a
commit e0dac82e07

View File

@ -13,7 +13,9 @@ export function IsValidName(validationOptions?: ValidationOptions) {
options: validationOptions,
validator: {
validate(value: any) {
return /^(?!(?:not|or|and)$)[^'\"\\;.=*/]+$/.test(value);
return /^(?!(?:not|or|and|Int|Float|Boolean|String|ID)$)[^'\"\\;.=*/]+$/.test(
value,
);
},
defaultMessage(args: ValidationArguments) {
return `${args.property} has failed the name validation check`;