Open dthyresson opened 2 years ago
If might be in the services.js
generator that scenarioFieldValue
checks in an enum, set the first value when it should instead check if an enum and array, then set an array of first value:
default: {
if (field.kind === 'enum' && field.enumValues[0]) {
return field.enumValues[0].dbName || field.enumValues[0].name
}
}
Will want to add tests for:
What's not working?
Service test and scenario generation for a string array field, sets string value instead of array for fields that are arrays of string and arrays of string enums.
How do we reproduce the bug?
Given the following model and enum in a Postgres database (for enum support),
and generating the sdl/service:
yarn rw g sdl Entity --force --crud
generates:
where all the string enum arrays (aka multiple enum values):
are incorrect.
In fact,
combinedStockSymbols
is justcombinedStockSymbols String[]
and is also incorrect.Setting to arrays of string, is valid:
Similar for scenarios:
What's your environment? (If it applies)
Are you interested in working on this?