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

InvalidNullError not showing up in GraphQL::Client::Response errors since Graphql-ruby 2.4.11

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

还没有人认领这个 Issue。

评估

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

调研方向

首先使用链接的提交以及此 issue 中的 response 变更前后示例,比较 graphql 2.4.10 和 2.4.11 之间 GraphQL::Client::Response 的行为。跟踪 InvalidNullError 和 response 的 errors 属性是如何处理的,然后确定 2.4.11 的行为是否符合预期,并解释原因或所需的更改。

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

描述

I'm trying to upgrade our version of graphql gem from 2.4.10 to 2.4.11, and this commit changes default InvalidNullError handling.
Because of that change, all of a sudden my response object doesn't have the errors populated within the errors attribute (see example).

Before:

#<GraphQL::Client::Response:0x0000000155d92280
 @data=#<#<Module:0x000000015ad35148>::Mutation labelCreate=nil>,
 @errors=
  #<GraphQL::Client::Errors @messages={"data"=>["Cannot return null for non-nullable field LabelCreatePayload.errors"]} @details={"data"=>[{"message"=>"Cannot return null for non-nullable field LabelCreatePayload.errors", "normalizedPath"=>["data"]}]}>,
 @extensions=nil,
 @full_response=nil,
 @original_hash=
  {:http_status=>"200",
   "errors"=>[{"message"=>"Cannot return null for non-nullable field LabelCreatePayload.errors"}],
   "data"=>{"labelCreate"=>nil}}>

Now:

=> #<GraphQL::Client::Response:0x0000000137d12670
 @data=#<#<Module:0x0000000140f316a0>::Mutation labelCreate=nil>,
 @errors=#<GraphQL::Client::Errors @messages={} @details={}>,
 @extensions=nil,
 @full_response=nil,
 @original_hash=
  {:http_status=>"200",
   "errors"=>[{"message"=>"Cannot return null for non-nullable field LabelCreatePayload.errors", "locations"=>[{"line"=>3, "column"=>5}], "path"=>["labelCreate", "errors"]}],
   "data"=>{"labelCreate"=>nil}}>

Is this normal? Could I get some help understanding why that may be happening?

主要语言
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 摘要。