Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting a "Failed to parse String literal at velocity" when having multiple "." in condition (pattern) #3

Open
dabeidl opened this issue Dec 2, 2020 · 1 comment

Comments

@dabeidl
Copy link

dabeidl commented Dec 2, 2020

Error:
Failed to parse String literal at velocity...

GraphQLSchema:
type User @model {
id: ID!
email: String! @Assert(condition: ".matches("[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,4}")")

In vtl, I get
$ctx.args.input.email.matches("[a-z0-9.%+-]+@[a-z0-9$ctx.args.input.email.-]+$ctx.args.input.email[a-z]{2,4}")
instead of
$ctx.args.input.email.matches("[a-z0-9.
%+-]+@[a-z0-9.-]+\.email[a-z]{2,4}")

@dabeidl
Copy link
Author

dabeidl commented Dec 2, 2020

I managed to work around the problem by using \x{002E} instead of .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant