feat: introduce gql schema sdl generation to the backend (#35)
* feat: introduce gql schema sdl generation to the backend * chore: update gql-codegen consumers to get schema from generated sdl * chore: hoppscotch-backend generates gql sdl on postinstall * fix: add back missed part of generate-gql-sdl script * chore: updated generate sdl script to hardcode whitelisted domains * chore: add prisma generate on postinstall script --------- Co-authored-by: ankitsridhar16 <ankit.sridhar16@gmail.com>
This commit is contained in:
@@ -3,6 +3,7 @@ import { json } from 'express';
|
||||
import { AppModule } from './app.module';
|
||||
import * as cookieParser from 'cookie-parser';
|
||||
import { VersioningType } from '@nestjs/common';
|
||||
import { emitGQLSchemaFile } from './gql-schema';
|
||||
|
||||
async function bootstrap() {
|
||||
console.log(`Running in production: ${process.env.PRODUCTION}`);
|
||||
@@ -38,4 +39,9 @@ async function bootstrap() {
|
||||
app.use(cookieParser());
|
||||
await app.listen(process.env.PORT || 3170);
|
||||
}
|
||||
bootstrap();
|
||||
|
||||
if (!process.env.GENERATE_GQL_SCHEMA) {
|
||||
bootstrap();
|
||||
} else {
|
||||
emitGQLSchemaFile();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user