def mutate(root, info, input=None): ok = True actor_instances = [] for c, i in enumerate(input): actor_instance = Actor(name=i.name) actor_instance.id = c + 100 actor_instances.append(actor_instance) # actor_instance.save() return CreateActors(ok=ok, actors=actor_instances)
def mutate(root, info, input=None): ok = True actor_instance = Actor(name=input.name) actor_instance.save() return CreateActor(ok=ok, actor=actor_instance)