toKotlinType

fun toKotlinType(type: GraphQLType, packageName: String, scalarMappings: Map<String, String>, schemaIndex: SchemaIndex): TypeName(source)

Maps a GraphQLType to a KotlinPoet TypeName suitable for use in code generation.

Return

A KotlinPoet TypeName (e.g. String?, List?, Int).

Parameters

type

The GraphQL type to map.

scalarMappings

Custom scalar type to Kotlin type mappings (e.g. "DateTime" -> "kotlin.String").

schemaIndex

Indexed schema metadata used to distinguish input objects, enums, and schema-defined scalars.