Пример #1
0
 def mutate(self, info, user_data):
     user = UserModel.objects(pk=user_data.user_id).get()
     user.firstname = user_data.firstname
     user.lastname = user_data.lastname
     user.save()
     return UpdateUser(user=user)
Пример #2
0
 def mutate(self, info, user_data):
     user = UserModel.objects(pk=user_data.user_id).get()
     user.delete()
     return DeleteUser(user=user)
Пример #3
0
 def resolve_user(self, info, userid=None):
     return UserModel.objects(pk=userid).get()