99designs / 99designs/gqlgen

Can we disable unknown field validation error GRAPHQL_VALIDATION_FAILED?

未关闭
#2,412 0 条评论 3 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
Go
星标
10.8k
派生
1.3k
平均合并
2 天 36 分钟
30 天内合并 PR
26

描述

### What happened?
We are migrating from graph-gophers to gqlgen. It is the end of the migration now, but we are blocked by seeing such errors often. The graph-gophers library will ignore unknown fields. Our frontend sometimes sends unknown fields still and there are just too many fields to remove. Is there a way to disable this error?

```json
{
"message": "unknown field",
"path": ["blabla"],
"extensions": {
"code": "GRAPHQL_VALIDATION_FAILED"
}
}
```

### What did you expect?

I would like a way to config gqlgen and disable this error.

### versions
- `go run github.com/99designs/gqlgen version`? v0.17.20
- `go version`? 1.19.1

贡献指南

打开贡献指南

调研方向

查看 gqlgen 代码库中的验证逻辑,可能位于 validation 或 execution 包中。搜索 GRAPHQL_VALIDATION_FAILED 以及未知字段的处理。目标是添加一个配置选项以禁用未知字段验证,同时保持向后兼容性。检查现有的配置结构,并了解验证错误是如何生成和返回的。

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

评估

技术栈
go, graphql
领域
api, backend
Issue 类型
功能
难度
3/5
预计耗时
1-2 天
活跃度
停滞
描述清晰度
描述清楚
新手友好度
45/100

把新 issue 发到你的邮箱

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