def init_db(): # Create the fixtures user1 = User(firstname='Pjotr', lastname='Johannson') user1.save() user2 = User(firstname='Peter', lastname='Hanson') user2.save() user3 = User(firstname='Paul', lastname='Fredrikson') user3.save()
def mutate(self, info, user_data=None): user = UserModel(**user_data) user.save(force_insert=True) return CreateUser(user=user)