Closed mdesousa closed 2 years ago
This is not always possible, e.g. a string union of 'yellow' | 'dark-blue'
can't be converted into a GraphQL union without transforming those strings (e.g. darkBlue
or darkblue
).
What is possible, is to add an option to try to convert into enums when all the strings are formed in an enum-compatible way.. I'll have a look at that!
Closing for now, might be possible to introduce some kind of programmatic transform function, but then the enums don't look the same. I suggest using string unions instead, which is compatible with TypeScript, JSON Schema and GraphQL.
Hi, this is a great library... thanks for creating it! We are running into an issue where we have types in json-schema defined as
Those should convert to an enum in GraphQL. However, it is converting into a union of a String.
Expected:
Received:
Thanks