grooviter / gql

Groovy GraphQL library
http://grooviter.github.io/gql/
Apache License 2.0
49 stars 6 forks source link

Missing DSL.buildMutation #24

Closed mariogarcia closed 5 years ago

mariogarcia commented 5 years ago

Regarding the mutations, I think having something like this might work:

String buildMutation(Closure c) {
    "mutation ${DSL.buildQuery(c)}"
}

Originally posted by @fedepia in https://github.com/grooviter/gql/issues/22#issuecomment-460605695

mariogarcia commented 5 years ago

Ok, almost done. It required a little bit of refactoring. Although your solution were close, but it didn't have in mind that the DSL should recognize statically that under buildMutation you can add n mutation nodes, and that required a little more work to do.