UNPKG

type-graphql

Version:

Create GraphQL schema and resolvers with TypeScript, using classes and decorators!

47 lines (46 loc) • 1.72 kB
import { GraphQLSchema, GraphQLDirective } from "graphql"; import { BuildContextOptions } from "./build-context"; export interface SchemaGeneratorOptions extends BuildContextOptions { /** * Array of resolvers classes */ resolvers?: Function[]; /** * Array of orphaned type classes that are not used explicitly in GraphQL types definitions */ orphanedTypes?: Function[]; /** * Disable checking on build the correctness of a schema */ skipCheck?: boolean; /** * Array of graphql directives */ directives?: GraphQLDirective[]; } export declare abstract class SchemaGenerator { private static objectTypesInfo; private static inputTypesInfo; private static interfaceTypesInfo; private static enumTypesInfo; private static unionTypesInfo; private static usedInterfaceTypes; static generateFromMetadata(options: SchemaGeneratorOptions): Promise<GraphQLSchema>; static generateFromMetadataSync(options: SchemaGeneratorOptions): GraphQLSchema; private static checkForErrors; private static getDefaultValue; private static buildTypesInfo; private static buildRootQueryType; private static buildRootMutationType; private static buildRootSubscriptionType; private static buildOtherTypes; private static generateHandlerFields; private static generateSubscriptionsFields; private static generateHandlerArgs; private static mapArgFields; private static getGraphQLOutputType; private static getGraphQLInputType; private static getResolveTypeFunction; private static filterHandlersByResolvers; private static filterTypesInfoByIsAbstractAndOrphanedTypesAndExtractType; }