【问题标题】:Field of required type Int! was not provided.",所需类型 Int 的字段!没有提供。",
【发布时间】:2021-06-03 22:31:46
【问题描述】:

我有以下 GraphQL 错误: message": "所需类型为 Int 的字段 JobInput.salarys!未提供。",

我已经声明了三个变异变量,但我不确定“薪水:数字;”对吧?

【问题讨论】:

    标签: node.js typescript sqlite orm graphql


    【解决方案1】:

    JobInput 需要salarys 字段,您在屏幕截图中提供了salary

    class JobInput {
        @Field()
        title: string
    
        @Field(() => Int)
        salarys: number;
    }
    

    将您的变异输入更改为

    options: {
     title: 'my title',
     salarys: 8000
    }
    

    应该可以。估计是打错了。

    【讨论】:

    • 不幸的是同样的错误
    • 对吗``` @Field(() => Int) @Column("int", { default: 10 }) 工资:数字; ```
    猜你喜欢
    • 2020-08-24
    • 2020-10-18
    • 2022-01-03
    • 2021-03-13
    • 2020-12-06
    • 2019-03-22
    • 1970-01-01
    • 2019-05-29
    • 1970-01-01
    相关资源
    最近更新 更多