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

Optional children based on boolean field #1036

Closed
s-vakulenko opened this issue May 29, 2020 · 1 comment
Closed

Optional children based on boolean field #1036

s-vakulenko opened this issue May 29, 2020 · 1 comment

Comments

@s-vakulenko
Copy link

Tell me please if it's possible to achieve. I have two entities:

parentEntity:
    ...
   someBool: <boolean(50)>
   ....

childEntity:
   ....

My goal is to generate from 1 to 3 childEntities only for those parentEntities who have true value for someBool field. I've tried this way:

parentEntity:
    ...
   someBool: <boolean(50)>
   children: '@self->someBool ? <numberBetween(1,3)>x @childEntity*'
   ....

childEntity:
   ....

But got the following error:
Invalid token "@self->someBool ? <numberBetween(1,3)>x @childEntity*" found.

@theofidry
Copy link
Member

I think the reasoning is good but it appears it is yet another limitation of the current lexer, see #998 for more information

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

2 participants