Skip to main content
Module

x/graphql_deno/mod.ts>GraphQLSchema

GraphQL-JS ported to Deno
Latest
class GraphQLSchema
import { GraphQLSchema } from "https://deno.land/x/graphql_deno@v15.0.0/mod.ts";

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<Record<string, any>>>

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<Record<string, any>>>; extensionASTNodes: ReadonlyArray<SchemaExtensionNode>; assumeValid: boolean; }