Refactor code structure and dependencies

This commit is contained in:
2024-09-29 22:52:30 +07:00
parent 88176bddc1
commit 7ce33c6c3a
8 changed files with 499 additions and 32 deletions

View File

@@ -6,14 +6,17 @@ import { PrismaService } from '../prisma/prisma.service';
import type PrismaTypes from '../types/pothos.generated';
import { getDatamodel } from '../types/pothos.generated';
export const prisma = new PrismaService({});
export const prisma = new PrismaService({
log: ['query', 'info', 'warn', 'error'],
errorFormat: 'pretty',
});
export const builder = new SchemaBuilder<{
Scalars: {
DateTime: {
Input: Date;
Output: Date;
};
Scalars: {
DateTime: {
Input: Date;
Output: Date;
};
};
PrismaTypes: PrismaTypes;
}>({
plugins: [PrismaPlugin, PrismaUtils],
@@ -25,4 +28,5 @@ export const builder = new SchemaBuilder<{
dmmf: getDatamodel(),
},
});
builder.addScalarType('DateTime', DateTimeResolver, {});