"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.HasManyDirectiveSQLTransformer = void 0;
const resolvers_1 = require("../resolvers");
const utils_1 = require("../utils");
class HasManyDirectiveSQLTransformer {
    constructor(dbType) {
        this.prepare = (context, config) => {
            var _a, _b;
            const modelName = config.object.name.value;
            (0, resolvers_1.setFieldMappingResolverReference)(context, (_b = (_a = config.relatedType) === null || _a === void 0 ? void 0 : _a.name) === null || _b === void 0 ? void 0 : _b.value, modelName, config.field.name.value, true);
        };
        this.transformSchema = (context, config) => {
            (0, utils_1.validateParentReferencesFields)(config, context);
        };
        this.generateResolvers = (_context, _config) => {
            return;
        };
        this.validate = (context, config) => {
            (0, utils_1.ensureReferencesArray)(config);
            (0, utils_1.getReferencesNodes)(config, context);
        };
        this.dbType = dbType;
    }
}
exports.HasManyDirectiveSQLTransformer = HasManyDirectiveSQLTransformer;
//# sourceMappingURL=has-many-directive-sql-transformer.js.map