Open lukcz opened 7 years ago
Have you checked this issue? @cmelchior will have to correct me in case I'm wrong, but as far as I know, setting a custom depth is not supported by design. Quoting the above issue:
... Another alternative would be to provide some form of configuration option for it, but I would prefer to keep this lib as no-config as possible.
Check the pull request that added support links for fields to get more insight.
I'm in a case where I need to request like query.equalTo('x.y.z', myValue)
A depth more than 1 would be nice ;)
Instead of setting an explicit depth (which is not favored by @cmelchior, see comment on #4 as it would introduce options to the library), one could just generate the fields indefinitely, i.e. until there is no further reference or a cyclic reference would be created. For the latter one just would have to check if the field to be referenced is already present in the chain of references.
Frankly, I don't see how this code (edit: no longer visible) does its magic @AnixPasBesoin, because e.g. FooFileds.BAR.ID
yields "id" where it would have to be "bar.id".
Now I feel ashamed haha! Yup, you're complety right, this doesn't solve anything!
Is it possible to set custom depth of generated fields?