"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.AdditionalApis = void 0;
const types_1 = require("../types");
class AdditionalApis {
    constructor() {
        this.additionalApis = [];
    }
    *[Symbol.iterator]() {
        for (const additionalApi of this.additionalApis)
            yield additionalApi;
    }
    get length() {
        return this.additionalApis.length;
    }
    get lengthMutations() {
        return this.additionalApis.filter(additionalApi => additionalApi.resolverType === types_1.ResolverType.MUTATION).length;
    }
    get lengthQueries() {
        return this.additionalApis.filter(additionalApi => additionalApi.resolverType === types_1.ResolverType.QUERY).length;
    }
    get mutations() {
        return this.additionalApis.filter(additionalApi => additionalApi.resolverType === types_1.ResolverType.MUTATION);
    }
    get queries() {
        return this.additionalApis.filter(additionalApi => additionalApi.resolverType === types_1.ResolverType.QUERY);
    }
    add(additionalApi) {
        this.additionalApis.push(additionalApi);
    }
    filter(fn) {
        return this.additionalApis.filter(fn);
    }
    toDto() {
        return this.additionalApis.map(additionalApi => additionalApi.toDto());
    }
}
exports.AdditionalApis = AdditionalApis;
