graphqldoc
Version:
Generate GraphQL docs from schema.
19 lines (18 loc) • 664 B
JavaScript
;
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;