"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.EquipmentAnalysisQuery = void 0;
const tslib_1 = require("tslib");
require("@things-factory/auth-base"); /* for Resolver Context */
const type_graphql_1 = require("type-graphql");
const shell_1 = require("@things-factory/shell");
const equipment_analysis_1 = require("./equipment-analysis");
const equipment_analysis_type_1 = require("./equipment-analysis-type");
let EquipmentAnalysisQuery = class EquipmentAnalysisQuery {
    async equipmentAnalysisById(id, context) {
        return await (0, shell_1.getRepository)(equipment_analysis_1.EquipmentAnalysis).findOne({
            where: { id }
        });
    }
    async equipmentAnalysis({ processId, type, name }, context) {
        return await (0, shell_1.getRepository)(equipment_analysis_1.EquipmentAnalysis).findOne({
            where: { processId, type, name }
        });
    }
};
exports.EquipmentAnalysisQuery = EquipmentAnalysisQuery;
tslib_1.__decorate([
    (0, type_graphql_1.Query)(returns => equipment_analysis_1.EquipmentAnalysis, { nullable: true, description: 'To fetch a Equipment Analysis' }),
    tslib_1.__param(0, (0, type_graphql_1.Arg)('id')),
    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)
], EquipmentAnalysisQuery.prototype, "equipmentAnalysisById", null);
tslib_1.__decorate([
    (0, type_graphql_1.Query)(returns => equipment_analysis_1.EquipmentAnalysis, {
        nullable: true,
        description: 'To fetch a Equipment Analysis by processId, type, and name'
    }),
    tslib_1.__param(0, (0, type_graphql_1.Args)()),
    tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
    tslib_1.__metadata("design:type", Function),
    tslib_1.__metadata("design:paramtypes", [equipment_analysis_type_1.EquipmentAnalysisArgs, Object]),
    tslib_1.__metadata("design:returntype", Promise)
], EquipmentAnalysisQuery.prototype, "equipmentAnalysis", null);
exports.EquipmentAnalysisQuery = EquipmentAnalysisQuery = tslib_1.__decorate([
    (0, type_graphql_1.Resolver)(equipment_analysis_1.EquipmentAnalysis)
], EquipmentAnalysisQuery);
//# sourceMappingURL=equipment-anlaysis-query.js.map