sdy

update seeProfile

1 type Query { 1 type Query {
2 - seeProfile(id: String!): User! 2 + seeProfile(email: String!): User!
3 } 3 }
......
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 };
......