Errors not populating correctly
还没有人认领这个 Issue。
评估
调研方向
首先追踪 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
环境准备
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
github-community-projects/graphql-client 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 45/100
github-community-projects/graphql-client#78 · 1 条评论 ·
-
难度 3/5 1-2 天 新手友好度 35/100
github-community-projects/graphql-client#77 · 2 条评论 ·
-
难度 5/5 一周以上 新手友好度 35/100
github-community-projects/graphql-client#76 · 4 条评论 · 1 个 reaction ·
-
难度 4/5 3-5 天 新手友好度 35/100
github-community-projects/graphql-client#67 · 2 条评论 ·
-
难度 4/5 3-5 天 新手友好度 30/100
github-community-projects/graphql-client#65 · 1 条评论 ·
查看 github-community-projects/graphql-client 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 86/100
-
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复
-
data error
难度 2/5 1-3 小时 新手友好度 82/100
riscv/riscv-unified-db#2648 ·
维护者通常 1 天内回复
-
P2 testing
难度 1/5 1 小时以内 新手友好度 90/100
维护者通常 1 天内回复