99designs / 99designs/gqlgen

Add the directives that are called to the comment above the respective resolver function

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

描述

It would be helpful to see in the resolver files for which functions a directive is called.
I did not find the option of using templates or similar for the comment generation.

e.g.:
```graphql

...
type Query {
status: String! @adminRequired
}

directive @adminRequired on FIELD_DEFINITION
...
```

results in:

```golang
...
// Status is the resolver for the status field.
// @adminRequired
func (r *queryResolver) Status(ctx context.Context) (string, error) {
return "OK - GraphQL Running", nil
}
...
```

贡献指南

打开贡献指南

调研方向

查看 gqlgen 中的代码生成逻辑,可能是在 resolver 生成阶段。这个 issue 涉及将 directive 名称添加到生成的 resolver 函数上方的注释中。首先找到创建 resolver 注释的位置,然后修改实现,以包含来自 GraphQL schema 的 directive 信息。检查现有的 resolver 生成测试以了解输出格式,并为这一新功能添加测试。

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

评估

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

把新 issue 发到你的邮箱

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