Schema

object Schema extends GenericSchema[Any]
Companion:
class
trait GenericSchema[Any]
trait SchemaDerivation[Any]
class Object
trait Matchable
class Any
Schema.type

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]]
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]]
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]]
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, we add the "Input" suffix after the type name.

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, we add the "Input" suffix after the type name.

Inherited from:
SchemaDerivation
inline def derived[R, A]: Schema[R, A]
Inherited from:
SchemaDerivation
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.

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.

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.

Inherited from:
GenericSchema
inline def genDebug[R, A]: Schema[R, A]
Inherited from:
SchemaDerivation
def localDateSchemaWithFormatter(formatter: DateTimeFormatter): Schema[Any, LocalDate]
Inherited from:
TemporalSchema
def localDateTimeSchemaWithFormatter(formatter: DateTimeFormatter): Schema[Any, LocalDateTime]
Inherited from:
TemporalSchema
def localTimeSchemaWithFormatter(formatter: DateTimeFormatter): Schema[Any, LocalTime]
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

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

Inherited from:
GenericSchema
def offsetDateTimeSchemaWithFormatter(formatter: DateTimeFormatter): Schema[Any, OffsetDateTime]
Inherited from:
TemporalSchema
inline def recurse[R, Label, A <: Tuple](index: Int): List[(String, List[Any], Schema[R, Any], Int)]
Inherited from:
SchemaDerivation
def scalarSchema[A](name: String, description: Option[String], specifiedBy: Option[String], 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

makeResponse

function from A to ResponseValue that defines how to resolve A

name

name of the scalar type

specifiedBy

URL of the scalar specification

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

Inherited fields

lazy val instantEpochSchema: Schema[Any, Instant]
Inherited from:
TemporalSchema
val localDateEpochSchema: Schema[Any, LocalDate]
Inherited from:
TemporalSchema
val localDateTimeEpochSchema: Schema[Any, LocalDateTime]
Inherited from:
TemporalSchema
lazy val sampleDate: ZonedDateTime
Inherited from:
TemporalSchema

Givens

Inherited givens

given gen[R, A]: Schema[R, A]
Inherited from:
SchemaDerivation

Implicits

Inherited implicits

implicit val bigDecimalSchema: Schema[Any, BigDecimal]
Inherited from:
GenericSchema
implicit val bigIntSchema: Schema[Any, BigInt]
Inherited from:
GenericSchema
implicit val booleanSchema: Schema[Any, Boolean]
Inherited from:
GenericSchema
implicit def chunkSchema[R0, A](implicit ev: Schema[R0, A]): Schema[R0, Chunk[A]]
Inherited from:
GenericSchema
implicit val doubleSchema: Schema[Any, Double]
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]]
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]]
Inherited from:
GenericSchema
implicit val floatSchema: Schema[Any, Float]
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]
Inherited from:
GenericSchema
implicit def functionUnitSchema[R0, A](implicit ev: Schema[R0, A]): Schema[R0, () => A]
Inherited from:
GenericSchema
implicit def futureSchema[R0, A](implicit ev: Schema[R0, A]): Schema[R0, Future[A]]
Inherited from:
GenericSchema
implicit def infallibleEffectSchema[R0, R1 >: R0, R2 >: R0, A](implicit ev: Schema[R2, A]): Schema[R0, URIO[R1, A]]
Inherited from:
GenericSchema
implicit def infallibleQuerySchema[R0, R1 >: R0, R2 >: R0, A](implicit ev: Schema[R2, A]): Schema[R0, ZQuery[R1, Nothing, A]]
Inherited from:
GenericSchema
implicit def infallibleStreamSchema[R1, R2 >: R1, A](implicit ev: Schema[R2, A]): Schema[R1, ZStream[R1, Nothing, A]]
Inherited from:
GenericSchema
implicit lazy val instantSchema: Schema[Any, Instant]
Inherited from:
TemporalSchema
implicit val intSchema: Schema[Any, Int]
Inherited from:
GenericSchema
implicit def listSchema[R0, A](implicit ev: Schema[R0, A]): Schema[R0, List[A]]
Inherited from:
GenericSchema
implicit lazy val localDateSchema: Schema[Any, LocalDate]
Inherited from:
TemporalSchema
implicit lazy val localDateTimeSchema: Schema[Any, LocalDateTime]
Inherited from:
TemporalSchema
implicit lazy val localTimeSchema: Schema[Any, LocalTime]
Inherited from:
TemporalSchema
implicit val longSchema: Schema[Any, Long]
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]]
Inherited from:
GenericSchema
implicit def metadataFunctionSchema[R0, A](implicit ev: Schema[R0, A]): Schema[R0, Field => A]
Inherited from:
GenericSchema
implicit lazy val offsetDateTimeSchema: Schema[Any, OffsetDateTime]
Inherited from:
TemporalSchema
implicit def optionSchema[R0, A](implicit ev: Schema[R0, A]): Schema[R0, Option[A]]
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]]
Inherited from:
GenericSchema
implicit def seqSchema[R0, A](implicit ev: Schema[R0, A]): Schema[R0, Seq[A]]
Inherited from:
GenericSchema
implicit def setSchema[R0, A](implicit ev: Schema[R0, A]): Schema[R0, Set[A]]
Inherited from:
GenericSchema
implicit val shortSchema: Schema[Any, Short]
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]]
Inherited from:
GenericSchema
implicit val stringSchema: Schema[Any, String]
Inherited from:
GenericSchema
implicit def tupleSchema[RA, RB, A, B](implicit evA: Schema[RA, A], evB: Schema[RB, B]): Schema[RA & RB, (A, B)]
Inherited from:
GenericSchema
implicit val unitSchema: Schema[Any, Unit]
Inherited from:
GenericSchema
implicit val uploadSchema: Schema[Any, Upload]
Inherited from:
GenericSchema
implicit val uuidSchema: Schema[Any, UUID]
Inherited from:
GenericSchema
implicit def vectorSchema[R0, A](implicit ev: Schema[R0, A]): Schema[R0, Vector[A]]
Inherited from:
GenericSchema
implicit lazy val zonedDateTimeSchema: Schema[Any, ZonedDateTime]
Inherited from:
TemporalSchema