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] with OutputType[T] with LeafType with NullableType with UnmodifiedType with 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.

Attributes

description

A description of this schema element that can be presented to clients of the GraphQL service.

Graph
Supertypes
trait Serializable
trait Product
trait Equals
trait LeafType
trait Named
trait OutputType[T]
trait InputType[T @@ CoercedScalaResult]
trait Type
class Object
trait Matchable
class Any

Members list

Concise view

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

Attributes

Inherited from:
InputType

Attributes

Inherited from:
InputType