-
Notifications
You must be signed in to change notification settings - Fork 121
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
[Feature Request] Access properties using Maps (ferry_generator) #577
Comments
I don't really understand what you are trying to do here. Specifically:
|
The schema is really big and I don't think this is important here.
This just converts from
Just access the value in the previous example (for example: abc or 123).
Didn't know it even existed, there's no mention on the examples or in the official documentation. Can you provide me an example? Thanks!
Well didn't know about this either. Can you provide an example? Thank you for your answer, anyway |
ferry uses built_value for serialization. All generated request- data and variable classes can be serialized and deserialized from and to json.
is just a request that takes a raw graphql document, takes in json variables and returns json. |
Accessing generated code members via a Map should be feasible. For example, in my current project, I'm utilizing 'proto_grid' for table management. This tool enables column filtering using various criteria such as "Greater than", "Contains", "Equals to", etc. Consequently, for each column that is available, I find myself manually scripting a filter like so:
Hence, the feature request aims to provide a Map<String, TComparisonExpBuilder> or a similar construct (like overriding the [] operator with a set of if-else statements) to enable this kind of access:
I understand this approach might lead to some type errors, but I am willing to consider a dynamic type and perform manual casting, like this:
An alternative, albeit less elegant, solution I've considered is the following, which aims to avoid manually setting all the fields:
However, this method still requires manual verification of each filter's existence, similar to the first example. I think it's possible to better use code generation for those use-cases.
Thank you!
The text was updated successfully, but these errors were encountered: