GenericSchema

caliban.schema.GenericSchema

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes
object Schema.type

Members list

Concise view

Type members

Inherited classlikes

object Auto

Attributes

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

Attributes

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

Attributes

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

Attributes

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

Value members

Concrete methods

def customErrorEffectSchema[R0, R1 >: R0, R2 >: R0, E, A](convertError: E => ExecutionError)(implicit ev: Schema[R2, A]): Schema[R0, ZIO[R1, E, A]]
def customErrorQuerySchema[R0, R1 >: R0, R2 >: R0, E, A](convertError: E => ExecutionError)(implicit ev: Schema[R2, A]): Schema[R0, ZQuery[R1, E, A]]
def customErrorStreamSchema[R0, R1 >: R0, R2 >: R0, E, A](convertError: E => ExecutionError)(implicit ev: Schema[R2, A]): Schema[R0, ZStream[R1, E, A]]
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

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

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

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.

Attributes

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

Attributes

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], 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

Attributes

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

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

Implicits

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

Inherited implicits

implicit lazy val instantSchema: Schema[Any, Instant]

Attributes

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

Attributes

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

Attributes

Inherited from:
TemporalSchema