All Downloads are FREE. Search and download functionalities are using the official Maven repository.

sangria.introspection.model.scala Maven / Gradle / Ivy

There is a newer version: 2.0.1
Show newest version
package sangria.introspection

import sangria.schema.DirectiveLocation

case class IntrospectionSchema(
  queryType: IntrospectionNamedTypeRef,
  mutationType: Option[IntrospectionNamedTypeRef],
  subscriptionType: Option[IntrospectionNamedTypeRef],
  types: Seq[IntrospectionType],
  directives: Seq[IntrospectionDirective])

sealed trait IntrospectionType {
  def kind: TypeKind.Value
  def name: String
  def description: Option[String]
}

case class IntrospectionScalarType(
    name: String,
    description: Option[String]) extends IntrospectionType {
  val kind = TypeKind.Scalar
}

case class IntrospectionObjectType(
    name: String,
    description: Option[String],
    fields: Seq[IntrospectionField],
    interfaces: Seq[IntrospectionNamedTypeRef]) extends IntrospectionType {
  val kind = TypeKind.Object
}

case class IntrospectionInputObjectType(
    name: String,
    description: Option[String],
    inputFields: Seq[IntrospectionInputValue]) extends IntrospectionType {
  val kind = TypeKind.InputObject
}

case class IntrospectionInterfaceType(
    name: String,
    description: Option[String],
    fields: Seq[IntrospectionField],
    possibleTypes: Seq[IntrospectionNamedTypeRef]) extends IntrospectionType {
  val kind = TypeKind.Interface
}

case class IntrospectionUnionType(
    name: String,
    description: Option[String],
    possibleTypes: Seq[IntrospectionNamedTypeRef]) extends IntrospectionType {
  val kind = TypeKind.Union
}

case class IntrospectionEnumType(
    name: String,
    description: Option[String],
    enumValues: Seq[IntrospectionEnumValue]) extends IntrospectionType {
  val kind = TypeKind.Enum
}

case class IntrospectionField(
  name: String,
  description: Option[String],
  args: Seq[IntrospectionInputValue],
  tpe: IntrospectionTypeRef,
  isDeprecated: Boolean,
  deprecationReason: Option[String])

case class IntrospectionEnumValue(
  name: String,
  description: Option[String],
  isDeprecated: Boolean,
  deprecationReason: Option[String])

case class IntrospectionInputValue(
  name: String,
  description: Option[String],
  tpe: IntrospectionTypeRef,
  defaultValue: Option[String])

sealed trait IntrospectionTypeRef {
  def kind: TypeKind.Value
}

case class IntrospectionNamedTypeRef(kind: TypeKind.Value, name: String) extends IntrospectionTypeRef

case class IntrospectionListTypeRef(ofType: IntrospectionTypeRef) extends IntrospectionTypeRef {
  val kind = TypeKind.List
}

case class IntrospectionNonNullTypeRef(ofType: IntrospectionTypeRef) extends IntrospectionTypeRef {
  val kind = TypeKind.NonNull
}

case class IntrospectionDirective(
  name: String,
  description: Option[String],
  locations: Set[DirectiveLocation.Value],
  args: Seq[IntrospectionInputValue])




© 2015 - 2025 Weber Informatics LLC | Privacy Policy