Skip to content

Commit

Permalink
:white_checkmark: test for enum serializer
Browse files Browse the repository at this point in the history
  • Loading branch information
yshrsmz committed Jul 19, 2019
1 parent 2b92aec commit 1f7dbd5
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ open class KgqlTask : SourceTask() {
}

private fun filterEnum(type: Map<String, Any>): Boolean {
return (type["kind"] as String).toLowerCase() == "ENUM"
return (type["kind"] as String).toUpperCase() == "ENUM"
}

@Suppress("UNCHECKED_CAST")
Expand Down
3 changes: 2 additions & 1 deletion kgql-gradle-plugin/src/test/kotlin-mpp/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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"
]
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package com.sample.data

enum class CollaboratorAffiliation {
OUTSIDE, DIRECT, ALL
}
Original file line number Diff line number Diff line change
@@ -1,27 +1,30 @@
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
bio
avatarUrl
company
createdAt
}
}
}

0 comments on commit 1f7dbd5

Please sign in to comment.