graphqldoc
Version:
Generate GraphQL docs from schema.
20 lines (19 loc) • 702 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const utility_1 = require("../lib/utility");
class NavigationInterfaces extends utility_1.Plugin {
getTypes(buildForType) {
return this.document.types
.filter(type => type.kind === utility_1.INTERFACE)
.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('Interfaces', types)
];
}
}
exports.default = NavigationInterfaces;