sdy

create Room parent resolver

1 +import { prisma } from "../../utils";
2 +
3 +export default {
4 + Room: {
5 + categories: (parent) =>
6 + prisma.room.findOne({ where: { id: parent.id } }).categories(),
7 + messages: (parent) =>
8 + prisma.room.findOne({ where: { id: parent.id } }).messages(),
9 + participants: (parent) =>
10 + prisma.room.findOne({ where: { id: parent.id } }).participants(),
11 + },
12 +};