refactor source code
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { Global, Module } from '@nestjs/common';
|
||||
import { WorkshopSchema } from './workshop.schema';
|
||||
import { Global, Module } from '@nestjs/common'
|
||||
import { WorkshopSchema } from './workshop.schema'
|
||||
|
||||
@Global()
|
||||
@Module({
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
import { Inject, Injectable } from '@nestjs/common';
|
||||
import { Inject, Injectable } from '@nestjs/common'
|
||||
import {
|
||||
Pothos,
|
||||
PothosRef,
|
||||
PothosSchema,
|
||||
SchemaBuilderToken,
|
||||
} from '@smatch-corp/nestjs-pothos';
|
||||
import { Builder } from '../Graphql/graphql.builder';
|
||||
import { PrismaService } from '../Prisma/prisma.service';
|
||||
import { MinioService } from 'src/Minio/minio.service';
|
||||
} from '@smatch-corp/nestjs-pothos'
|
||||
import { Builder } from '../Graphql/graphql.builder'
|
||||
import { PrismaService } from '../Prisma/prisma.service'
|
||||
import { MinioService } from 'src/Minio/minio.service'
|
||||
|
||||
@Injectable()
|
||||
export class WorkshopSchema extends PothosSchema {
|
||||
@@ -16,7 +16,7 @@ export class WorkshopSchema extends PothosSchema {
|
||||
private readonly prisma: PrismaService,
|
||||
private readonly minioService: MinioService,
|
||||
) {
|
||||
super();
|
||||
super()
|
||||
}
|
||||
|
||||
@PothosRef()
|
||||
@@ -80,7 +80,7 @@ export class WorkshopSchema extends PothosSchema {
|
||||
description: 'The meeting room that the workshop is for.',
|
||||
}),
|
||||
}),
|
||||
});
|
||||
})
|
||||
}
|
||||
|
||||
@Pothos()
|
||||
@@ -94,7 +94,7 @@ export class WorkshopSchema extends PothosSchema {
|
||||
return await this.prisma.workshop.findUnique({
|
||||
...query,
|
||||
where: args.where,
|
||||
});
|
||||
})
|
||||
},
|
||||
}),
|
||||
|
||||
@@ -110,10 +110,10 @@ export class WorkshopSchema extends PothosSchema {
|
||||
take: args.take ?? undefined,
|
||||
orderBy: args.orderBy ?? undefined,
|
||||
where: args.filter ?? undefined,
|
||||
});
|
||||
})
|
||||
},
|
||||
}),
|
||||
}));
|
||||
}))
|
||||
|
||||
// Mutations section
|
||||
this.builder.mutationFields((t) => ({
|
||||
@@ -130,7 +130,7 @@ export class WorkshopSchema extends PothosSchema {
|
||||
return await this.prisma.workshop.create({
|
||||
...query,
|
||||
data: args.input,
|
||||
});
|
||||
})
|
||||
},
|
||||
}),
|
||||
|
||||
@@ -152,9 +152,9 @@ export class WorkshopSchema extends PothosSchema {
|
||||
...query,
|
||||
where: args.where,
|
||||
data: args.input,
|
||||
});
|
||||
})
|
||||
},
|
||||
}),
|
||||
}));
|
||||
}))
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user