Hi,
I'm trying to do the wildcard import as described in the docs, but it continuously throws an error cannot find the module.
Code I'm using
```import { buildSchema } from "type-graphql";
async function bootstrap() {
const schema = await buildSchema({
resolvers: [__dirname + "/*/.resolver.ts"],
});
// other initialization code, like creating http server
}
bootstrap(); // actually run the async function
The error I'm getting:
{ Error: Cannot find module './src/recipes/recipe.resolver.ts'
at Function.Module._resolveFilename (module.js:548:15)
at Function.Module._load (module.js:475:25)
at Module.require (module.js:597:17)
at require (internal/module.js:11:18)
at filePaths.map.fileName (/Users/tamas.lorincz/Projects/graphql-test/node_modules/type-graphql/dist/helpers/loadResolversFromGlob.js:10:47)
at Array.map (
at Object.loadResolversFromGlob (/Users/tamas.lorincz/Projects/graphql-test/node_modules/type-graphql/dist/helpers/loadResolversFromGlob.js:10:31)
at options.resolvers.forEach.resolver (/Users/tamas.lorincz/Projects/graphql-test/node_modules/type-graphql/dist/utils/buildSchema.js:36:37)
at Array.forEach (
at loadResolvers (/Users/tamas.lorincz/Projects/graphql-test/node_modules/type-graphql/dist/utils/buildSchema.js:34:23) code: 'MODULE_NOT_FOUND' }
```
Anyone has faced this issue or knows how to resolve it?
resolvers: [path.resolve(__dirname, '**', '*.resolver.{js,ts}')],
try that I find it more reliable
@thomsa-swi
Try to use the same path pattern with raw glob to see what files does it find, what path it generates, etc.
Closing for a housekeeping purposes 馃敀
Most helpful comment