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 Serializable
trait Product
trait Equals
trait NullableType
trait LeafType
trait HasAstInfo
trait Named
trait OutputType[T]
trait InputType[T @@ CoercedScalaResult]
trait Type
class Object
trait Matchable
class Any
Show all

Members list

Value members

Concrete methods

def rename(newName: String): ScalarType.this.type
def withDirective(directive: Directive): ScalarType[T]
def withDirectives(directives: Directive*): ScalarType[T]

Inherited methods

Attributes

Inherited from:
InputType

Attributes

Inherited from:
Type

Attributes

Inherited from:
Product

Attributes

Inherited from:
Product

Inherited fields

lazy val isList: Boolean

Attributes

Inherited from:
InputType
lazy val isNamed: Boolean

Attributes

Inherited from:
InputType
lazy val isOptional: Boolean

Attributes

Inherited from:
InputType
lazy val nonOptionalType: InputType[_]

Attributes

Inherited from:
InputType