feat: Implement updateUser mutation
This commit is contained in:

committed by
Ömer Faruk Aydın

parent
64011b5c4b
commit
212523aec6
21
packages/backend/src/graphql/mutations/update-user.ts
Normal file
21
packages/backend/src/graphql/mutations/update-user.ts
Normal 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;
|
Reference in New Issue
Block a user