UNPKG

graphqldoc

Version:
19 lines (18 loc) 664 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const utility_1 = require("../lib/utility"); class NavigationDirectives extends utility_1.Plugin { getTypes(buildForType) { return this.document.directives .map(directive => new utility_1.NavigationItem(directive.name, this.url(directive), directive.name === buildForType)); } getNavigations(buildForType) { const types = this.getTypes(buildForType); if (types.length === 0) return []; return [ new utility_1.NavigationSection('Directives', types) ]; } } exports.default = NavigationDirectives;