sdy

create getRoomByName resolver

1 +import { prisma, isAuthenticated } from "../../../utils";
2 +
3 +export default () => {
4 + Query: {
5 + getRoomByName: async (_, args, { request }) => {
6 + isAuthenticated(request);
7 + const { roomName } = args;
8 + return prisma.room.findOne({
9 + where: {
10 + name: roomName,
11 + },
12 + });
13 + };
14 + }
15 +};