grooviter / gql

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

Add enum type creation to DSL #10

Closed mariogarcia closed 7 years ago

mariogarcia commented 7 years ago

Example:

DSL.enum('Countries') {
    description 'EU countries'

    value 'SPAIN', 'es'
    value 'ITALY', 'it'
}

It seems that if you declare a method like:

def 'enum'(String name, Closure dsl) {
   // implementation
}

Then you can call enum('Countries') { }