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

Validators in UDTs #189

Open
Cleomir opened this issue Dec 9, 2018 · 0 comments
Open

Validators in UDTs #189

Cleomir opened this issue Dec 9, 2018 · 0 comments

Comments

@Cleomir
Copy link

Cleomir commented Dec 9, 2018

Hello,
I'm trying to define the following UDT:

udts: { address: { street: 'text', city: 'text', postal: 'text', state: 'text', country: 'text', address_type: { type: 'text' rule: { validator(value: string) { return value === 'residential' || value === 'commercial'; } } }, } }

And I'm getting the following error:
apollo.model.save.dberror: Error during save query on DB -> ResponseError: line 1:120 no viable alternative at input '[' (..."state" text,"country" text,"address_type" [[]...)

It's not clear in the documentation if it's possible to define validators inside UDTs or if it's a bug.

@Cleomir Cleomir closed this as completed Dec 9, 2018
@Cleomir Cleomir reopened this Dec 9, 2018
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