【发布时间】:2021-02-10 14:11:48
【问题描述】:
我需要接受来自前端的自定义 JSON 类型,我正在尝试在 NestJS 中实现这一点,但我无法解决。
我的实体模型
import { GraphQLJSONObject } from “graphql-type-json”
export class User {
@Field(()=> GraphQLJSONObject)
@Column({name: meta_data, type: simple-json})
metaData: object
}
DTO 类:
export class CreateUserDto {
@Field()
readonly metaData: object;
}
我总是出错
Error: undefined type error. Make sure you are providing an explicit type for the metaData of CreateUserDto class
我是 Nestjs 和 Graphql 的新手。
【问题讨论】:
标签: node.js graphql nestjs typeorm