enum type error when snake case
See original GitHub issueI’m using v0.10.7 and having a issue with the casing in generated typescript types not matching.
schema:
enum color_name {
blue
red
white
}
type Query {
hello: color_name
}
generated types:
export interface Query {
hello?: ColorName | null; ### <- pascal case
}
export enum color_name { ### <- snake case
yello = "yello",
black = "black",
red = "red"
}
export namespace QueryResolvers {
export interface Resolvers<Context = any> {
hello?: HelloResolver<ColorName | null, any, Context>; ### <- pascal case
}
export type HelloResolver<
R = ColorName | null, #### <- pascal case
Parent = any,
Context = any
> = Resolver<R, Parent, Context>;
}
Issue Analytics
- State:
- Created 5 years ago
- Comments:8 (4 by maintainers)
Top Results From Across the Web
String enums in typescript - javascript - Stack Overflow
TypeScript enums are number based. You can use string literals with union types to mock a string based enum as in the CardinalDirection ......
Read more >Google C++ Style Guide
This section lists the main dos and don'ts you should follow when writing a class. Doing Work in Constructors. Avoid virtual method calls...
Read more >Safer Enums in Go - Three Dots Labs
Use camelCase , snake_case , or kebab-case . Slug are especially useful for error codes. An error response like {"error": "user-not-found"} ...
Read more >Case in convert_case - Rust - Docs.rs
Defines the type of casing a string can be. ... Enum convert_case::Case ... A camel case identifier myVarName is split where a lowercase...
Read more >Camel case vs. snake case: What's the difference?
Camel case and snake case are popular naming conventions, but they serve very ... and upper camel case for reference types such as...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Done! 0.11 is available now. @shinyaohira
@dotansimha I opened the issue #1297 . thank you.