Showing
1 changed file
with
8 additions
and
2 deletions
... | @@ -2,7 +2,13 @@ import { prisma } from "../../utils"; | ... | @@ -2,7 +2,13 @@ import { prisma } from "../../utils"; |
2 | 2 | ||
3 | export default { | 3 | export default { |
4 | User: { | 4 | User: { |
5 | - rooms: ({ id }) => prisma.user.findOne({ where: { id: id } }).rooms(), | 5 | + rooms: (parent) => |
6 | - messages: ({ id }) => prisma.user.findOne({ where: { id: id } }).messages(), | 6 | + prisma.user.findOne({ where: { id: parent.id } }).rooms(), |
7 | + messages: (parent) => | ||
8 | + prisma.user.findOne({ where: { id: parent.id } }).messages(), | ||
9 | + sender: (parent) => | ||
10 | + prisma.user.findOne({ where: { id: parent.id } }).sender(), | ||
11 | + receiver: (parent) => | ||
12 | + prisma.user.findOne({ where: { id: parent.id } }).receiver(), | ||
7 | }, | 13 | }, |
8 | }; | 14 | }; | ... | ... |
-
Please register or login to post a comment