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

jvmMain.graphql.coercion.NodeInputCoercer.kt Maven / Gradle / Ivy

There is a newer version: 0.26.0
Show newest version
package io.fluidsonic.raptor.graphql.internal

import io.fluidsonic.graphql.*
import io.fluidsonic.stdlib.*


internal object NodeInputCoercer : GNodeInputCoercer {

	override fun GNodeInputCoercerContext.coerceNodeInput(input: Any?): Any? {
		val kotlinType = argumentDefinition?.raptorArgument?.kotlinType
		val expectsMaybe = kotlinType?.classifier == Maybe::class
		if (expectsMaybe && input == null)
			return Maybe.nothing

		return next()
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy