graphql enum results in incorrect suggested model
jasonkuhrt opened this issue · 3 comments
jasonkuhrt commented
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
nunovieira commented
Given that schema, shouldn't the typescript be:
export type SomeEnum = 'A_VALUE' | 'ANOTHER_VALUE'
export interface SomeType {
someEnum: SomeEnum | null
someString: string | null
}
nunovieira commented
Looks like only scalar
fields are shown in the suggested model.
jasonkuhrt commented
@nunovieira Thanks, example fixed