无法验证包含变量的GraphQL查询 架构查询变量

我正在尝试使用变量来验证GraphQL突变,但是我不清楚如何定义变量-当我在查询中声明变量时,验证失败。我不确定问题出在哪里:

架构

input ItemCreateInput {
  clientMutationId: ID
}

type Mutation {
  itemCreate(input: ItemCreateInput): ItemCreatePayload!
}

查询

mutation {
  itemCreate(
    input: $input
  ) {
    ids
  }
}

变量

{
 "input": {
    "clientMutationId": 1575680625627
 }
}

Variable \"$input\" is not defined.拒绝。但是我很困惑,因为validate函数不接受变量作为参数,那么为什么要验证变量呢?

问题出在哪里?如何正确定义和传递变量?

womeshi 回答:无法验证包含变量的GraphQL查询 架构查询变量

暂时没有好的解决方案,如果你有好的解决方案,请发邮件至:iooj@foxmail.com
本文链接:https://www.f2er.com/2956431.html

大家都在问