chimp
Version:
Your development companion for doing quality, faster.
20 lines (19 loc) • 727 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const tslib_1 = require("tslib");
const graphql_tag_1 = tslib_1.__importDefault(require("graphql-tag"));
exports.default = (graphqlString) => {
const graphqlAST = (0, graphql_tag_1.default) `
${graphqlString}
`;
return graphqlAST.definitions.filter((d) => d.kind === 'ScalarTypeDefinition')
.filter((d) => {
var _a;
const isPredefined = Boolean((_a = d.directives) === null || _a === void 0 ? void 0 : _a.find((directive) => {
return directive.name.value === 'predefined';
}));
return !isPredefined;
})
.map((f) => f.name.value)
.filter((s) => s !== 'Upload');
};