99designs / 99designs/gqlgen

Sharing input and output type schemas

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

描述

Is there a pattern or templating support to allow input and output types to share a consistent schema in the schema definition? I know that GraphQL doesn't natively support this but in some languages (TypeScript) people have worked around it using templating techniques.

Specifically when I want to ensure a consistent schema across an input and output types such as:

```
type WidgetConfig {
enableWidget1: Boolean!
enableWidget2: Boolean!
}

input WidgetConfigInput {
enableWidget1: Boolean!
enableWidget2: Boolean!
}

mutation {
configureWidget(config: WidgetConfigInput!): WidgetConfig
}
```

贡献指南

打开贡献指南

调研方向

查看 gqlgen 代码库中与 schema 生成和类型映射相关的部分,尤其关注输入类型和输出类型的处理。检查在 Go 中扩展 GraphQL schema 定义的现有模式。目标是提出一种在输入类型和输出类型之间共享 schema 的设计,可能通过模板化或代码生成技术实现。

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

评估

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

把新 issue 发到你的邮箱

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