This commit is contained in:
2024-10-20 19:29:54 +07:00
parent f49f3e51b1
commit 338cb84ac9
9 changed files with 7421 additions and 493 deletions

View File

@@ -63,7 +63,8 @@ export class ManagedServiceSchema extends PothosSchema {
}));
this.builder.mutationFields((t) => ({
createManagedService: t.field({
createManagedService: t.prismaField({
description: 'Create a new managed service.',
type: this.managedService(),
args: {
input: t.arg({
@@ -72,8 +73,9 @@ export class ManagedServiceSchema extends PothosSchema {
description: 'The data for the managed service.',
}),
},
resolve: async (parent, args, context) => {
return this.prisma.managedService.create({
resolve: async (query, root, args, ctx, info) => {
return await this.prisma.managedService.create({
...query,
data: args.input,
});
},