super bug

This commit is contained in:
2024-11-18 15:34:32 +07:00
parent 3430971449
commit 88941394eb
6 changed files with 186 additions and 382 deletions

View File

@@ -1,10 +1,5 @@
import { Inject, Injectable } from '@nestjs/common'
import {
Pothos,
PothosRef,
PothosSchema,
SchemaBuilderToken,
} from '@smatch-corp/nestjs-pothos'
import { Pothos, PothosRef, PothosSchema, SchemaBuilderToken } from '@smatch-corp/nestjs-pothos'
import { Builder } from '../Graphql/graphql.builder'
import { PrismaService } from '../Prisma/prisma.service'
import { ChatRoomType } from '@prisma/client'
@@ -58,6 +53,10 @@ export class ChatroomSchema extends PothosSchema {
meetingRoom: t.relation('meetingRoom', {
description: 'The meeting room.',
}),
lastActivity: t.expose('lastActivity', {
type: 'DateTime',
description: 'The last activity date and time.',
}),
}),
})
}
@@ -79,8 +78,7 @@ export class ChatroomSchema extends PothosSchema {
chatRooms: t.prismaField({
type: [this.chatRoom()],
description:
'Retrieve a list of chat rooms with optional filtering, ordering, and pagination.',
description: 'Retrieve a list of chat rooms with optional filtering, ordering, and pagination.',
args: this.builder.generator.findManyArgs('ChatRoom'),
resolve: async (query, _root, args, _ctx, _info) => {
return await this.prisma.chatRoom.findMany({