Skip to content

Commit 687f8b8

Browse files
committed
chore: update
1 parent a2b641b commit 687f8b8

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/fieldsConverter.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff 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()

0 commit comments

Comments
 (0)