type-graphql
Version:
Create GraphQL schema and resolvers with TypeScript, using classes and decorators!
51 lines (50 loc) • 1.81 kB
TypeScript
import { type GraphQLDirective, GraphQLSchema } from "graphql";
import { type BuildContextOptions } from "./build-context.js";
export type SchemaGeneratorOptions = {
/**
* 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[];
} & BuildContextOptions;
export declare abstract class SchemaGenerator {
private static objectTypesInfo;
private static objectTypesInfoMap;
private static inputTypesInfo;
private static inputTypesInfoMap;
private static interfaceTypesInfo;
private static interfaceTypesInfoMap;
private static enumTypesInfo;
private static unionTypesInfo;
private static unionTypesInfoMap;
private static usedInterfaceTypes;
private static metadataStorage;
static generateFromMetadata(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 filterTypesInfoByOrphanedTypesAndExtractType;
}