americanexpress / nodes

A GraphQL JVM Client - Java, Kotlin, Scala, etc.
Apache License 2.0
307 stars 70 forks source link

Expose Property class for modification #114

Open jpasquers opened 4 years ago

jpasquers commented 4 years ago

As mentioned in one of the first responses to #11 :

"I would be more inclined to expose the Property tree used to construct the query string in the requestEntity"

We have had the need to dynamically modify the query (reduce query/response size without creating POJOs for each use case), and my idea was to 'post process' the Property object after the RequestEntity was built, exactly like you mentioned. At that point, we could remove/modify any of the children as needed. To do this at the very least we would need the Property class visible. In addition, I would prefer to not have to use reflection, and I don't really see a strong reason why the property field shouldn't be visible.

If this is something you're open to, let me know if you would like me to open a PR (I'm not sure if you had a particular approach you wanted to take).