UNPKG

graphqldoc

Version:
20 lines (19 loc) 682 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const utility_1 = require("../lib/utility"); class NavigationEnums extends utility_1.Plugin { getTypes(buildForType) { return this.document.types .filter(type => type.kind === utility_1.ENUM) .map(type => new utility_1.NavigationItem(type.name, this.url(type), type.name === buildForType)); } getNavigations(buildForType) { const types = this.getTypes(buildForType); if (types.length === 0) return []; return [ new utility_1.NavigationSection('Enums', types) ]; } } exports.default = NavigationEnums;