Closed LastKing closed 1 year ago
remove nestjs-cli.json
file compilerOptions.builder:"swc"
,genereateschema.gql
return to normal
Did you follow this guide https://docs.nestjs.com/graphql/cli-plugin#swc-builder?
Sorry, I didn't notice this guide section before.
I flow this guide,change my mini projejct,add "compilerOptions.typeCheck:true"
in nest-cli.json
.
A new problem arises。
metadata.ts
as follows
/* eslint-disable */
export default async () => {
const t = {};
return {
'@nestjs/graphql': {
models: [
[
import('../D:/code/node-tx/nestjs-study/src/author/model/post.model'), // 1
{ Post: {} },
],
[
import(
'../D:/code/node-tx/nestjs-study/src/author/model/author.model' // 2
),
{ Author: { id: { type: () => Number, description: 'Test' } } },
],
],
},
};
};
above code 1
2
,the path wrong.
It doesn't look like an absolute path, nor does it look like a relative path.
the method receive value:
pathToSource
: D:\\code\\node-tx\\nestjs-study\\src
path
: D:/code/node-tx/nestjs-study/src/author/model/author.model.ts
result:
../D:/code/node-tx/nestjs-study/src/author/model/author.model.ts
This should be fixed in @nestjs/graphql@12.0.5
Is there an existing issue for this?
Current behavior
AuthorModel.id
field don't generate in shema.gqlMinimum reproduction code
https://github.com/toonew-issue/nestjs-swc-graphql-comments
Steps to reproduce
npm run start:debug
Expected behavior
expect generate
Package
Other package
No response
NestJS version
10.0.5
Packages versions
Node.js version
18.16.0
In which operating systems have you tested?
Other
No response