File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
packages/schema/src/plugins/enhancer/enhance Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -542,9 +542,13 @@ export function enhance(prisma: any, context?: EnhancementContext<${authTypePara
542542 // remove discriminator field from the create/update input because discriminator cannot be set directly
543543 const typeName = typeAlias . getName ( ) ;
544544
545- const concreteModelNames = delegateInfo . map ( ( [ _ , concretes ] ) => concretes . flatMap ( ( c ) => c . name ) ) ;
545+ const delegateModelNames = delegateInfo . map ( ( [ delegate ] ) => delegate . name ) ;
546+ const concreteModelNames = delegateInfo
547+ . map ( ( [ _ , concretes ] ) => concretes . flatMap ( ( c ) => c . name ) )
548+ . flatMap ( ( name ) => name ) ;
549+ const allModelNames = [ ...new Set ( [ ...delegateModelNames , ...concreteModelNames ] ) ] ;
546550 const concreteCreateUpdateInputRegex = new RegExp (
547- `^(${ concreteModelNames . join ( '|' ) } )(Unchecked)?(Create|Update).*Input$`
551+ `^(${ allModelNames . join ( '|' ) } )(Unchecked)?(Create|Update).*Input$`
548552 ) ;
549553
550554 const match = typeName . match ( concreteCreateUpdateInputRegex ) ;
You can’t perform that action at this time.
0 commit comments