add centerstaff mutation
This commit is contained in:
@@ -63,20 +63,23 @@ export class UserSchema extends PothosSchema {
|
||||
});
|
||||
},
|
||||
}),
|
||||
// userByToken: t.prismaField({
|
||||
// type: this.user(),
|
||||
// args: this.builder.args({
|
||||
// oauthToken: t.arg.string({ required: true }),
|
||||
// }),
|
||||
// resolve: async (query, root, args, ctx, info) => {
|
||||
// // check if the token is valid
|
||||
// const { user } = await clerkClient.verifyToken
|
||||
// return await this.prisma.user.findFirst({
|
||||
// ...query,
|
||||
// where: args.where,
|
||||
// });
|
||||
// },
|
||||
// }),
|
||||
userBySession: t.prismaField({
|
||||
type: this.user(),
|
||||
args: {
|
||||
sessionId: t.arg({ type: 'String', required: true }),
|
||||
},
|
||||
resolve: async (query, root, args, ctx, info) => {
|
||||
// check if the token is valid
|
||||
const session = await clerkClient.sessions.getSession(args.sessionId);
|
||||
console.log(session);
|
||||
return await this.prisma.user.findFirst({
|
||||
...query,
|
||||
where: {
|
||||
id: session.userId,
|
||||
},
|
||||
});
|
||||
},
|
||||
}),
|
||||
}));
|
||||
|
||||
// Mutation section
|
||||
|
||||
Reference in New Issue
Block a user