update user schema

This commit is contained in:
2024-10-18 17:11:29 +07:00
parent 7714a0fb79
commit 8652c9e89a
3 changed files with 20 additions and 2 deletions

View File

@@ -35,6 +35,12 @@ export class UserSchema extends PothosSchema {
phoneNumber: t.exposeString('phoneNumber', {
description: 'The phone number of the user.',
}),
bankBin: t.exposeString('bankBin', {
description: 'The bank bin of the user.',
}),
bankAccountNumber: t.exposeString('bankAccountNumber', {
description: 'The bank account number of the user.',
}),
role: t.exposeString('role', {
description: 'The role of the user.',
}),
@@ -83,6 +89,18 @@ export class UserSchema extends PothosSchema {
@Pothos()
init(): void {
this.builder.queryFields((t) => ({
// me: t.prismaField({
// description: 'Retrieve the current user.',
// type: this.user(),
// resolve: async (query, root, args, ctx, info) => {
// const sessionId = ctx.req.headers.sessionId;
// const userId = await clerkClient.users.getUser()
// return await this.prisma.user.findUnique({
// where: { id: ctx.req.headers.authorization },
// });
// },
// }),
users: t.prismaField({
description:
'Retrieve a list of users with optional filtering, ordering, and pagination.',