Showing
2 changed files
with
10 additions
and
4 deletions
| 1 | -import { prisma } from "../../../utils"; | 1 | +import { prisma, isAuthenticated } from "../../../utils"; |
| 2 | 2 | ||
| 3 | export default { | 3 | export default { |
| 4 | Query: { | 4 | Query: { |
| 5 | - seeProfile: async (_, args) => { | 5 | + seeProfile: async (_, args, { request }) => { |
| 6 | - const { id } = args; | 6 | + isAuthenticated(request); |
| 7 | + const { email } = args; | ||
| 8 | + return prisma.user.findOne({ | ||
| 9 | + where: { | ||
| 10 | + email, | ||
| 11 | + }, | ||
| 12 | + }); | ||
| 7 | }, | 13 | }, |
| 8 | }, | 14 | }, |
| 9 | }; | 15 | }; | ... | ... |
-
Please register or login to post a comment