GenericSchema

class Object
trait Matchable
class Any
object Schema

Value members

Concrete methods

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.

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.

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.

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 Params
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

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 Params
description

description of the type

fields

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

name

name of the type

def scalarSchema[A](name: String, description: 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 Params
description

description of the scalar type

makeResponse

function from A to ResponseValue that defines how to resolve A

name

name of the scalar type

Inherited methods

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

Implicits

Implicits

implicit val bigDecimalSchema: Schema[Any, BigDecimal]
implicit val bigIntSchema: Schema[Any, BigInt]
implicit val booleanSchema: Schema[Any, Boolean]
implicit def chunkSchema[R0, A](ev: Schema[R0, A]): Schema[R0, Chunk[A]]
implicit val doubleSchema: Schema[Any, Double]
implicit def effectSchema[R0, R1 >: R0, R2 >: R0, E <: Throwable, A](ev: Schema[R2, A]): Schema[R0, ZIO[R1, E, A]]
implicit def eitherSchema[RA, RB, A, B](evA: Schema[RA, A], evB: Schema[RB, B]): Schema[RA & RB, Either[A, B]]
implicit val floatSchema: Schema[Any, Float]
implicit def functionSchema[RA, RB, A, B](arg1: ArgBuilder[A], ev1: Schema[RA, A], ev2: Schema[RB, B]): Schema[RA & RB, A => B]
implicit def functionUnitSchema[R0, A](ev: Schema[R0, A]): Schema[R0, () => A]
implicit def futureSchema[R0, A](ev: Schema[R0, A]): Schema[R0, Future[A]]
implicit def infallibleEffectSchema[R0, R1 >: R0, R2 >: R0, A](ev: Schema[R2, A]): Schema[R0, URIO[R1, A]]
implicit def infallibleQuerySchema[R0, R1 >: R0, R2 >: R0, A](ev: Schema[R2, A]): Schema[R0, ZQuery[R1, Nothing, A]]
implicit def infallibleStreamSchema[R1, R2 >: R1, A](ev: Schema[R2, A]): Schema[R1, ZStream[R1, Nothing, A]]
implicit val intSchema: Schema[Any, Int]
implicit def listSchema[R0, A](ev: Schema[R0, A]): Schema[R0, List[A]]
implicit val longSchema: Schema[Any, Long]
implicit def mapSchema[RA, RB, A, B](evA: Schema[RA, A], evB: Schema[RB, B]): Schema[RA & RB, Map[A, B]]
implicit def metadataFunctionSchema[R0, A](ev: Schema[R0, A]): Schema[R0, Field => A]
implicit def optionSchema[R0, A](ev: Schema[R0, A]): Schema[R0, Option[A]]
implicit def querySchema[R0, R1 >: R0, R2 >: R0, E <: Throwable, A](ev: Schema[R2, A]): Schema[R0, ZQuery[R1, E, A]]
implicit def seqSchema[R0, A](ev: Schema[R0, A]): Schema[R0, Seq[A]]
implicit def setSchema[R0, A](ev: Schema[R0, A]): Schema[R0, Set[A]]
implicit def streamSchema[R0, R1 >: R0, R2 >: R0, E <: Throwable, A](ev: Schema[R2, A]): Schema[R0, ZStream[R1, E, A]]
implicit val stringSchema: Schema[Any, String]
implicit def tupleSchema[RA, RB, A, B](evA: Schema[RA, A], evB: Schema[RB, B]): Schema[RA & RB, (A, B)]
implicit val unitSchema: Schema[Any, Unit]
implicit val uuidSchema: Schema[Any, UUID]
implicit def vectorSchema[R0, A](ev: Schema[R0, A]): Schema[R0, Vector[A]]

Inherited implicits

implicit lazy val instantSchema: Schema[Any, Instant]
Inherited from
TemporalSchema
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 lazy val offsetDateTimeSchema: Schema[Any, OffsetDateTime]
Inherited from
TemporalSchema
implicit lazy val zonedDateTimeSchema: Schema[Any, ZonedDateTime]
Inherited from
TemporalSchema