Id未正确定义,语法错误GraphQL-Nerdgraph错误

huangapple go评论66阅读模式
英文:

Id not properly defined, syntax error GraphQL-Nerdgraph error

问题

The provided code and error message in your query are as follows:

以下是您的查询中提供的代码和错误消息:

Code (代码):

{
  actor {
    account(id: 123) {
      historicalDataExport {
        export {
          account {
            id: 123
          }
        }
      }
      name
    }
  }
}

Error Message (错误消息):

{
  "errors": [
    {
      "locations": [
        {
          "column": 9,
          "line": 5
        }
      ],
      "message": "In argument \"id\": Expected type \"ID!\", found null."
    }
  ]
}

Is there anything specific you would like to know or clarify about this code or error message? (是否有关于这段代码或错误消息的特定问题需要了解或澄清?)

英文:

Trying to execute the below Nerdgraph query, result is showing error. PFB. Need assistance.

{
  actor {
    account(id: 123) {
      historicalDataExport {
        export {
          account {
            id: 123
          }
        }
      }
      name
    }
  }
}

Id未正确定义,语法错误GraphQL-Nerdgraph错误

Response:-

{
  "errors": [
    {
      "locations": [
        {
          "column": 9,
          "line": 5
        }
      ],
      "message": "In argument \"id\": Expected type \"ID!\", found null."
    }
  ]
}

答案1

得分: 1

id是一个查询变量 - 不应包含在输出中。

{
  actor {
    account(id: 123) {
      historicalDataExport {
        export {
          account {
            id  << 只有这一行,不要有其他内容
          }
        }
      }
      name
    }
  }
}
英文:

id is a query variable - it shouldn't be included in the output.

{
  actor {
    account(id: 123) {
      historicalDataExport {
        export {
          account {
            id  << by itself, nothing more on this line
          }
        }
      }
      name
    }
  }
}

</details>



huangapple
  • 本文由 发表于 2023年5月11日 14:23:02
  • 转载请务必保留本文链接:https://go.coder-hub.com/76224686.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定