ScalarType
sangria.schema.ScalarType
case class ScalarType[T](name: String, description: Option[String], coerceUserInput: Any => Either[Violation, T], coerceOutput: (T, Set[MarshallerCapability]) => Any, coerceInput: Value => Either[Violation, T], complexity: Double, scalarInfo: Set[ScalarValueInfo], astDirectives: Vector[Directive], astNodes: Vector[AstNode]) extends InputType[T @@ CoercedScalaResult], OutputType[T], LeafType, NullableType, UnmodifiedType, Named
Defines a GraphQL scalar value type.
coerceOutput
is allowed to return following scala values:
- String
- Boolean
- Int
- Long
- Float
- Double
- scala.BigInt
- scala.BigDecimal
- sangria.ast.Value (it would be converted to raw scala value before given to a marshalling API)
It may also return other values as well as long as underlying marshalling library supports them.
You can provide additional meta-information to marshalling API with scalarInfo
.
Value parameters
- description
-
A description of this schema element that can be presented to clients of the GraphQL service.
Attributes
- Graph
-
- Supertypes
-
trait Serializabletrait Producttrait Equalstrait UnmodifiedTypetrait NullableTypetrait LeafTypetrait HasAstInfotrait Namedtrait HasDescriptiontrait OutputType[T]trait Typeclass Objecttrait Matchableclass Any
Members list
In this article