https://kotlinlang.org logo
Title
j

Justin

03/11/2022, 5:54 PM
Is this library able to take a
myschema.graphql
schema file as input and output a collection of kotlin files containing kotlin data classes for that schema? For example, this GraphQL schema:
myschema.graphql
type User {
    """
    The unique identifier for the user
    """
    id: String!
    """
    User first and last name
    """
    name: String!
    """
    Gender identity of user
    """
    gender: Gender
}

enum Gender {
	MALE
	FEMALE
	OTHER
	UNKNOWN
}
...would generate:
User.kt
data class User(
    val id: String,
    val name: String, 
    val gender: Gender
)
Gender.kt
enum class Gender {
    MALE, FEMALE, OTHER, UNKNOWN;
}
m

mbonnin

03/11/2022, 6:02 PM
Linking the discussion from #graphql-kotlin to keep everything in one place: https://kotlinlang.slack.com/archives/CQLNT7B29/p1647021249641899
💯 1