File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -26,7 +26,7 @@ type MongooseFieldT = {
2626 originalRequiredValue ?: string | ( ( ) => any ) ;
2727 isRequired ?: boolean ;
2828 defaultValue ?: any ;
29- enumValues ?: string [ ] ;
29+ enumValues ?: string [ ] | number [ ] ;
3030 schema ?: Schema ;
3131 _index ?: { [ optionName : string ] : any } ;
3232} ;
@@ -69,7 +69,7 @@ function _getFieldDescription(field: MongooseFieldT): string | undefined {
6969 return undefined ;
7070}
7171
72- function _getFieldEnums ( field : MongooseFieldT ) : string [ ] | undefined {
72+ function _getFieldEnums ( field : MongooseFieldT ) : string [ ] | number [ ] | undefined {
7373 if ( field . enumValues && field . enumValues . length > 0 ) {
7474 return field . enumValues ;
7575 }
@@ -394,6 +394,8 @@ export function enumToGraphQL(
394394 key = 'NULL' ;
395395 } else if ( value === '' ) {
396396 key = 'EMPTY_STRING' ;
397+ } else if ( typeof value === 'number' ) {
398+ key = value ;
397399 } else {
398400 key = value
399401 ?. toString ( )
You can’t perform that action at this time.
0 commit comments