Schema

sangria.schema.Schema
See theSchema companion object
case class Schema[Ctx, Val](query: ObjectType[Ctx, Val], mutation: Option[ObjectType[Ctx, Val]], subscription: Option[ObjectType[Ctx, Val]], additionalTypes: List[Type & Named], description: Option[String], directives: List[Directive], validationRules: List[SchemaValidationRule], astDirectives: Vector[Directive], astNodes: Vector[AstNode]) extends HasAstInfo, HasDescription

GraphQL schema description.

Describes the schema that is presented by a Sangria server. An instance of this type needs to be presented to Sangria's execution method, so that it knows what to execute in response to a GraphQL request that conforms to this schema.

The types contained in the schema have associated actions that Sangria's execution uses to convert a parsed GraphQL request to its data store operations.

Type parameters

Ctx

Type of a context object that will be passed to each Sangria execution of a GraphQL query against this schema.

Value parameters

description

A description of this schema element that can be presented to clients of the GraphQL service.

query

The query

Attributes

See also
Companion
object
Graph
Supertypes
trait Serializable
trait Product
trait Equals
trait HasAstInfo
class Object
trait Matchable
class Any
Show all

Members list

Value members

Concrete methods

def compare(oldSchema: Schema[_, _]): Vector[SchemaChange]
def extend(document: Document, builder: AstSchemaBuilder[Ctx]): Schema[Ctx, Val]
def getOutputType(tpe: Type, topLevel: Boolean): Option[OutputType[_]]
def isPossibleImplementation(baseTypeName: String, tpe: ObjectLikeType[_, _]): Boolean
def isPossibleType(baseTypeName: String, tpe: ObjectType[_, _]): Boolean
def toAst(filter: SchemaFilter): Document
def withDirective(directive: Directive): Schema[Ctx, Val]
def withDirectives(directives: Directive*): Schema[Ctx, Val]

Inherited methods

Attributes

Inherited from:
Product

Attributes

Inherited from:
Product

Concrete fields

lazy val allTypes: Map[String, Type & Named]
lazy val inputTypes: Map[String, Named & InputType[Any]]
lazy val outputTypes: Map[String, Named & OutputType[Any]]

This contains the map of all the concrete types by supertype.

This contains the map of all the concrete types by supertype.

The supertype can be either a union or interface.

According to the spec, even if an interface can implement another interface, this must only contains concrete types

Attributes

Returns

Map of subtype by supertype name

See also
lazy val scalarTypes: Map[String, ScalarType[_]]
lazy val toAst: Document
lazy val typeList: Vector[Type & Named]
lazy val types: Map[String, (Int, Type & Named)]
lazy val unionTypes: Map[String, UnionType[_]]

Deprecated fields

Attributes

Deprecated
true