UNPKG

935 BTypeScriptView Raw
1import { type GraphQLSchema } from "graphql";
2import { type SchemaGeneratorOptions } from "../schema/schema-generator.js";
3import { type NonEmptyArray } from "../typings/index.js";
4import { type PrintSchemaOptions } from "./emitSchemaDefinitionFile.js";
5type EmitSchemaFileOptions = {
6 path?: string;
7} & Partial<PrintSchemaOptions>;
8export type BuildSchemaOptions = {
9 /** Array of resolvers classes to resolver files */
10 resolvers: NonEmptyArray<Function>;
11 /**
12 * Path to the file to where emit the schema
13 * or config object with print schema options
14 * or `true` for the default `./schema.graphql` one
15 */
16 emitSchemaFile?: string | boolean | EmitSchemaFileOptions;
17} & Omit<SchemaGeneratorOptions, "resolvers">;
18export declare function buildSchema(options: BuildSchemaOptions): Promise<GraphQLSchema>;
19export declare function buildSchemaSync(options: BuildSchemaOptions): GraphQLSchema;
20export {};