"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const typeorm_1 = require("typeorm");
const entities_1 = require("../../../entities");
exports.startPublisher = {
    async startPublisher(_, { id, started }) {
        const repository = typeorm_1.getRepository(entities_1.Publisher);
        const publisher = await repository.findOne({ id }, {
            relations: ['datasource']
        });
        publisher.started = !!started;
        return await repository.save(publisher);
    }
};
//# sourceMappingURL=start-publisher.js.map