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>
extensionASTNodes: Maybe<ReadonlyArray<SchemaExtensionNode>>
extensions: Maybe<Readonly<GraphQLSchemaExtensions>>
Methods
getDirective(name: string): Maybe<GraphQLDirective>
getDirectives(): ReadonlyArray<GraphQLDirective>
getImplementations(interfaceType: GraphQLInterfaceType): InterfaceImplementations
getMutationType(): Maybe<GraphQLObjectType>
getPossibleTypes(abstractType: GraphQLAbstractType): ReadonlyArray<GraphQLObjectType>
getQueryType(): Maybe<GraphQLObjectType>
getSubscriptionType(): Maybe<GraphQLObjectType>
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; }