update gi cung duoc

This commit is contained in:
2024-11-22 16:04:53 +07:00
parent d8a3894aba
commit ccfe7bf1f1
8 changed files with 41 additions and 11 deletions

View File

@@ -1,5 +1,10 @@
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'
@@ -57,6 +62,9 @@ export class ChatroomSchema extends PothosSchema {
type: 'DateTime',
description: 'The last activity date and time.',
}),
order: t.relation('Order', {
description: 'The order.',
}),
}),
})
}
@@ -78,7 +86,8 @@ 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({