99designs / 99designs/gqlgen

gqlgen doesn't generate code by contract with @specifiedBy or @deprecated

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

描述

### What happened?

https://github.com/krupyansky/gqlgen-bug

Run `go run graph/generate.go`

After I can see error "failed to load schema: graph/schema.graphqls:23: Undefined directive shareable."

If I remove "@specifiedBy" from graph/schema.graphqls, or remove "@deprecated", or move declaration of scalar on the top, than I can see generated files without error.

### What did you expect?

I expect generated code without removing or moving declarations, because my contract is right.

### Minimal graphql.schema and models to reproduce

https://github.com/krupyansky/gqlgen-bug

### versions

https://github.com/krupyansky/gqlgen-bug

贡献指南

打开贡献指南

调研方向

问题位于 gqlgen 代码生成器中。首先检查 schema 解析逻辑,相关代码很可能位于 `graphql/introspection` 或 `codegen` 包中。该 bug 与指令顺序(`@specifiedBy`、`@deprecated`)以及标量声明有关。运行链接仓库中的复现用例,然后跟踪错误 'Undefined directive shareable.',以了解指令验证如何与标量定义交互。

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

评估

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

把新 issue 发到你的邮箱

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