Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Errors not populating correctly

未关闭
#75 1 条评论 1 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
35/100
Issue 类型
缺陷
描述清晰度
需要澄清
活跃度
停滞
技术栈
graphql, ruby
领域
api, backend

调研方向

首先追踪 response 的错误如何被规范化为 GraphQL::Client::Errors,然后检查针对报告中提到的错误的 AST 检查。重现 issue 中显示的 response,并验证返回的 GraphQL 错误会填充 errors 对象,而不是让其 messages 和 details 为空。

由索引模型根据 Issue 内容生成。

描述

Given this response

#<GraphQL::Client::Response:0x000071fb2142c000
 @data=#<#<Module:0x000071fb20ea5820>::Mutation addUser=nil>,
 @errors=#<GraphQL::Client::Errors @messages={} @details={}>,
 @extensions=nil,
 @full_response=
  {"connection" => ["close"],
   "server" => ["TwistedWeb/24.3.0"],
   "date" => ["Wed, 18 Jun 2025 12:45:29 GMT"],
   "content-type" => ["application/json"],
   "content-length" => ["338"]},
 @original_hash=
  {"data" => {"addUser" => nil},
   "errors" =>
    [{"message" => "The provided field is not unique and already exists in GUS.",
      "locations" => [{"line" => 2, "column" => 3}],
      "path" => ["addUser"],
      "errorType" => "FieldExistsError",
      "data" => nil,
      "errorInfo" => {"errorType" => "FieldExistsError", "field" => "userPrincipalName", "value" => "[email protected]"}}]}>

The errors object is empty even though there is an error returned. I tried stepping through I was able to get the errors object after being normalized which yielded

{"message" => "The provided field is not unique and already exists in GUS.",
 "locations" => [{"line" => 2, "column" => 3}],
 "path" => ["addUser"],
 "errorType" => "FieldExistsError",
 "data" => nil,
 "errorInfo" => {"errorType" => "FieldExistsError", "field" => "userPrincipalName", "value" => "[email protected]"},
 "normalizedPath" => ["data", "addUser"]}

I'm assuming it's part of the AST check for errors but I don't really get how it works or what's missing

主要语言
Ruby
星标
78
派生
228
PR 合并指标
30 天内没有已合并 PR

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

github-community-projects/graphql-client 的其他 Issue

查看 github-community-projects/graphql-client 的全部 Issue

相似的 Issue

更多 Ruby Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。