Fixed build issues with prisma client and updated imports in app module for storage and grapghql
This commit is contained in:
parent
1059dd9fa8
commit
ef56213830
|
|
@ -1,4 +0,0 @@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Security Note: This project uses NestJS 11 and Prisma 7. Current npm audit reports are primarily linked to development-only CLI tools (@prisma/dev) and internal peer-dependency mismatches in the Express 5 ecosystem. No critical production-level vulnerabilities are currently unpatched in the core runtime.
|
|
||||||
|
|
@ -3,6 +3,10 @@
|
||||||
"collection": "@nestjs/schematics",
|
"collection": "@nestjs/schematics",
|
||||||
"sourceRoot": "src",
|
"sourceRoot": "src",
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"deleteOutDir": true
|
"deleteOutDir": true,
|
||||||
|
"assets": [
|
||||||
|
"generated/prisma/package.json"
|
||||||
|
],
|
||||||
|
"watchAssets": true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,37 @@
|
||||||
import { Module } from '@nestjs/common';
|
import { MiddlewareConsumer, Module, NestModule } from '@nestjs/common';
|
||||||
import { PrismaModule } from './common/prisma/prisma.module';
|
import { PrismaModule } from './common/prisma/prisma.module';
|
||||||
import { CasesModule } from './cases/cases.module';
|
import { CasesModule } from './cases/cases.module';
|
||||||
|
import { ConfigModule } from '@nestjs/config';
|
||||||
|
import { GraphQLModule } from '@nestjs/graphql';
|
||||||
|
import { ApolloDriver, ApolloDriverConfig } from '@nestjs/apollo';
|
||||||
|
import { join } from 'path';
|
||||||
|
import { StorageModule } from './common/storage/storage.module';
|
||||||
|
import { graphqlUploadExpress } from 'graphql-upload-ts';
|
||||||
|
|
||||||
|
|
||||||
@Module({
|
@Module({
|
||||||
imports: [PrismaModule, CasesModule],
|
imports: [
|
||||||
|
ConfigModule.forRoot({
|
||||||
|
isGlobal: true,
|
||||||
|
}),
|
||||||
|
GraphQLModule.forRoot<ApolloDriverConfig>({
|
||||||
|
driver: ApolloDriver,
|
||||||
|
autoSchemaFile: join(process.cwd(), 'src/schema.gql'),
|
||||||
|
sortSchema: true,
|
||||||
|
playground: true,
|
||||||
|
// Needed for uploads in Apollo v4
|
||||||
|
csrfPrevention: false,
|
||||||
|
}),
|
||||||
|
|
||||||
|
|
||||||
|
PrismaModule, CasesModule, StorageModule,],
|
||||||
controllers: [],
|
controllers: [],
|
||||||
providers: [],
|
providers: [],
|
||||||
})
|
})
|
||||||
export class AppModule {}
|
export class AppModule implements NestModule {
|
||||||
|
configure(consumer: MiddlewareConsumer) {
|
||||||
|
consumer
|
||||||
|
.apply(graphqlUploadExpress({ maxFileSize: 10000000, maxFiles: 1 }))
|
||||||
|
.forRoutes('graphql');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
import { PrismaClient } from '@db';
|
import { PrismaClient } from '../../generated/prisma/client.js';
|
||||||
import { Injectable, OnModuleInit, OnModuleDestroy } from '@nestjs/common';
|
import { Injectable, OnModuleInit, OnModuleDestroy } from '@nestjs/common';
|
||||||
import { ConfigService } from '@nestjs/config';
|
import { ConfigService } from '@nestjs/config';
|
||||||
import { PrismaPg } from '@prisma/adapter-pg';
|
import { PrismaPg } from '@prisma/adapter-pg';
|
||||||
|
|
|
||||||
|
|
@ -14,11 +14,7 @@
|
||||||
"sourceMap": true,
|
"sourceMap": true,
|
||||||
"outDir": "./dist",
|
"outDir": "./dist",
|
||||||
"baseUrl": "./",
|
"baseUrl": "./",
|
||||||
"paths": {
|
"paths": {},
|
||||||
"@db": [
|
|
||||||
"./src/generated/prisma/client.ts"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"incremental": true,
|
"incremental": true,
|
||||||
"skipLibCheck": true,
|
"skipLibCheck": true,
|
||||||
"strictNullChecks": true,
|
"strictNullChecks": true,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue