build.gradle 1.8 KB
Newer Older
1 2 3 4
plugins {
    id "java"
    id "idea"
    id "application"
5 6 7 8

    //
    // use the latest available version:
    // https://plugins.gradle.org/plugin/io.github.kobylynskyi.graphql.codegen
9
    id "io.github.kobylynskyi.graphql.codegen" version "2.0.1-SNAPSHOT"
10 11
}

12
mainClassName = "io.github.kobylynskyi.product.Application"
13 14

dependencies {
15 16
    implementation "org.springframework.boot:spring-boot-starter-web:2.2.6.RELEASE"
    implementation "org.springframework.boot:spring-boot-starter-data-mongodb:2.2.6.RELEASE"
17

18 19
    implementation "com.graphql-java-kickstart:graphql-spring-boot-starter:7.0.1"
    implementation "com.graphql-java-kickstart:graphiql-spring-boot-starter:7.0.1"
20

21 22
    implementation "javax.validation:validation-api:2.0.1.Final"

23 24
    implementation "org.mapstruct:mapstruct:1.3.1.Final"
    annotationProcessor "org.mapstruct:mapstruct-processor:1.3.1.Final"
25

26 27
    compileOnly "org.projectlombok:lombok:1.18.12"
    annotationProcessor "org.projectlombok:lombok:1.18.12"
28 29 30 31 32 33 34 35 36
}

compileJava.dependsOn "graphqlCodegen"

sourceSets.main.java.srcDir "$buildDir/generated"

graphqlCodegen {
    graphqlSchemaPaths = ["$projectDir/src/main/resources/schema.graphqls".toString()]
    outputDir = new File("$buildDir/generated")
37 38
    apiPackageName = "io.github.kobylynskyi.product.graphql.api"
    modelPackageName = "io.github.kobylynskyi.product.graphql.model"
39 40 41
    customTypesMapping = [
            DateTime: "java.util.Date"
    ]
42 43 44 45 46 47
    parentInterfaces {
        queryResolver = "graphql.kickstart.tools.GraphQLQueryResolver"
        mutationResolver = "graphql.kickstart.tools.GraphQLMutationResolver"
        subscriptionResolver = "graphql.kickstart.tools.GraphQLSubscriptionResolver"
        resolver = "graphql.kickstart.tools.GraphQLResolver<{{TYPE}}>"
    }
48 49 50 51 52 53 54 55 56
    modelNameSuffix = "TO"
    generateApis = true
}

repositories {
    jcenter()
    mavenCentral()
    mavenLocal()
}