我已经 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**;
}
Run Code Online (Sandbox Code Playgroud)