push code push code
This commit is contained in:
@@ -20,6 +20,7 @@ export class ChatroomSchema extends PothosSchema {
|
||||
@PothosRef()
|
||||
chatRoom() {
|
||||
return this.builder.prismaObject('ChatRoom', {
|
||||
description: 'A chat room in the system.',
|
||||
fields: (t) => ({
|
||||
id: t.exposeID('id'),
|
||||
type: t.exposeString('type'),
|
||||
@@ -41,6 +42,7 @@ export class ChatroomSchema extends PothosSchema {
|
||||
this.builder.queryFields((t) => ({
|
||||
chatRoom: t.prismaField({
|
||||
type: this.chatRoom(),
|
||||
description: 'Retrieve a single chat room by its unique identifier.',
|
||||
args: this.builder.generator.findUniqueArgs('ChatRoom'),
|
||||
resolve: async (query, root, args, ctx, info) => {
|
||||
return await this.prisma.chatRoom.findUnique({
|
||||
@@ -52,6 +54,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.',
|
||||
args: this.builder.generator.findManyArgs('ChatRoom'),
|
||||
resolve: async (query, root, args, ctx, info) => {
|
||||
return await this.prisma.chatRoom.findMany({
|
||||
|
||||
Reference in New Issue
Block a user