UNPKG

683 BJavaScriptView Raw
1"use strict";
2
3Object.defineProperty(exports, "__esModule", {
4 value: true
5});
6exports.concatAST = concatAST;
7
8var _flatMap = _interopRequireDefault(require("../polyfills/flatMap"));
9
10function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
11
12/**
13 * Provided a collection of ASTs, presumably each from different files,
14 * concatenate the ASTs together into batched AST, useful for validating many
15 * GraphQL source files which together represent one conceptual application.
16 */
17function concatAST(asts) {
18 return {
19 kind: 'Document',
20 definitions: (0, _flatMap.default)(asts, function (ast) {
21 return ast.definitions;
22 })
23 };
24}