update create note
This commit is contained in:
2242
package-lock.json
generated
2242
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -28,7 +28,7 @@ export class AdminNoteSchema extends PothosSchema {
|
||||
content: t.exposeString('content', {
|
||||
description: 'The content of the admin note.',
|
||||
}),
|
||||
notedByUserId: t.exposeString('notedByUserId', {
|
||||
notedByUserId: t.exposeID('notedByUserId', {
|
||||
description: 'The ID of the user who created the admin note.',
|
||||
}),
|
||||
notedBy: t.relation('notedBy', {
|
||||
@@ -103,5 +103,24 @@ export class AdminNoteSchema extends PothosSchema {
|
||||
},
|
||||
}),
|
||||
}));
|
||||
|
||||
// Mutations
|
||||
this.builder.mutationFields((t) => ({
|
||||
createAdminNote: t.prismaField({
|
||||
type: this.adminNote(),
|
||||
args: {
|
||||
input: t.arg({
|
||||
type: this.builder.generator.getCreateInput('AdminNote'),
|
||||
required: true,
|
||||
}),
|
||||
},
|
||||
resolve: async (query, root, args, ctx, info) => {
|
||||
return await this.prisma.adminNote.create({
|
||||
...query,
|
||||
data: args.input,
|
||||
});
|
||||
},
|
||||
}),
|
||||
}));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user