diff --git a/7. Deep Dive into GraphQL Type System.md b/7. Deep Dive into GraphQL Type System.md index 4dc336c..f319ba2 100644 --- a/7. Deep Dive into GraphQL Type System.md +++ b/7. Deep Dive into GraphQL Type System.md @@ -386,6 +386,11 @@ var ValidateStringType = (params) => { return value; }, parseValue: value => { + if(params.regex !== null) { + if(!params.regex.test(value)) { + throw new GraphQLError(`Query error: Not a valid ${params.name}`); + } + } return value; }, parseLiteral: ast => {