@@ -38,17 +38,27 @@ function cycleIntrospection(sdlString) {
38
38
const serverSchema = buildSchema ( sdlString ) ;
39
39
const initialIntrospection = introspectionFromSchema ( serverSchema ) ;
40
40
const clientSchema = buildClientSchema ( initialIntrospection ) ;
41
+ const secondIntrospection = introspectionFromSchema ( clientSchema ) ;
42
+
43
+ hackToRemoveStandardTypes ( secondIntrospection ) ;
44
+ hackToRemoveStandardTypes ( initialIntrospection ) ;
41
45
42
46
/**
43
47
* If the client then runs the introspection query against the client-side
44
48
* schema, it should get a result identical to what was returned by the server
45
49
*/
46
- const secondIntrospection = introspectionFromSchema ( clientSchema ) ;
47
50
expect ( secondIntrospection ) . to . deep . equal ( initialIntrospection ) ;
48
-
49
51
return printSchema ( clientSchema ) ;
50
52
}
51
53
54
+ // Temporary hack to remove always presented standard types should be removed in 15.0
55
+ function hackToRemoveStandardTypes ( introspection ) {
56
+ ( introspection . __schema : any ) . types = introspection . __schema . types . filter (
57
+ ( { name } ) =>
58
+ [ 'ID' , 'Float' , 'Int' , 'Boolean' , 'String' ] . indexOf ( name ) === - 1 ,
59
+ ) ;
60
+ }
61
+
52
62
describe ( 'Type System: build schema from introspection' , ( ) => {
53
63
it ( 'builds a simple schema' , ( ) => {
54
64
const sdl = dedent `
@@ -320,6 +330,9 @@ describe('Type System: build schema from introspection', () => {
320
330
const introspection = introspectionFromSchema ( schema ) ;
321
331
const clientSchema = buildClientSchema ( introspection ) ;
322
332
const secondIntrospection = introspectionFromSchema ( clientSchema ) ;
333
+
334
+ hackToRemoveStandardTypes ( secondIntrospection ) ;
335
+ hackToRemoveStandardTypes ( introspection ) ;
323
336
expect ( secondIntrospection ) . to . deep . equal ( introspection ) ;
324
337
325
338
const clientFoodEnum = clientSchema . getType ( 'Food' ) ;
0 commit comments