This repository was archived by the owner on May 16, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 84
Enums
Paweł Gutkowski edited this page Jul 28, 2017
·
2 revisions
GraphQL Enums are a variant on the Scalar type, which represents one of a finite set of possible values. They directly map to Kotlin enums
Example
enum class Coolness {
NOT_COOL, COOL, TOTALLY_COOL
}
val schema = KGraphQL.schema {
enum<Coolness>{
description = "State of coolness"
value(Coolness.COOL){
description = "really cool"
}
}
query("cool"){
resolver{ cool: Coolness -> cool.toString() }
}
}Enum values can be deprecated.