GraphQLScalar

annotation class GraphQLScalar(val coercing: KClass<*>)

Marks a given class or typealias as a custom GraphQL scalar.

@GraphQLScalar(GeoPointCoercing::class)
class GeoPoint(val x: Double, val y: Double)

If you do not control the type, you can use a type alias:

@GraphQLScalar(DateCoercing::class)
@GraphQLName("Date")
typealias GraphQLDate = java.util.Date

When using type aliases, you may use either the alias or the original type.

Properties

Link copied to clipboard