1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 | 'use strict';
|
11 |
|
12 | function parseFile(baseDir, file) {
|
13 | var text = require("fs").readFileSync(require("path").join(baseDir, file.relPath), 'utf8');
|
14 |
|
15 | return require("graphql").parse(new (require("graphql").Source)(text, file.relPath), {
|
16 | experimentalFragmentVariables: true
|
17 | });
|
18 | }
|
19 |
|
20 | function getParser(baseDir) {
|
21 | return new (require("./ASTCache"))({
|
22 | baseDir: baseDir,
|
23 | parse: parseFile
|
24 | });
|
25 | }
|
26 |
|
27 | module.exports = {
|
28 | parseFile: parseFile,
|
29 | getParser: getParser
|
30 | }; |
\ | No newline at end of file |