#Value of enum changed after code generation
1 messages · Page 1 of 1 (latest)
hi @old ginkgo
let me make sure I understand :
you created a field of type option set, and you set all values in UpperCase
then you see the generated prisma schema in upper case, as expected
but the graphql API is using Pascal Case instead of all upper?
if that is the case - this is expected and by design
if you go to your server code and open the Enum decleration file you will see somethign like this
export enum QueryMode {
Default = "DEFAULT",
Insensitive = "INSENSITIVE",
}
the values should be uper case, but the typescript object that is also exposed in gql is following TS formatting
Hi Yuval
i used this file upload to amplication to generate entities directly, it went through , and generated code, but value of enum changed from COMPANY to Company
got it
ok, I understand
I will add this for review and see what we need to fix.
for a workaround, you can go to the imported entity, and change the values manually in the specific field
yes , i 'm doing it manuall right now. As our frontend code directly refer the prisma file to generate api calls.
do you know where i can find this setting: export enum QueryMode {
Default = "DEFAULT",
Insensitive = "INSENSITIVE",
}
look in the module folder under src
something line
src/organization/base/Enum[FieldName...]
got it