1 | "use strict";
|
2 | Object.defineProperty(exports, "__esModule", { value: true });
|
3 | exports.getImplementingTypes = void 0;
|
4 | const graphql_1 = require("graphql");
|
5 | function getImplementingTypes(interfaceName, schema) {
|
6 | const allTypesMap = schema.getTypeMap();
|
7 | const result = [];
|
8 | for (const graphqlTypeName in allTypesMap) {
|
9 | const graphqlType = allTypesMap[graphqlTypeName];
|
10 | if ((0, graphql_1.isObjectType)(graphqlType)) {
|
11 | const allInterfaces = graphqlType.getInterfaces();
|
12 | if (allInterfaces.find(int => int.name === interfaceName)) {
|
13 | result.push(graphqlType.name);
|
14 | }
|
15 | }
|
16 | }
|
17 | return result;
|
18 | }
|
19 | exports.getImplementingTypes = getImplementingTypes;
|