fix(index): detect enum field (#14298)
## Summary **What** — What changes are introduced in this PR? Fixes Enum fields detection on Index module
This commit is contained in:
committed by
GitHub
parent
a43eb11d65
commit
e199f1eb01
@@ -845,7 +845,9 @@ function processEntity(
|
||||
]
|
||||
intermediateEntityObjectRepresentationRef.moduleConfig =
|
||||
intermediateEntityModule
|
||||
if (!intermediateEntityObjectRepresentationRef.fields.includes("id")) {
|
||||
if (
|
||||
!intermediateEntityObjectRepresentationRef.fields.includes("id")
|
||||
) {
|
||||
intermediateEntityObjectRepresentationRef.fields.push("id")
|
||||
}
|
||||
|
||||
@@ -1185,7 +1187,10 @@ function buildSchemaFromFilterableLinks(
|
||||
const fieldType = fieldRef.type.toString()
|
||||
const isArray = fieldType.startsWith("[")
|
||||
let currentType = fieldType.replace(/\[|\]|\!/g, "")
|
||||
const isEnum = currentType.endsWith("Enum")
|
||||
const isEnum =
|
||||
fieldRef.type?.ofType?.astNode?.kind ===
|
||||
GraphQLUtils.Kind.ENUM_TYPE_DEFINITION
|
||||
|
||||
if (isEnum) {
|
||||
currentType = "String"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user