4
4
*
5
5
* This source code is licensed under the BSD-style license found in the
6
6
* LICENSE file in the root directory of this source tree. An additional grant
7
- * of patent rights can be found in the PATENTS file in the same directory.
7
+ * of patent rights can be found in the PATENTS file in the same directory.
8
8
*/
9
9
10
10
import { expect } from 'chai' ;
11
11
import { describe , it } from 'mocha' ;
12
12
import { parseSchema } from '../parser' ;
13
13
import { materializeSchema } from '../materializer' ;
14
14
import { printSchema } from '../../../type/printer' ;
15
- import { introspectionQuery } from '../../../type/introspectionQuery' ;
16
- import { graphql } from '../../../' ;
15
+ import { getIntrospectionResult } from '../printer' ;
17
16
18
17
// 80+ char lines are useful in describe/it, so ignore in this file.
19
18
/*eslint-disable max-len */
@@ -23,9 +22,7 @@ function printForTest(result) {
23
22
}
24
23
25
24
async function getOutput ( body , queryType ) {
26
- var doc = parseSchema ( body ) ;
27
- var schema = materializeSchema ( doc , queryType ) ;
28
- var result = await graphql ( schema , introspectionQuery ) ;
25
+ var result = await getIntrospectionResult ( body , queryType ) ;
29
26
return await printForTest ( result ) ;
30
27
}
31
28
@@ -272,6 +269,6 @@ type Hello {
272
269
}
273
270
` ;
274
271
var doc = parseSchema ( body ) ;
275
- expect ( ( ) => materializeSchema ( doc , 'Wat' ) ) . to . throw ( 'Type Wat not found in document' ) ;
272
+ expect ( ( ) => materializeSchema ( doc , 'Wat' ) ) . to . throw ( 'Specified query type Wat not found in document' ) ;
276
273
} ) ;
277
274
} ) ;
0 commit comments