fix: exclude GQL scalar types from the name validation of object and field metadata (#4467)
This commit is contained in:
committed by
GitHub
parent
a02e11f81a
commit
e0dac82e07
@ -13,7 +13,9 @@ export function IsValidName(validationOptions?: ValidationOptions) {
|
|||||||
options: validationOptions,
|
options: validationOptions,
|
||||||
validator: {
|
validator: {
|
||||||
validate(value: any) {
|
validate(value: any) {
|
||||||
return /^(?!(?:not|or|and)$)[^'\"\\;.=*/]+$/.test(value);
|
return /^(?!(?:not|or|and|Int|Float|Boolean|String|ID)$)[^'\"\\;.=*/]+$/.test(
|
||||||
|
value,
|
||||||
|
);
|
||||||
},
|
},
|
||||||
defaultMessage(args: ValidationArguments) {
|
defaultMessage(args: ValidationArguments) {
|
||||||
return `${args.property} has failed the name validation check`;
|
return `${args.property} has failed the name validation check`;
|
||||||
|
|||||||
Reference in New Issue
Block a user