dotansimha / dotansimha/graphql-code-generator
Docs for oneOfInputUnion: true
- Dominant language
- TypeScript
- Stars
- 11.3k
- Forks
- 1.4k
- Avg merge
- 1d 1h
- Merged PRs (30d)
- 23
Description
### Is your feature request related to a problem? Please describe.
I've observed that `oneOfInputUnion: true` will change the code that gets generated.
```graphql
input YinOrYangInput @oneOf {
yin: YinConfig
yang: YangConfig
}
```
If you have this GraphQL schema, ordinarily you'll get the TS version:
```ts
export type YinOrYangInput = {
yin?: Maybe;
yang?: Maybe;
}
```
🔍👻 But if you add this mysterious `oneOfInputUnion: true` config, then the generated output changes to a union type:
```ts
export type YinOrYangInput =
| { yin: YinConfig, yang?: never }
| { yin?: never, yang: YangConfig }
```
### Describe the solution you'd like
From what I can tell, documentation for this config option is non-existent.
### Describe alternatives you've considered
_No response_
### Any additional important details?
_No response_
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.