Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
chokidar_1.watch([...new Set(paths)], { ignored }).on('change', (path) => __awaiter(this, void 0, void 0, function* () {
const newModule = yield load_file_1.loadFile(path);
yield traverse_1.traverseAndLoadConfigs(config);
const schema = core_1.Container.get(core_1.BootstrapService).schema;
schema.getQueryType().getFields()['findUser2'].resolve = newModule.findUser;
}));
}
useFactory: () => __awaiter(this, void 0, void 0, function* () {
let config = yield set_config_1.getConfig(args_extractors_1.nextOrDefault('--config', 'graphqj-config'));
if (!config) {
config = yield set_config_1.getConfig('gj');
}
if (!config) {
config = basic_template_1.basicTemplate;
}
return config['default'] || config;
})
},
{
provide: 'Run',
deps: [
app_tokens_1.Config,
core_1.BootstrapService,
app_tokens_1.TypesToken,
app_tokens_1.ResolversToken,
app_tokens_1.ArgumentsToken,
app_tokens_1.GuardsToken,
core_1.GRAPHQL_PLUGIN_CONFIG
],
lazy: true,
useFactory: (config, bootstrap, types, resolvers, args, guards, graphqlConfig) => __awaiter(this, void 0, void 0, function* () {
config = yield config;
yield traverse_1.traverseAndLoadConfigs(config);
if (config.$externals) {
const compiledPaths = yield transpile_and_load_1.TranspileAndGetAll(config.$externals, './.gj/out');
config.$externals = compiledPaths.map(external => {
if (external.file.includes('.ts')) {
external.module = require(external.transpiledFile);
}