Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/opencv/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
使用graphQL发送变异中的对象数组_Graphql - Fatal编程技术网

使用graphQL发送变异中的对象数组

使用graphQL发送变异中的对象数组,graphql,Graphql,在我的服务器上,我有以下功能: extend type Mutation { setMySkills (skills: [ SkillUpdated! ]!) : [MySkills] } input SkillUpdated { name: String, id: Int, order: Int!, fromMonth:Int!, fromYear:Int, toMonth:Int, to

在我的服务器上,我有以下功能:

extend type Mutation {
    setMySkills (skills: [
        SkillUpdated!
    ]!) : [MySkills]
}
    input SkillUpdated {
    name: String, 
    id: Int, 
    order: Int!, 
    fromMonth:Int!,
    fromYear:Int, 
    toMonth:Int, 
    toYear: Int
}
type MySkills {
    name: String!,
    id: Int!,
    order: Int!,
    from: String!,
    to: String,
    minYear: Int!
}
我正试图在操场上进行变异手术。大概是这样的:

mutation setMySkills($skills: [SkillUpdated!]!) {
  setMySkills(skills: $skills) {
  id
  name
  order
  from
  to
  minYear
}
}
变量:

{
  "skills": [
  {
    "name": "Driving"
    "id": 7
    "order": 506
    "fromMonth": 0
    "fromYear": 1986
    "toMonth": 0
    "toYear": 1993
  }
 ]
}
但它不起作用

所需类型\“[SkillUpdated!]”的“变量\“$skills\”\“没有提供。”


有什么帮助吗?

您的查询和变量似乎有效。如果您使用的是GraphQL游乐场,那么它有一个用于变量和HTTP头的切换。很容易意外地将变量放入标题文本区域,反之亦然。确保您将变量输入到正确的输入中。我非常确定它位于正确的位置。