F:\workdir\graphql_cad_service\node_modules\reflect-metadata\Reflect.js:553
var decorated = decorator(target, propertyKey, descriptor);
^
Error: Cannot determine a type for the "Material.materialSecondType" field (union/intersection/ambiguous type was used). Make sure your property is decorated with a "@Prop({ type: TYPE_HERE })" decorator.
at F:\workdir\graphql_cad_service\node_modules\@nestjs\mongoose\dist\decorators\prop.decorator.js:22:23
at DecorateProperty (F:\workdir\graphql_cad_service\node_modules\reflect-metadata\Reflect.js:553:33)
at Object.decorate (F:\workdir\graphql_cad_service\node_modules\reflect-metadata\Reflect.js:123:24)
at __decorate (F:\workdir\graphql_cad_service\dist\components\material\entities\material.schema.js:4:92)
at Object. (F:\workdir\graphql_cad_service\src\components\material\entities\material.schema.ts:29:2)
at Module._compile (internal/modules/cjs/loader.js:1068:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1097:10)
at Module.load (internal/modules/cjs/loader.js:933:32)
at Function.Module._load (internal/modules/cjs/loader.js:774:14)
at Module.require (internal/modules/cjs/loader.js:957:19)
// error
F:\workdir\graphql_cad_service\node_modules\reflect-metadata\Reflect.js:553
var decorated = decorator(target, propertyKey, descriptor);
^
Error: Cannot determine a type for the "Material.materialSecondType" field (union/intersection/ambiguous type was used). Make sure your property is decorated with a "@Prop({ type: TYPE_HERE })" decorator.
at F:\workdir\graphql_cad_service\node_modules\@nestjs\mongoose\dist\decorators\prop.decorator.js:22:23
at DecorateProperty (F:\workdir\graphql_cad_service\node_modules\reflect-metadata\Reflect.js:553:33)
at Object.decorate (F:\workdir\graphql_cad_service\node_modules\reflect-metadata\Reflect.js:123:24)
at __decorate (F:\workdir\graphql_cad_service\dist\components\material\entities\material.schema.js:4:92)
at Object. (F:\workdir\graphql_cad_service\src\components\material\entities\material.schema.ts:29:2)
at Module._compile (internal/modules/cjs/loader.js:1068:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1097:10)
at Module.load (internal/modules/cjs/loader.js:933:32)
at Function.Module._load (internal/modules/cjs/loader.js:774:14)
at Module.require (internal/modules/cjs/loader.js:957:19)
Is there an existing issue for this?
Current behavior
F:\workdir\graphql_cad_service\node_modules\reflect-metadata\Reflect.js:553 var decorated = decorator(target, propertyKey, descriptor); ^ Error: Cannot determine a type for the "Material.materialSecondType" field (union/intersection/ambiguous type was used). Make sure your property is decorated with a "@Prop({ type: TYPE_HERE })" decorator. at F:\workdir\graphql_cad_service\node_modules\@nestjs\mongoose\dist\decorators\prop.decorator.js:22:23 at DecorateProperty (F:\workdir\graphql_cad_service\node_modules\reflect-metadata\Reflect.js:553:33) at Object.decorate (F:\workdir\graphql_cad_service\node_modules\reflect-metadata\Reflect.js:123:24) at __decorate (F:\workdir\graphql_cad_service\dist\components\material\entities\material.schema.js:4:92) at Object. (F:\workdir\graphql_cad_service\src\components\material\entities\material.schema.ts:29:2)
at Module._compile (internal/modules/cjs/loader.js:1068:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1097:10)
at Module.load (internal/modules/cjs/loader.js:933:32)
at Function.Module._load (internal/modules/cjs/loader.js:774:14)
at Module.require (internal/modules/cjs/loader.js:957:19)
Minimum reproduction code
none
Steps to reproduce
No response
Expected behavior
// sechma @Prop() @Field(() => MaterialTopType, { description: "材料分类(二级)", nullable: true }) materialTopType: MaterialTopType;
// error F:\workdir\graphql_cad_service\node_modules\reflect-metadata\Reflect.js:553 var decorated = decorator(target, propertyKey, descriptor); ^ Error: Cannot determine a type for the "Material.materialSecondType" field (union/intersection/ambiguous type was used). Make sure your property is decorated with a "@Prop({ type: TYPE_HERE })" decorator. at F:\workdir\graphql_cad_service\node_modules\@nestjs\mongoose\dist\decorators\prop.decorator.js:22:23 at DecorateProperty (F:\workdir\graphql_cad_service\node_modules\reflect-metadata\Reflect.js:553:33) at Object.decorate (F:\workdir\graphql_cad_service\node_modules\reflect-metadata\Reflect.js:123:24) at __decorate (F:\workdir\graphql_cad_service\dist\components\material\entities\material.schema.js:4:92) at Object. (F:\workdir\graphql_cad_service\src\components\material\entities\material.schema.ts:29:2)
at Module._compile (internal/modules/cjs/loader.js:1068:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1097:10)
at Module.load (internal/modules/cjs/loader.js:933:32)
at Function.Module._load (internal/modules/cjs/loader.js:774:14)
at Module.require (internal/modules/cjs/loader.js:957:19)
Package version
8.1.3
Graphql version
"@nestjs/common": "^8.0.0", "@nestjs/config": "^1.1.5", "@nestjs/core": "^8.0.0", "@nestjs/graphql": "^9.1.2", "@nestjs/jwt": "^8.0.0", "@nestjs/mongoose": "^9.0.2", "@nestjs/platform-express": "^8.0.0", "@nestjs/typeorm": "^8.0.2", "@types/cache-manager": "^3.4.2", "@types/redis": "^4.0.11", "apollo-server-express": "^3.5.0",
NestJS version
^8.0.0
Node.js version
14.17.0
In which operating systems have you tested?
Other
import { MaterialSecondType } from './../../material_second_type/entities/material_second_type.schema'; import { Field, ObjectType } from "@nestjs/graphql"; import { Prop, Schema, SchemaFactory } from "@nestjs/mongoose"; import { FillPattern } from 'src/components/fill_pattern/entities/fill_pattern.schema'; import { MaterialTopType } from 'src/components/material_top_type/entities/material_top_type.schema'; import { Document } from 'mongoose';
@ObjectType() @Schema() export class Material extends Document {
}
export const MaterialSchema = SchemaFactory.createForClass(Material);