小编Chr*_*ris的帖子

我如何在 Nest.js 代码中首先使用 graphql-type-json 标量

我已经 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)

graphql nestjs

5
推荐指数
2
解决办法
1555
查看次数

标签 统计

graphql ×1

nestjs ×1