nexus
nexus copied to clipboard
typegen generation corrupted with prisma>2.12 (with patch code workaround)
i found a general issue with nexus and prisma>2.12.
it s relatif to a breaking change, nexus is buggy from here breaking change happened with 2.12.0 https://github.com/prisma/prisma/issues/5573
i replaced some line in the file typegenautoconfig for a workaround
if (matched) {
const mymatch=(type)=>{
return [new RegExp(`\\*\\*${type.name}\\*\\* model`, 'g')];
}
const typeReg = mymatch(type);
const matched2 = firstMatch(fileContents,typeReg)
if (debug) {
if(matched2)
utils_1.log(`Matched type - ${typeName} in "${importPath}" - ${alias}.${matched[1]}`);
else
utils_1.log(`Matched type - ${typeName} in "${importPath}" - ${alias}.Prisma.${matched[1]}`);
}
importsMap[alias] = [importPath, glob];
sourceTypeMap[typeName] = (matched2)?`${alias}.${matched[1]}`:`${alias}.Prisma.${matched[1]}`;
}.
...