sealedClassesForEnumsMatching

abstract val sealedClassesForEnumsMatching: ListProperty<String>

A list of Regex patterns for GraphQL enums that should be generated as a Kotlin sealed interface.

This provides several benefits over the default of mapping GraphQL enums to Kotlin enums:

  • the client can access the string value of unknown values (enum values added on the server after the client has been compiled).

  • it introduces an intermediate KNOWN__ type that does not contain the unknown value for the cases where you want to map all unknown values to a known one.

  • it's harder to create instances of UNKNOWN__ values, making it more explicit that those values are dangerous to be used as input.

Only valid when generateKotlinModels is true.

Default: emptyList()