99designs / 99designs/gqlgen

Sharing input and output type schemas

Open
#3,057 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
10.8k
Forks
1.3k
Avg merge
2d 36m
Merged PRs (30d)
26

Description

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
}
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.