UNPKG

@eddeee888/gcg-typescript-resolver-files

Version:

This [GraphQL Code Generator](https://www.the-guild.dev/graphql/codegen) plugin creates resolvers given GraphQL schema.

20 lines 881 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getImportStatementWithExpectedNamedImport = void 0; const getImportStatementWithExpectedNamedImport = (sourceFile, resolverFile) => { const importDeclaration = sourceFile.getImportDeclaration((declaration) => { let foundNamedImport = false; declaration.getNamedImports().forEach((namedImport) => { var _a; if (namedImport.getName() === ((_a = resolverFile.meta.resolverType) === null || _a === void 0 ? void 0 : _a.baseImport)) { foundNamedImport = true; } }); return foundNamedImport; }); return { importDeclaration, }; }; exports.getImportStatementWithExpectedNamedImport = getImportStatementWithExpectedNamedImport; //# sourceMappingURL=getImportStatementWithExpectedNamedImport.js.map