Schema

caliban.schema.Schema$
See theSchema companion trait
object Schema extends GenericSchema[Any]

Attributes

Companion
trait
Graph
Supertypes
trait GenericSchema[Any]
trait SchemaDerivation[Any]
class Object
trait Matchable
class Any
Show all
Self type
Schema.type

Members list

Type members

Inherited classlikes

object Auto

Attributes

Inherited from:
SchemaDerivation
Supertypes
class Object
trait Matchable
class Any
sealed trait Auto[A] extends Schema[R, A]

Attributes

Inherited from:
SchemaDerivation
Supertypes
trait Schema[R, A]
class Object
trait Matchable
class Any
object SemiAuto

Attributes

Inherited from:
SchemaDerivation
Supertypes
class Object
trait Matchable
class Any
sealed trait SemiAuto[A] extends Schema[R, A]

Attributes

Inherited from:
SchemaDerivation
Supertypes
trait Schema[R, A]
class Object
trait Matchable
class Any

Value members

Inherited methods

def customErrorEffectSchema[R0, R1 >: R0, R2 >: R0, E, A](convertError: E => ExecutionError)(implicit ev: Schema[R2, A]): Schema[R0, ZIO[R1, E, A]]

Attributes

Inherited from:
GenericSchema
def customErrorQuerySchema[R0, R1 >: R0, R2 >: R0, E, A](convertError: E => ExecutionError)(implicit ev: Schema[R2, A]): Schema[R0, ZQuery[R1, E, A]]

Attributes

Inherited from:
GenericSchema
def customErrorStreamSchema[R0, R1 >: R0, R2 >: R0, E, A](convertError: E => ExecutionError)(implicit ev: Schema[R2, A]): Schema[R0, ZStream[R1, E, A]]

Attributes

Inherited from:
GenericSchema
def customizeInputTypeName(name: String): String

Default naming logic for input types. This is needed to avoid a name clash between a type used as an input and the same type used as an output. GraphQL needs 2 different types, and they can't have the same name. By default, the "Input" suffix is added after the type name, given that it is not already present.

Default naming logic for input types. This is needed to avoid a name clash between a type used as an input and the same type used as an output. GraphQL needs 2 different types, and they can't have the same name. By default, the "Input" suffix is added after the type name, given that it is not already present.

Attributes

Inherited from:
CommonSchemaDerivation
inline def derived[R, A]: Schema[R, A]

Attributes

Inherited from:
CommonSchemaDerivation
def field[V](name: String, description: Option[String], directives: List[Directive]): PartiallyAppliedField[V]

Manually defines a field from a name, a description, some directives and a resolver. If the field is a function that should be called lazily, use fieldLazy instead. If the field takes arguments, use fieldWithArgs instead.

Manually defines a field from a name, a description, some directives and a resolver. If the field is a function that should be called lazily, use fieldLazy instead. If the field takes arguments, use fieldWithArgs instead.

Attributes

Inherited from:
GenericSchema
def fieldLazy[V](name: String, description: Option[String], directives: List[Directive]): PartiallyAppliedFieldLazy[V]

Manually defines a lazy field from a name, a description, some directives and a resolver.

Manually defines a lazy field from a name, a description, some directives and a resolver.

Attributes

Inherited from:
GenericSchema
def fieldWithArgs[V, A](name: String, description: Option[String], directives: List[Directive]): PartiallyAppliedFieldWithArgs[V, A]

Manually defines a field with arguments from a name, a description, some directives and a resolver.

Manually defines a field with arguments from a name, a description, some directives and a resolver.

Attributes

Inherited from:
GenericSchema
inline def gen[R, A]: Schema[R, A]

Attributes

Inherited from:
SchemaDerivation
inline def genDebug[R, A]: Schema[R, A]

Attributes

Inherited from:
SchemaDerivation
def localDateSchemaWithFormatter(formatter: DateTimeFormatter): Schema[Any, LocalDate]

Attributes

Inherited from:
TemporalSchema
def localDateTimeSchemaWithFormatter(formatter: DateTimeFormatter): Schema[Any, LocalDateTime]

Attributes

Inherited from:
TemporalSchema
def localTimeSchemaWithFormatter(formatter: DateTimeFormatter): Schema[Any, LocalTime]

Attributes

Inherited from:
TemporalSchema
def obj[R1, V](name: String, description: Option[String], directives: List[Directive])(fields: FieldAttributes => List[(`__Field`, V => Step[R1])]): Schema[R1, V]

Creates a new hand-rolled schema. For normal usage use the derived schemas, this is primarily for schemas which can't be resolved by derivation.

Creates a new hand-rolled schema. For normal usage use the derived schemas, this is primarily for schemas which can't be resolved by derivation.

Value parameters

description

An optional description of the type

directives

The directives to add to the type

fields

The fields to add to this object

case class Group(id: String, users: UQuery[List[User]], parent: UQuery[Option[Group]], organization: UQuery[Organization])
case class Organization(id: String, groups: UQuery[List[Group]])
case class User(id: String, group: UQuery[Group])
implicit val groupSchema: Schema[Any, Group] = obj("Group", Some("A group of users"))(implicit ft =>
  List(
    field("id")(_.id),
    field("users")(_.users),
    field("parent")(_.parent),
    field("organization")(_.organization)
  )
)
implicit val orgSchema: Schema[Any, Organization] = obj("Organization", Some("An organization of groups"))(implicit ft =>
  List(
    field("id")(_.id),
    field("groups")(_.groups)
  )
)
implicit val userSchema: Schema[Any, User] = obj("User", Some("A user of the service"))(implicit ft =>
  List(
    field("id")(_.id),
    field("group")(_.group)
  )
)
name

The name of the type

Attributes

Inherited from:
GenericSchema
def objectSchema[R1, A](name: String, description: Option[String], fields: (Boolean, Boolean) => List[(`__Field`, A => Step[R1])], directives: List[Directive]): Schema[R1, A]

Creates an object schema for a type A

Creates an object schema for a type A

Value parameters

description

description of the type

fields

list of fields with a type description and a resolver for each field

name

name of the type

Attributes

Inherited from:
GenericSchema
def offsetDateTimeSchemaWithFormatter(formatter: DateTimeFormatter): Schema[Any, OffsetDateTime]

Attributes

Inherited from:
TemporalSchema
inline def recurse[R, P, Label, A <: Tuple](inline values: List[(String, List[Any], Schema[R, Any], Int)])(inline index: Int): List[(String, List[Any], Schema[R, Any], Int)]

Attributes

Inherited from:
CommonSchemaDerivation
def scalarSchema[A](name: String, description: Option[String], specifiedBy: Option[String], directives: Option[List[Directive]], makeResponse: A => ResponseValue): Schema[Any, A]

Creates a scalar schema for a type A

Creates a scalar schema for a type A

Value parameters

description

description of the scalar type

directives

the directives to add to the type

makeResponse

function from A to ResponseValue that defines how to resolve A

name

name of the scalar type

specifiedBy

URL of the scalar specification

Attributes

Inherited from:
GenericSchema
def temporalSchema[A <: Temporal](name: String, description: Option[String])(f: A => ResponseValue): Schema[Any, A]

Attributes

Inherited from:
TemporalSchema
def temporalSchemaWithFormatter[A <: Temporal](name: String, description: Option[String])(formatter: DateTimeFormatter): Schema[Any, A]

Attributes

Inherited from:
TemporalSchema
def zonedDateTimeSchemaWithFormatter(formatter: DateTimeFormatter): Schema[Any, ZonedDateTime]

Attributes

Inherited from:
TemporalSchema

Inherited fields

final lazy val auto: AutoSchemaDerivation[Any]

Attributes

Inherited from:
SchemaDerivation
lazy val instantEpochSchema: Schema[Any, Instant]

Attributes

Inherited from:
TemporalSchema
val localDateEpochSchema: Schema[Any, LocalDate]

Attributes

Inherited from:
TemporalSchema
val localDateTimeEpochSchema: Schema[Any, LocalDateTime]

Attributes

Inherited from:
TemporalSchema
lazy val sampleDate: ZonedDateTime

Attributes

Inherited from:
TemporalSchema

Implicits

Inherited implicits

implicit val base64CursorSchema: Schema[Any, Base64Cursor]

Attributes

Inherited from:
GenericSchema
implicit val bigDecimalSchema: Schema[Any, BigDecimal]

Attributes

Inherited from:
GenericSchema
implicit val bigIntSchema: Schema[Any, BigInt]

Attributes

Inherited from:
GenericSchema
implicit val booleanSchema: Schema[Any, Boolean]

Attributes

Inherited from:
GenericSchema
implicit def chunkSchema[R0, A](implicit ev: Schema[R0, A]): Schema[R0, Chunk[A]]

Attributes

Inherited from:
GenericSchema
implicit val doubleSchema: Schema[Any, Double]

Attributes

Inherited from:
GenericSchema
implicit def effectSchema[R0, R1 >: R0, R2 >: R0, E <: Throwable, A](implicit ev: Schema[R2, A]): Schema[R0, ZIO[R1, E, A]]

Attributes

Inherited from:
GenericSchema
implicit def eitherSchema[RA, RB, A, B](implicit evA: Schema[RA, A], evB: Schema[RB, B]): Schema[RA & RB, Either[A, B]]

Attributes

Inherited from:
GenericSchema
implicit val floatSchema: Schema[Any, Float]

Attributes

Inherited from:
GenericSchema
implicit def functionSchema[RA, RB, A, B](implicit arg1: ArgBuilder[A], ev1: Schema[RA, A], ev2: Schema[RB, B]): Schema[RB, A => B]

Attributes

Inherited from:
GenericSchema
implicit def functionUnitSchema[R0, A](implicit ev: Schema[R0, A]): Schema[R0, () => A]

Attributes

Inherited from:
GenericSchema
implicit def futureSchema[R0, A](implicit ev: Schema[R0, A]): Schema[R0, Future[A]]

Attributes

Inherited from:
GenericSchema
implicit def infallibleEffectSchema[R0, R1 >: R0, R2 >: R0, A](implicit ev: Schema[R2, A]): Schema[R0, URIO[R1, A]]

Attributes

Inherited from:
GenericSchema
implicit def infallibleQuerySchema[R0, R1 >: R0, R2 >: R0, A](implicit ev: Schema[R2, A]): Schema[R0, ZQuery[R1, Nothing, A]]

Attributes

Inherited from:
GenericSchema
implicit def infallibleStreamSchema[R1, R2 >: R1, A](implicit ev: Schema[R2, A]): Schema[R1, ZStream[R1, Nothing, A]]

Attributes

Inherited from:
GenericSchema
implicit lazy val instantSchema: Schema[Any, Instant]

Attributes

Inherited from:
TemporalSchema
implicit val intSchema: Schema[Any, Int]

Attributes

Inherited from:
GenericSchema
implicit def listSchema[R0, A](implicit ev: Schema[R0, A]): Schema[R0, List[A]]

Attributes

Inherited from:
GenericSchema
implicit lazy val localDateSchema: Schema[Any, LocalDate]

Attributes

Inherited from:
TemporalSchema
implicit lazy val localDateTimeSchema: Schema[Any, LocalDateTime]

Attributes

Inherited from:
TemporalSchema
implicit lazy val localTimeSchema: Schema[Any, LocalTime]

Attributes

Inherited from:
TemporalSchema
implicit val longSchema: Schema[Any, Long]

Attributes

Inherited from:
GenericSchema
implicit def mapSchema[RA, RB, A, B](implicit evA: Schema[RA, A], evB: Schema[RB, B]): Schema[RA & RB, Map[A, B]]

Attributes

Inherited from:
GenericSchema
implicit def metadataFunctionSchema[R0, A](implicit ev: Schema[R0, A]): Schema[R0, Field => A]

Attributes

Inherited from:
GenericSchema
implicit lazy val offsetDateTimeSchema: Schema[Any, OffsetDateTime]

Attributes

Inherited from:
TemporalSchema
implicit def optionSchema[R0, A](implicit ev: Schema[R0, A]): Schema[R0, Option[A]]

Attributes

Inherited from:
GenericSchema
implicit def querySchema[R0, R1 >: R0, R2 >: R0, E <: Throwable, A](implicit ev: Schema[R2, A]): Schema[R0, ZQuery[R1, E, A]]

Attributes

Inherited from:
GenericSchema
implicit def seqSchema[R0, A](implicit ev: Schema[R0, A]): Schema[R0, Seq[A]]

Attributes

Inherited from:
GenericSchema
implicit def setSchema[R0, A](implicit ev: Schema[R0, A]): Schema[R0, Set[A]]

Attributes

Inherited from:
GenericSchema
implicit val shortSchema: Schema[Any, Short]

Attributes

Inherited from:
GenericSchema
implicit def streamSchema[R0, R1 >: R0, R2 >: R0, E <: Throwable, A](implicit ev: Schema[R2, A]): Schema[R0, ZStream[R1, E, A]]

Attributes

Inherited from:
GenericSchema
implicit val stringSchema: Schema[Any, String]

Attributes

Inherited from:
GenericSchema
implicit def tupleSchema[RA, RB, A, B](implicit evA: Schema[RA, A], evB: Schema[RB, B]): Schema[RA & RB, (A, B)]

Attributes

Inherited from:
GenericSchema
implicit val unitSchema: Schema[Any, Unit]

Attributes

Inherited from:
GenericSchema
implicit val uploadSchema: Schema[Any, Upload]

Attributes

Inherited from:
GenericSchema
implicit val uuidSchema: Schema[Any, UUID]

Attributes

Inherited from:
GenericSchema
implicit def vectorSchema[R0, A](implicit ev: Schema[R0, A]): Schema[R0, Vector[A]]

Attributes

Inherited from:
GenericSchema
implicit lazy val zonedDateTimeSchema: Schema[Any, ZonedDateTime]

Attributes

Inherited from:
TemporalSchema