feat: Implement updateUser mutation

This commit is contained in:
Faruk AYDIN
2022-03-07 20:57:05 +03:00
committed by Ömer Faruk Aydın
parent 64011b5c4b
commit 212523aec6
3 changed files with 24 additions and 0 deletions

View File

@@ -0,0 +1,21 @@
import Context from '../../types/express/context';
type Params = {
email: string;
password: string;
};
const updateUser = async (
_parent: unknown,
params: Params,
context: Context
) => {
const user = await context.currentUser.$query().patchAndFetch({
email: params.email,
password: params.password,
});
return user;
};
export default updateUser;