americanexpress / nodes

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

Could GraphQLRequestEntity make setRequestMethod as public method? #55

Closed WaterZhang closed 5 years ago

WaterZhang commented 5 years ago

Our team use this framework to compose query of GraphQL API call. I saw setRequestMethod method in GraphQLRequestEntity is access only package and GraphQLTemplate call it and change request method. For our program, we use Feign+Hystrix as http call. That means we only use Nodes to compose query. For my understanding, it is not enough to change setRequestMethod as public method. All initial process finish in GraphQLRequestEntity constructor method. could expose set up requestMethod (query or mutate) in builder?

WaterZhang commented 5 years ago

should expose builder method to set up requestMethod (query or mutate)?

chemdrew commented 5 years ago

Adding this to the builder sounds like an excellent idea!

WaterZhang commented 5 years ago

Could I give pull request or you could make it change and release new version?

chemdrew commented 5 years ago

I will absolutely take the change in a pull request! Otherwise I can make the change fairly quickly either tomorrow or Saturday

WaterZhang commented 5 years ago

great, thanks for your quick response.

chemdrew commented 5 years ago

Alright, just released v0.4.0 which should allow you to set the request method in the builder or on the GraphQLRequestEntity instance so you can build the correct query without executing the fetch