1 | ;
|
2 |
|
3 | Object.defineProperty(exports, "__esModule", {
|
4 | value: true
|
5 | });
|
6 | exports.concatAST = concatAST;
|
7 |
|
8 | /**
|
9 | * Copyright (c) 2015-present, Facebook, Inc.
|
10 | *
|
11 | * This source code is licensed under the MIT license found in the
|
12 | * LICENSE file in the root directory of this source tree.
|
13 | *
|
14 | *
|
15 | */
|
16 |
|
17 | /**
|
18 | * Provided a collection of ASTs, presumably each from different files,
|
19 | * concatenate the ASTs together into batched AST, useful for validating many
|
20 | * GraphQL source files which together represent one conceptual application.
|
21 | */
|
22 | function concatAST(asts) {
|
23 | var batchDefinitions = [];
|
24 |
|
25 | for (var i = 0; i < asts.length; i++) {
|
26 | var definitions = asts[i].definitions;
|
27 |
|
28 | for (var j = 0; j < definitions.length; j++) {
|
29 | batchDefinitions.push(definitions[j]);
|
30 | }
|
31 | }
|
32 |
|
33 | return {
|
34 | kind: 'Document',
|
35 | definitions: batchDefinitions
|
36 | };
|
37 | } |
\ | No newline at end of file |