Hook up edit user flow
This commit is contained in:
@@ -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!
|
||||
}
|
||||
`
|
||||
|
||||
@@ -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 },
|
||||
|
||||
Reference in New Issue
Block a user