我的模型中有这个字段,但不起作用
@Field(type => [],{ nullable: true })
product: string[];
Run Code Online (Sandbox Code Playgroud)
我不知道我想念什么。
您需要添加 GraphQL 类型String
。因此更改[]
为[String]
,一个字符串数组。您可能还想设置product
可选(with ?
),因为它是nullable
。
@Field(type => [String], { nullable: true })
product?: string[];
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
5089 次 |
最近记录: |