phong bat

This commit is contained in:
2024-10-17 15:15:08 +07:00
parent 59923b02cb
commit 5c56e79d63
19 changed files with 456 additions and 145 deletions

View File

@@ -22,14 +22,30 @@ export class MessageSchema extends PothosSchema {
return this.builder.prismaObject('Message', {
description: 'A message in the system.',
fields: (t) => ({
id: t.exposeID('id'),
senderId: t.exposeID('senderId'),
chatRoomId: t.exposeID('chatRoomId'),
// eslint-disable-next-line @typescript-eslint/no-explicit-any
message: t.expose('message', { type: 'Json' as any }),
sentAt: t.expose('sentAt', { type: 'DateTime' }),
sender: t.relation('sender'),
chatRoom: t.relation('chatRoom'),
id: t.exposeID('id', {
description: 'The ID of the message.',
}),
senderId: t.exposeID('senderId', {
description: 'The ID of the sender.',
}),
chatRoomId: t.exposeID('chatRoomId', {
description: 'The ID of the chat room.',
}),
message: t.expose('message', {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
type: 'Json' as any,
description: 'The message content.',
}),
sentAt: t.expose('sentAt', {
type: 'DateTime',
description: 'The date and time the message was sent.',
}),
sender: t.relation('sender', {
description: 'The sender of the message.',
}),
chatRoom: t.relation('chatRoom', {
description: 'The chat room.',
}),
}),
});
}