graphqlgen
graphqlgen copied to clipboard
graphql enum results in incorrect suggested model
Given schema:
type SomeType {
someEnum: SomeEnum
}
enum SomeEnum {
A_VALUE
ANOTHER_VALUE
}
graphqlgen suggests model (when no SomeType
model is supplied by user):
export interface SomeType {
someEnum: string | null
}
but, should be:
type SomeEnum =
| 'A_VALUE'
| 'ANOTHER_VALUE'
export interface SomeType {
someEnum: SomeEnum | null
}
related
- https://prisma.slack.com/archives/CDL1V8R2A/p1548342526024200
Given that schema, shouldn't the typescript be:
export type SomeEnum = 'A_VALUE' | 'ANOTHER_VALUE'
export interface SomeType {
someEnum: SomeEnum | null
someString: string | null
}
Looks like only scalar
fields are shown in the suggested model.
@nunovieira Thanks, example fixed