Add a property to the resolver config to allow for a full resolvergen configuration
- 主要语言
- Go
- 星标
- 10.8k
- 派生
- 1.3k
- 平均合并
- 2 天 36 分钟
- 30 天内合并 PR
- 26
描述
### What happened?
I need to be able to run gqlgen and pass in a template for generating a resolver.
I need to be able to pass in new imports and make significant code additions (maybe even some convenience methods). This will allow my implementing team to follow my guidlines.
### What did you expect?
I thought the config would have an option to just replace the whole gotpl file... it doesn't.
### Minimal graphql.schema and models to reproduce
```
type Query {
resolver: Resolver!
}
type Resolver {
name: String!
}
```
```
schema:
- "testdata/schema.graphql"
exec:
filename: testdata/singlefile/out/ignored.go
model:
filename: testdata/singlefile/out/generated.go
resolver:
type: CustomResolverType
layout: follow-schema
dir: testdata/resolvertemplate/out
filename_template: "{name}.resolvers.go"
resolver_template: "testdata/resolvertemplate/customResolverTemplate.gotpl"
models:
Resolver:
model: github.com/99designs/gqlgen/plugin/resolvergen/testdata/singlefile/out.Resolver
```
贡献指南
调研方向
查看代码库中的 resolvergen 插件配置,可能位于 plugin/resolvergen/config.go。了解当前模板系统的工作方式,以及需要在哪里添加 resolver_template 字段。检查 resolvergen 的现有测试,了解配置是如何验证和使用的。此更改涉及扩展配置结构体并更新模板加载逻辑。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- go
- 领域
- devtools
- Issue 类型
- 功能
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 活跃度
- 停滞
- 描述清晰度
- 基本清楚
- 新手友好度
- 35/100