Skip to content

Commit bef640b

Browse files
committed
unit test
1 parent 086877e commit bef640b

File tree

3 files changed

+61
-0
lines changed

3 files changed

+61
-0
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import { GraphQLKotlinCodegenConfig } from "../../../src/plugin";
2+
3+
export default {
4+
namingConvention: "keep",
5+
} satisfies GraphQLKotlinCodegenConfig;
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
package com.kotlin.generated
2+
3+
import com.expediagroup.graphql.generator.annotations.*
4+
5+
@GraphQLValidObjectLocations(locations = [GraphQLValidObjectLocations.Locations.OBJECT])
6+
data class TypeWithHardKotlinKeywords(
7+
val `as`: String? = null,
8+
val `break`: String? = null,
9+
val `is`: String? = null
10+
)
11+
12+
@GraphQLValidObjectLocations(locations = [GraphQLValidObjectLocations.Locations.INPUT_OBJECT])
13+
data class InputWithHardKotlinKeywords(
14+
val `continue`: String? = null,
15+
val `class`: String? = null,
16+
val `do`: String? = null
17+
)
18+
19+
enum class EnumWithHardKotlinKeywords {
20+
`fun`,
21+
`package`,
22+
`val`;
23+
24+
companion object {
25+
fun findByName(name: String, ignoreCase: Boolean = false): EnumWithHardKotlinKeywords? = values().find { it.name.equals(name, ignoreCase = ignoreCase) }
26+
}
27+
}
28+
29+
interface InterfaceWithHardKotlinKeywords {
30+
val `null`: String?
31+
val `return`: String?
32+
val `this`: String?
33+
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
type TypeWithHardKotlinKeywords {
2+
as: String
3+
break: String
4+
is: String
5+
}
6+
7+
input InputWithHardKotlinKeywords {
8+
continue: String
9+
class: String
10+
do: String
11+
}
12+
13+
enum EnumWithHardKotlinKeywords {
14+
fun
15+
package
16+
val
17+
}
18+
19+
interface InterfaceWithHardKotlinKeywords {
20+
null: String
21+
return: String
22+
super: String
23+
}

0 commit comments

Comments
 (0)