UNPKG

616 BJavaScriptView Raw
1"use strict";
2
3Object.defineProperty(exports, "__esModule", {
4 value: true
5});
6exports.concatAST = concatAST;
7
8/**
9 * Provided a collection of ASTs, presumably each from different files,
10 * concatenate the ASTs together into batched AST, useful for validating many
11 * GraphQL source files which together represent one conceptual application.
12 */
13function concatAST(documents) {
14 var definitions = [];
15
16 for (var _i2 = 0; _i2 < documents.length; _i2++) {
17 var doc = documents[_i2];
18 definitions = definitions.concat(doc.definitions);
19 }
20
21 return {
22 kind: 'Document',
23 definitions: definitions
24 };
25}