Skip to content


Repository files navigation

license main Maven Central Sonatype Nexus (Snapshots)


GQL is a set of Groovy DSLs and AST transformations built on top of GraphQL-java that make it easier to build GraphQL schemas and execute GraphQL queries without losing type safety.


In order to use GQL releases in your Groovy code add the maven central repository and if you'd like to evaluate some snapshots add the sonatype snapshots repository as well:

repositories {
    maven { url '' } // FOR SNAPSHOTS

Once you've declared the maven repositories then add the dependencies to your project:

dependencies {
    implementation 'com.github.grooviter:gql-core:VERSION'
    implementation 'com.github.grooviter:gql-ratpack:VERSION'

Getting Started

You can directly execute the following example in your Groovy console:

import gql.DSL

def GraphQLFilm = DSL.type('Film') {
  field 'title', GraphQLString
  field 'year', GraphQLInt

def schema = DSL.schema {
  queries {
    field('lastFilm') {
      type GraphQLFilm
      staticValue(title: 'SPECTRE', year: 2015)

def query = """
    lastFilm {

def result = DSL.newExecutor(schema).execute(query)

assert == 2015
assert == 'SPECTRE'


Current documentation is available at: