"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.SunflowOverrideQuery = void 0;
const tslib_1 = require("tslib");
const type_graphql_1 = require("type-graphql");
const shell_1 = require("@things-factory/shell");
const board_service_1 = require("@things-factory/board-service");
const sunflow_override_model_1 = require("./sunflow-override-model");
let SunflowOverrideQuery = class SunflowOverrideQuery {
    async boardByNameSunflow(name, context) {
        const { domain } = context.state;
        return await (0, sunflow_override_model_1.getBoardByName)(name, domain.id);
    }
};
exports.SunflowOverrideQuery = SunflowOverrideQuery;
tslib_1.__decorate([
    (0, type_graphql_1.Query)(returns => board_service_1.Board, { nullable: true, description: 'To fetch a Board Model by name' }),
    (0, type_graphql_1.Directive)('@privilege(category: "board", privilege: "query", domainOwnerGranted: true)'),
    tslib_1.__param(0, (0, type_graphql_1.Arg)('name')),
    tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
    tslib_1.__metadata("design:type", Function),
    tslib_1.__metadata("design:paramtypes", [String, Object]),
    tslib_1.__metadata("design:returntype", Promise)
], SunflowOverrideQuery.prototype, "boardByNameSunflow", null);
exports.SunflowOverrideQuery = SunflowOverrideQuery = tslib_1.__decorate([
    (0, type_graphql_1.Resolver)(shell_1.Domain)
], SunflowOverrideQuery);
//# sourceMappingURL=sunflow-override-query.js.map