Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const generateGTypes = (schemaDir: string, outputPath: string) => {
const schemasPath = glob.sync(schemaDir + '/*.+(js|ts|jsx|tsx)');
let typeDefs: string[] = [];
schemasPath.forEach(function (schema) {
typeDefs.push(require(schema));
});
const executableSchema = makeExecutableSchema({ typeDefs });
const options: GenerateTypescriptOptions = {
typePrefix: '',
noStringEnum: true,
smartTResult: true,
asyncResult: true
};
return generateTypeScriptTypes(executableSchema, outputPath, options);
};