diff --git a/kgql-gradle-plugin/src/main/kotlin/com/codingfeline/kgql/gradle/KgqlTask.kt b/kgql-gradle-plugin/src/main/kotlin/com/codingfeline/kgql/gradle/KgqlTask.kt index 4f13a45..bdd7573 100644 --- a/kgql-gradle-plugin/src/main/kotlin/com/codingfeline/kgql/gradle/KgqlTask.kt +++ b/kgql-gradle-plugin/src/main/kotlin/com/codingfeline/kgql/gradle/KgqlTask.kt @@ -67,7 +67,7 @@ open class KgqlTask : SourceTask() { } private fun filterEnum(type: Map): Boolean { - return (type["kind"] as String).toLowerCase() == "ENUM" + return (type["kind"] as String).toUpperCase() == "ENUM" } @Suppress("UNCHECKED_CAST") diff --git a/kgql-gradle-plugin/src/test/kotlin-mpp/build.gradle b/kgql-gradle-plugin/src/test/kotlin-mpp/build.gradle index 1525bdc..93d0947 100644 --- a/kgql-gradle-plugin/src/test/kotlin-mpp/build.gradle +++ b/kgql-gradle-plugin/src/test/kotlin-mpp/build.gradle @@ -18,7 +18,8 @@ repositories { kgql { packageName = "com.sample" typeMapper = [ - "UserProfile": "com.sample.data.UserProfile" + "UserProfile" : "com.sample.data.UserProfile", + "CollaboratorAffiliation": "com.sample.data.CollaboratorAffiliation" ] } diff --git a/kgql-gradle-plugin/src/test/kotlin-mpp/src/commonMain/kotlin/com/sample/data/CollaboratorAffiliation.kt b/kgql-gradle-plugin/src/test/kotlin-mpp/src/commonMain/kotlin/com/sample/data/CollaboratorAffiliation.kt new file mode 100644 index 0000000..54dea0e --- /dev/null +++ b/kgql-gradle-plugin/src/test/kotlin-mpp/src/commonMain/kotlin/com/sample/data/CollaboratorAffiliation.kt @@ -0,0 +1,5 @@ +package com.sample.data + +enum class CollaboratorAffiliation { + OUTSIDE, DIRECT, ALL +} diff --git a/kgql-gradle-plugin/src/test/kotlin-mpp/src/main/kgql/com/sample/QueryWithParam.graphql b/kgql-gradle-plugin/src/test/kotlin-mpp/src/main/kgql/com/sample/QueryWithParam.graphql index 429ef3f..65fcc6c 100644 --- a/kgql-gradle-plugin/src/test/kotlin-mpp/src/main/kgql/com/sample/QueryWithParam.graphql +++ b/kgql-gradle-plugin/src/test/kotlin-mpp/src/main/kgql/com/sample/QueryWithParam.graphql @@ -1,21 +1,24 @@ query User( - $login: String!, - $name: Int, - $id: String = "", - $company: String = null, - $foo: Float, - $logins: [String]) { - user(login: $login) { - id - login - bio - avatarUrl - company - createdAt - } + $login: String!, + $name: Int, + $id: String = "", + $company: String = null, + $foo: Float, + $logins: [String]) { + user(login: $login) { + id + login + bio + avatarUrl + company + createdAt + } } -mutation withArbitraryType($user: UserProfile) { +mutation withArbitraryType( + $user: UserProfile, + $affiliation: CollaboratorAffiliation +) { user(login: $login) { id login @@ -23,5 +26,5 @@ mutation withArbitraryType($user: UserProfile) { avatarUrl company createdAt - } + } }