feat: refactor update-current-user mutation with the REST API endpoint

This commit is contained in:
kasia.oczkowska
2024-09-27 11:48:59 +01:00
parent 5769c82fca
commit d3caadf4af
9 changed files with 180 additions and 77 deletions

View File

@@ -1,6 +1,5 @@
// Converted mutations
import verifyConnection from './mutations/verify-connection.js';
import updateCurrentUser from './mutations/update-current-user.js';
import generateAuthUrl from './mutations/generate-auth-url.js';
import resetConnection from './mutations/reset-connection.js';
import updateConnection from './mutations/update-connection.js';
@@ -9,7 +8,6 @@ const mutationResolvers = {
generateAuthUrl,
resetConnection,
updateConnection,
updateCurrentUser,
verifyConnection,
};

View File

@@ -1,11 +0,0 @@
const updateCurrentUser = async (_parent, params, 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;

View File

@@ -5,7 +5,6 @@ type Mutation {
generateAuthUrl(input: GenerateAuthUrlInput): AuthLink
resetConnection(input: ResetConnectionInput): Connection
updateConnection(input: UpdateConnectionInput): Connection
updateCurrentUser(input: UpdateCurrentUserInput): User
verifyConnection(input: VerifyConnectionInput): Connection
}
@@ -223,12 +222,6 @@ input UserRoleInput {
id: String
}
input UpdateCurrentUserInput {
email: String
password: String
fullName: String
}
"""
The `JSONObject` scalar type represents JSON objects as specified by [ECMA-404](http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-404.pdf).
"""