Schema

class Schema(definitions: List<GQLDefinition>)

A wrapper around a schema GQLDocument that:

  • always contain builtin types contrary to introspection that will not contain directives and SDL that will not contain any builtin definitions

  • always has a schema definition

  • has type extensions merged

  • has some helper functions to retrieve a type by name and/or possible types

Parameters

definitions

a list of validated and merged definitions

Constructors

Schema
Link copied to clipboard
fun Schema(definitions: List<GQLDefinition>)
a list of validated and merged definitions

Types

Companion
Link copied to clipboard
object Companion

Functions

hasTypeWithTypePolicy
Link copied to clipboard
fun hasTypeWithTypePolicy(): Boolean
Returns whether the typePolicy directive is present on at least one object in the schema
implementedTypes
Link copied to clipboard
fun implementedTypes(name: String): Set<String>
keyFields
Link copied to clipboard
fun keyFields(name: String): Set<String>
Returns the key fields for the given typeIf this type has one or multiple @TYPE_POLICY annotation(s), they are used, else it recurses in implemented interfaces until it finds some.
possibleTypes
Link copied to clipboard
fun possibleTypes(typeDefinition: GQLTypeDefinition): Set<String>
fun possibleTypes(name: String): Set<String>
toGQLDocument
Link copied to clipboard
fun toGQLDocument(): GQLDocument
typeDefinition
Link copied to clipboard
fun typeDefinition(name: String): GQLTypeDefinition

Properties

directiveDefinitions
Link copied to clipboard
val directiveDefinitions: Map<String, GQLDirectiveDefinition>
mutationTypeDefinition
Link copied to clipboard
val mutationTypeDefinition: GQLTypeDefinition?
queryTypeDefinition
Link copied to clipboard
val queryTypeDefinition: GQLTypeDefinition
subscriptionTypeDefinition
Link copied to clipboard
val subscriptionTypeDefinition: GQLTypeDefinition?
typeDefinitions
Link copied to clipboard
val typeDefinitions: Map<String, GQLTypeDefinition>