我是 GraphQL 的新手,我不知道如何将 TypeScript 传递type
给ReturnTypeFunction
装饰@Field
器。
我的代码如下:
export type WorokingHours = [number, number];
// [ [ 8, 13 ], [ 16, 22 ] ]
@Field(() => [WorokingHours], {
nullable: true,
description: storeWorkingHours
})
@prop()
workingHours?: WorokingHours[];
我会收到这个错误信息:
'WorokingHours' only refers to a type, but is being used as a value here.ts(2693)
如何解决此错误?
你有什么想法来实现我的商店在我的数据库中活跃的持续时间吗?