Types

object Types
class Object
trait Matchable
class Any
Types.type

Value members

Concrete methods

def collectTypes(t: `__Type`, existingTypes: List[`__Type`]): List[`__Type`]

Returns a map of all the types nested within the given root type.

Returns a map of all the types nested within the given root type.

def listOf(t: `__Type`): Option[`__Type`]
def makeEnum(name: Option[String], description: Option[String], values: List[`__EnumValue`], origin: Option[String], directives: Option[List[Directive]]): `__Type`
def makeInputObject(name: Option[String], description: Option[String], fields: List[`__InputValue`], origin: Option[String], directives: Option[List[Directive]]): `__Type`
def makeInterface(name: Option[String], description: Option[String], fields: () => List[`__Field`], subTypes: List[`__Type`], origin: Option[String], directives: Option[List[Directive]]): `__Type`
def makeObject(name: Option[String], description: Option[String], fields: List[`__Field`], directives: List[Directive], origin: Option[String], interfaces: () => Option[List[`__Type`]]): `__Type`
def makeScalar(name: String, description: Option[String], specifiedBy: Option[String]): `__Type`

Creates a new scalar type with the given name.

Creates a new scalar type with the given name.

def makeUnion(name: Option[String], description: Option[String], subTypes: List[`__Type`], origin: Option[String], directives: Option[List[Directive]]): `__Type`
def name(t: `__Type`): String
@tailrec
def same(t1: `__Type`, t2: `__Type`): Boolean
def unify(l: List[`__Type`]): Option[`__Type`]

Tries to find a common widened type among a list of types.

Tries to find a common widened type among a list of types.

Value parameters:
l

a list of types to unify

Returns:

the unified type if one could be found

Example:
unify(List(string, makeNonNull(string))) // => Some(__Type(SCALAR, Some("String")))
def unify(t1: `__Type`, t2: `__Type`): Option[`__Type`]

Tries to unify two types by widening them to a common supertype.

Tries to unify two types by widening them to a common supertype.

Value parameters:
t1

type second type to unify

t2

the first type to unify

Returns:

the unified type if one could be found

Example:
unify(string, makeNonNull(string)) // => Some(__Type(SCALAR, Some("String")))