UNPKG

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