Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/drash/src/services/graphql/graphql.ts>GraphQL.GraphQLSchema

A microframework for Deno's HTTP server with zero third-party dependencies
Go to Latest
class GraphQL.GraphQLSchema
import { GraphQL } from "https://deno.land/x/drash@v2.8.1/src/services/graphql/graphql.ts";
const { GraphQLSchema } = GraphQL;

Schema Definition

A Schema is created by supplying the root types of each type of operation, query and mutation (optional). A schema definition is then supplied to the validator and executor.

Example:

const MyAppSchema = new GraphQLSchema({
  query: MyAppQueryRootType,
  mutation: MyAppMutationRootType,
})

Note: If an array of directives are provided to GraphQLSchema, that will be the exact list of directives represented and allowed. If directives is not provided then a default set of the specified directives (e.g. @include and

Constructors

new
GraphQLSchema(config: Readonly<GraphQLSchemaConfig>)

Properties

astNode: Maybe<SchemaDefinitionNode>
description: Maybe<string>
extensionASTNodes: Maybe<ReadonlyArray<SchemaExtensionNode>>
extensions: Maybe<Readonly<GraphQLSchemaExtensions>>

Methods

getDirective(name: string): Maybe<GraphQLDirective>
getImplementations(interfaceType: GraphQLInterfaceType): InterfaceImplementations
getType(name: string): Maybe<GraphQLNamedType>
getTypeMap(): TypeMap
isPossibleType(abstractType: GraphQLAbstractType, possibleType: GraphQLObjectType): boolean
isSubType(abstractType: GraphQLAbstractType, maybeSubType: GraphQLNamedType): boolean
toConfig(): GraphQLSchemaConfig & { types: Array<GraphQLNamedType>; directives: Array<GraphQLDirective>; extensions: Maybe<Readonly<GraphQLSchemaExtensions>>; extensionASTNodes: ReadonlyArray<SchemaExtensionNode>; assumeValid: boolean; }