使用Schema构建的突变中的对象数组-Graphql-问题

时间:2019-01-23 01:30:26

标签: javascript node.js reactjs schema graphql

我的问题是,我进行了更改以更新公司资料,但是当我放置广告网络字段时,出现错误。

我正在使用buildSchema。

type Network {
  name: String
  url: String
}

input UpdateCompanyInput {
     name: String
     networks: [Network]
} 

当我在GraphiQL中尝试时:

mutation {
  updateCompanyProfile(updateCompanyInput: {name: "Test"}) {
    name
  }
}

我收到此错误:

    {
      "errors": [
        {
          "message": "The type of UpdateCompanyInput.networks must be Input Type but got: [Network].",
          "locations": [
            {
              "line": 95,
              "column": 13
            }
          ]
        }
      ]
    }



Thanks!


0 个答案:

没有答案