UNPKG

701 BJavaScriptView Raw
1"use strict";
2Object.defineProperty(exports, "__esModule", { value: true });
3var graphql_1 = require("graphql");
4var rulesToIgnore = ['KnownFragmentNames', 'NoUnusedFragments', 'NoUnusedVariables', 'KnownDirectives'];
5var effectiveRules = graphql_1.specifiedRules.filter(function (f) { return !rulesToIgnore.includes(f.name); });
6exports.validateGraphQlDocuments = function (schema, documentFiles) {
7 return documentFiles
8 .map(function (result) { return ({
9 filePath: result.filePath,
10 errors: graphql_1.validate(schema, result.content, effectiveRules)
11 }); })
12 .filter(function (r) { return r.errors.length > 0; });
13};
14//# sourceMappingURL=validate-documents.js.map
\No newline at end of file