

def create_ship(ship_name, faction_id):
    from .schema import Ship
    next_ship = (len(data['Ship'].keys()) + 1)
    new_ship = Ship(id=str(next_ship), name=ship_name)
    data['Ship'][new_ship.id] = new_ship
    data['Faction'][faction_id].ships.append(new_ship.id)
    return new_ship

dataset/ETHPy150Open graphql-python/graphene/docs/playground/examples/starwars_relay.schema.py create_ship/original