in graphql-dgs-codegen-core/src/main/kotlin/com/netflix/graphql/dgs/codegen/generators/kotlin/KotlinTypeUtils.kt [88:111]
override fun visitNode(
node: Node<*>,
context: TraverserContext<Node<Node<*>>>,
): TraversalControl = throw AssertionError("Unknown field type: $node")
}
return NodeTraverser().postOrder(visitor, fieldType) as KtTypeName
}
fun isNullable(fieldType: Type<*>): Boolean =
if (config.kotlinAllFieldsOptional) {
true
} else {
fieldType !is NonNullType
}
/**
* Takes a GQL interface type name and returns the appropriate kotlin type given all of the mappings defined in the schema and config
*/
fun findKtInterfaceName(
interfaceName: String,
packageName: String,
): KtTypeName {
// check config
if (interfaceName in config.typeMapping) {