All Downloads are FREE. Search and download functionalities are using the official Maven repository.

jvmMain.extensions.Country.kt Maven / Gradle / Ivy

There is a newer version: 0.26.0
Show newest version
// https://youtrack.jetbrains.com/issue/KT-12495
@file:JvmName("Country@graphql")

package io.fluidsonic.raptor

import io.fluidsonic.country.*
import io.fluidsonic.i18n.*
import io.fluidsonic.locale.*


@Suppress("RemoveExplicitTypeArguments")
public fun Country.Companion.graphDefinition(): RaptorGraphDefinition = graphObjectDefinition {
	field(Country::code)
	field("name") {
		val locale by argument {
			defaultString("en-US")
		}

		resolver { country ->
			country.name(locale) ?: country.name
		}
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy