dotansimha/graphql-code-generator-community
Vedi su GitHubMissing generation of union types (typescript-type-graphql)
Open
#1398 aperta il 13 dic 2020
help wanted
Metriche repository
- Star
- (136 star)
- Metriche merge PR
- (Metriche PR in attesa)
Descrizione
Describe the bug
typescript-type-graphql plugin does not generate the necessary createUnionType function when generating a union type.
To Reproduce Steps to reproduce the behavior: Use a union type as a property of a document and generate using the typescript-type-graphql plugin.
https://codesandbox.io/s/strange-northcutt-ki24s?file=/types.ts
- My GraphQL schema:
type ALevel {
subject: ALevelSubject!
grade: ALevelGrade!
}
type BTEC {
subject: String!
grade: BTECGrade!
}
union Qualification = ALevel | BTEC
type Information {
qualifications: [Qualification!]!
}
- My
codegen.ymlconfig file:
overwrite: true
schema: './src/*.gql'
generates:
../graphql/src/qlModels.ts:
plugins:
- typescript-type-graphql
config:
namingConvention: keep
Expected behavior
a createUnionType function is generated for each union type.
Environment:
- OS: Ubuntu 20.04
@graphql-codegen/cli: 1.19.4@graphql-codegen/typescript-type-graphql: 1.18.2- NodeJS: 14.15.1