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