Skip to content

Commit b29cbdd

Browse files
committed
feat: Updated GraphQLEnumType
Added shortcut extension function `value`
1 parent 40ea279 commit b29cbdd

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

src/main/kotlin/GraphQLEnumType.kt

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,18 @@ inline fun <T> GraphQLEnumType(
6060
return builder.build()
6161
}
6262

63+
/**
64+
* Define a value for this enum type.
65+
*
66+
* @since 1.0.0
67+
*/
68+
fun <T : Enum<T>> GraphQLEnumTypeBuilder<T>.value(
69+
enum: T,
70+
block: GraphQLEnumValueDefinitionBuilder<T>.() -> Unit = {}
71+
) {
72+
value(enum.name, enum, block)
73+
}
74+
6375
/**
6476
* Define a value for this enum type.
6577
*

0 commit comments

Comments
 (0)