【发布时间】:2020-02-27 20:42:25
【问题描述】:
我已经 npm 安装了 graphql-type-json 和类型。 如何在代码优先的方法中使用它,其中 JSONObject 是下面示例中的标量。
import {Field, Int, InputType} from 'type-graphql';
import {Direction, MessageType} from '../interfaces/message.interface';
@InputType()
export class MessageInput {
@Field()
readonly to: string;
@Field()
readonly type: MessageType;
@Field()
readonly direction: Direction;
@Field()
readonly body: **JSONObject**;
}
【问题讨论】:
-
感谢您提出这个问题。文档提出问题。