1 | "use strict";
|
2 | Object.defineProperty(exports, "__esModule", { value: true });
|
3 | var graphql_1 = require("graphql");
|
4 | function 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 | }
|
18 | exports.getImplementingTypes = getImplementingTypes;
|
19 |
|
\ | No newline at end of file |