UNPKG

761 BJavaScriptView Raw
1"use strict";
2Object.defineProperty(exports, "__esModule", { value: true });
3var graphql_1 = require("graphql");
4function getImplementingTypes(interfaceName, schema) {
5 var allTypesMap = schema.getTypeMap();
6 var result = [];
7 for (var _i = 0, _a = Object.values(allTypesMap); _i < _a.length; _i++) {
8 var graphqlType = _a[_i];
9 if (graphqlType instanceof graphql_1.GraphQLObjectType) {
10 var allInterfaces = graphqlType.getInterfaces();
11 if (allInterfaces.find(function (int) { return int.name === interfaceName; })) {
12 result.push(graphqlType.name);
13 }
14 }
15 }
16 return result;
17}
18exports.getImplementingTypes = getImplementingTypes;
19//# sourceMappingURL=implementing-types.js.map
\No newline at end of file