refactor source code
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { Module } from '@nestjs/common';
|
||||
import { WorkshopSubscriptionSchema } from './workshopsubscription.schema';
|
||||
import { Module } from '@nestjs/common'
|
||||
import { WorkshopSubscriptionSchema } from './workshopsubscription.schema'
|
||||
|
||||
@Module({
|
||||
providers: [WorkshopSubscriptionSchema],
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
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';
|
||||
} from '@smatch-corp/nestjs-pothos'
|
||||
import { Builder } from '../Graphql/graphql.builder'
|
||||
import { PrismaService } from '../Prisma/prisma.service'
|
||||
|
||||
@Injectable()
|
||||
export class WorkshopSubscriptionSchema extends PothosSchema {
|
||||
@@ -14,7 +14,7 @@ export class WorkshopSubscriptionSchema extends PothosSchema {
|
||||
@Inject(SchemaBuilderToken) private readonly builder: Builder,
|
||||
private readonly prisma: PrismaService,
|
||||
) {
|
||||
super();
|
||||
super()
|
||||
}
|
||||
@PothosRef()
|
||||
workshopSubscription() {
|
||||
@@ -39,7 +39,7 @@ export class WorkshopSubscriptionSchema extends PothosSchema {
|
||||
'The date and time the workshop subscription was created.',
|
||||
}),
|
||||
}),
|
||||
});
|
||||
})
|
||||
}
|
||||
|
||||
@Pothos()
|
||||
@@ -54,7 +54,7 @@ export class WorkshopSubscriptionSchema extends PothosSchema {
|
||||
return await this.prisma.workshopSubscription.findUnique({
|
||||
...query,
|
||||
where: args.where,
|
||||
});
|
||||
})
|
||||
},
|
||||
}),
|
||||
workshopSubscriptions: t.prismaField({
|
||||
@@ -69,9 +69,9 @@ export class WorkshopSubscriptionSchema extends PothosSchema {
|
||||
take: args.take ?? undefined,
|
||||
orderBy: args.orderBy ?? undefined,
|
||||
where: args.filter ?? undefined,
|
||||
});
|
||||
})
|
||||
},
|
||||
}),
|
||||
}));
|
||||
}))
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user