merge change from db
This commit is contained in:
@@ -22,14 +22,21 @@ export class ManagedServiceSchema extends PothosSchema {
|
||||
return this.builder.prismaObject('ManagedService', {
|
||||
description: 'A managed service',
|
||||
fields: (t) => ({
|
||||
id: t.exposeID('id', {
|
||||
description: 'The ID of the managed service.',
|
||||
}),
|
||||
staffId: t.exposeID('staffId', {
|
||||
description: 'The ID of the staff member.',
|
||||
}),
|
||||
serviceId: t.exposeID('serviceId', {
|
||||
description: 'The ID of the service.',
|
||||
}),
|
||||
staff: t.relation('staff'),
|
||||
service: t.relation('service'),
|
||||
staff: t.relation('staff', {
|
||||
description: 'The staff member.',
|
||||
}),
|
||||
service: t.relation('service', {
|
||||
description: 'The service.',
|
||||
}),
|
||||
}),
|
||||
});
|
||||
}
|
||||
@@ -40,7 +47,7 @@ export class ManagedServiceSchema extends PothosSchema {
|
||||
managedService: t.field({
|
||||
type: this.managedService(),
|
||||
args: this.builder.generator.findUniqueArgs('ManagedService'),
|
||||
resolve: async (parent, args, context) => {
|
||||
resolve: async (parent, args, ctx) => {
|
||||
return this.prisma.managedService.findUnique({
|
||||
where: args.where,
|
||||
});
|
||||
@@ -50,7 +57,7 @@ export class ManagedServiceSchema extends PothosSchema {
|
||||
managedServices: t.field({
|
||||
type: [this.managedService()],
|
||||
args: this.builder.generator.findManyArgs('ManagedService'),
|
||||
resolve: async (parent, args, context) => {
|
||||
resolve: async (parent, args, ctx) => {
|
||||
return this.prisma.managedService.findMany({
|
||||
where: args.filter ?? undefined,
|
||||
orderBy: args.orderBy ?? undefined,
|
||||
|
||||
Reference in New Issue
Block a user