Showing
1 changed file
with
15 additions
and
0 deletions
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 | +}; |
-
Please register or login to post a comment