Files
automatisch/packages/backend/src/graphql/mutations/update-current-user.ts
2023-08-03 19:39:48 +02:00

26 lines
480 B
TypeScript

import Context from '../../types/express/context';
type Params = {
input: {
email: string;
password: string;
fullName: string;
};
};
const updateCurrentUser = async (
_parent: unknown,
params: Params,
context: Context
) => {
const user = await context.currentUser.$query().patchAndFetch({
email: params.input.email,
password: params.input.password,
fullName: params.input.fullName,
});
return user;
};
export default updateCurrentUser;