feat: new workspace apis (#2825)

This commit is contained in:
DarkSky
2023-06-26 22:12:58 +08:00
committed by GitHub
parent e3ffd04804
commit d46b6c4863
7 changed files with 341 additions and 0 deletions

View File

@@ -40,6 +40,18 @@ export class AuthResolver {
};
}
@Mutation(() => UserType)
async register(
@Context() ctx: { req: Request },
@Args('name') name: string,
@Args('email') email: string,
@Args('password') password: string
) {
const user = await this.auth.register(name, email, password);
ctx.req.user = user;
return user;
}
@Mutation(() => UserType)
async signIn(
@Context() ctx: { req: Request },