/** * Parameters for building a GraphQL schema from NestJS resolvers. * All paths are workspace-relative and will be validated for containment. * @example * ```typescript * const params: IBuildSchemaParams = { * workspaceRoot: '/workspace', * resolversModulePath: 'src/graphql/resolvers', * schemaOutputPath: 'dist/schema.graphql' * }; * ``` */ export interface IBuildSchemaParams { /** The workspace root directory (absolute path). */ workspaceRoot: string; /** Path to module exporting GraphQLSchema array (relative to workspace root). */ resolversModulePath: string; /** Output path for the .graphql SDL file (relative to workspace root). */ schemaOutputPath: string; } /** * Validates that a resolvers module exists at the given path. * Checks for .ts, .js, or bare module name variants. * Enforces path containment within workspace root. * @param workspaceRoot - The workspace root directory. * @param modulePath - The module path (relative to workspace root). * @returns The validated, resolved module path. * @throws {ExecutorError} If the module is not found or the path is invalid (absolute, traversal, or escapes workspace). * @example * ```typescript * const resolved = validateResolversModuleExists('/workspace', 'src/graphql/resolvers'); * // returns '/workspace/src/graphql/resolvers' * ``` */ export declare function validateResolversModuleExists(workspaceRoot: string, modulePath: string): string; /** * Validates that the value exported as GraphQLSchema from a resolvers module is an array. * @param resolvers - The value exported from the resolvers module to validate. * @throws {ExecutorError} If resolvers is not an array: 'Module must export a \'GraphQLSchema\' array of resolver classes' * @example * ```typescript * const module = await import('./resolvers.js'); * const resolvers: unknown = module['GraphQLSchema']; * validateResolversExport(resolvers); * // resolvers is now narrowed to unknown[] * ``` */ export declare function validateResolversExport(resolvers: unknown): asserts resolvers is unknown[]; /** * Writes the GraphQL schema content to a file. * Enforces path containment within workspace root. * @param workspaceRoot - The workspace root directory. * @param schemaOutputPath - The output file path (relative to workspace root). * @param schemaContent - The GraphQL schema SDL content. * @throws {ExecutorError} If the path is invalid (absolute, traversal, or escapes workspace). * @example * ```typescript * writeSchemaToFile('/workspace', 'dist/schema.graphql', 'type Query { hello: String }'); * // writes SDL to /workspace/dist/schema.graphql * ``` */ export declare function writeSchemaToFile(workspaceRoot: string, schemaOutputPath: string, schemaContent: string): void; /** * Builds a GraphQL schema from NestJS resolver classes. * Validates all input paths for containment within workspace root. * Dynamically imports the resolvers module and uses NestJS GraphQLSchemaFactory. * @param params - Parameters including workspaceRoot, resolversModulePath, and schemaOutputPath. * @throws {ExecutorError} If path validation fails, the resolvers module is not found, the export is not an array, or schema building fails. * @example * ```typescript * await buildGraphQLSchema({ * workspaceRoot: '/workspace', * resolversModulePath: 'src/graphql/resolvers', * schemaOutputPath: 'dist/schema.graphql' * }); * // writes SDL to /workspace/dist/schema.graphql * ``` */ export declare function buildGraphQLSchema(params: IBuildSchemaParams): Promise; //# sourceMappingURL=schema-builder.d.ts.map