sdy

update User paretn resolver

......@@ -2,7 +2,13 @@ import { prisma } from "../../utils";
export default {
User: {
rooms: ({ id }) => prisma.user.findOne({ where: { id: id } }).rooms(),
messages: ({ id }) => prisma.user.findOne({ where: { id: id } }).messages(),
rooms: (parent) =>
prisma.user.findOne({ where: { id: parent.id } }).rooms(),
messages: (parent) =>
prisma.user.findOne({ where: { id: parent.id } }).messages(),
sender: (parent) =>
prisma.user.findOne({ where: { id: parent.id } }).sender(),
receiver: (parent) =>
prisma.user.findOne({ where: { id: parent.id } }).receiver(),
},
};
......