|
1 | 1 | // @flow |
2 | | -import path from 'path' |
| 2 | +import path from "path" |
3 | 3 | const normalize = require(`normalize-path`) |
4 | | -import glob from 'glob' |
5 | | - |
6 | | -import { validate } from 'graphql' |
7 | | -import { IRTransforms } from 'relay-compiler' |
8 | | -import ASTConvert from 'relay-compiler/lib/ASTConvert' |
9 | | -import GraphQLCompilerContext from 'relay-compiler/lib/GraphQLCompilerContext' |
10 | | -import filterContextForNode from 'relay-compiler/lib/filterContextForNode' |
| 4 | +import glob from "glob" |
| 5 | + |
| 6 | +import { validate } from "graphql" |
| 7 | +import { IRTransforms } from "relay-compiler" |
| 8 | +import RelayParser from "relay-compiler/lib/RelayParser" |
| 9 | +import ASTConvert from "relay-compiler/lib/ASTConvert" |
| 10 | +import GraphQLCompilerContext from "relay-compiler/lib/GraphQLCompilerContext" |
| 11 | +import filterContextForNode from "relay-compiler/lib/filterContextForNode" |
11 | 12 | const _ = require(`lodash`) |
12 | 13 |
|
13 | | -import { store } from '../../redux' |
14 | | -import FileParser from './file-parser' |
15 | | -import GraphQLIRPrinter from 'relay-compiler/lib/GraphQLIRPrinter' |
| 14 | +import { store } from "../../redux" |
| 15 | +import FileParser from "./file-parser" |
| 16 | +import GraphQLIRPrinter from "relay-compiler/lib/GraphQLIRPrinter" |
16 | 17 | import { |
17 | 18 | graphqlError, |
18 | 19 | graphqlValidationError, |
19 | 20 | multipleRootQueriesError, |
20 | | -} from './graphql-errors' |
21 | | -import report from 'gatsby-cli/lib/reporter' |
| 21 | +} from "./graphql-errors" |
| 22 | +import report from "gatsby-cli/lib/reporter" |
22 | 23 |
|
23 | | -import type { DocumentNode, GraphQLSchema } from 'graphql' |
| 24 | +import type { DocumentNode, GraphQLSchema } from "graphql" |
24 | 25 |
|
25 | 26 | const { printTransforms } = IRTransforms |
26 | 27 |
|
@@ -125,7 +126,12 @@ class Runner { |
125 | 126 | let compilerContext = new GraphQLCompilerContext(this.schema) |
126 | 127 | try { |
127 | 128 | compilerContext = compilerContext.addAll( |
128 | | - ASTConvert.convertASTDocuments(this.schema, documents, validationRules) |
| 129 | + ASTConvert.convertASTDocuments( |
| 130 | + this.schema, |
| 131 | + documents, |
| 132 | + validationRules, |
| 133 | + RelayParser.transform.bind(RelayParser) |
| 134 | + ) |
129 | 135 | ) |
130 | 136 | } catch (error) { |
131 | 137 | this.reportError(graphqlError(namePathMap, nameDefMap, error)) |
|
0 commit comments