Hook up edit user flow

This commit is contained in:
Kurt Hutten
2020-11-05 21:06:40 +11:00
parent 249dbaba1a
commit 2b6af01767
5 changed files with 66 additions and 12 deletions

View File

@@ -35,6 +35,7 @@ export const schema = gql`
type Mutation {
createUser(input: CreateUserInput!): User!
updateUser(id: String!, input: UpdateUserInput!): User!
updateUserByUserName(userName: String!, input: UpdateUserInput!): User!
deleteUser(id: String!): User!
}
`

View File

@@ -29,6 +29,13 @@ export const updateUser = ({ id, input }) => {
})
}
export const updateUserByUserName = ({ userName, input }) => {
return db.user.update({
data: input,
where: { userName },
})
}
export const deleteUser = ({ id }) => {
return db.user.delete({
where: { id },