【问题标题】:Documenting Graphql schema using Nestjs Code-first approach使用 Nestjs 代码优先方法记录 Graphql 模式
【发布时间】:2021-10-30 21:04:42
【问题描述】:

有没有办法将 cmets 添加到通过 Nestjs 的代码优先方法生成的模式的突变和查询中?

【问题讨论】:

    标签: typescript graphql nestjs nest


    【解决方案1】:

    使用 @Field、@ObjectType 等装饰器时

    你可以使用描述:'一些评论'

    然后你会在 graphql 操场上看到 cmets

    例子

    @ObjectType( {description : 'My class') )
    Class Person {
        @Field ( () => ID, { description : ' ID of the user' } ) 
        Id: number
    }
    

    【讨论】:

      猜你喜欢
      • 2020-08-17
      • 2020-07-14
      • 2021-01-07
      • 2022-07-29
      • 1970-01-01
      • 2011-08-13
      • 2020-05-12
      • 2022-08-20
      • 1970-01-01
      相关资源
      最近更新 更多