@@ -38,17 +38,26 @@ 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} ) => [ 'ID' , 'Float' , 'Int' , 'Boolean' , 'String' ] . indexOf ( name ) === - 1 ,
58
+ ) ;
59
+ }
60
+
52
61
describe ( 'Type System: build schema from introspection' , ( ) => {
53
62
it ( 'builds a simple schema' , ( ) => {
54
63
const sdl = dedent `
@@ -320,6 +329,9 @@ describe('Type System: build schema from introspection', () => {
320
329
const introspection = introspectionFromSchema ( schema ) ;
321
330
const clientSchema = buildClientSchema ( introspection ) ;
322
331
const secondIntrospection = introspectionFromSchema ( clientSchema ) ;
332
+
333
+ hackToRemoveStandardTypes ( secondIntrospection ) ;
334
+ hackToRemoveStandardTypes ( introspection ) ;
323
335
expect ( secondIntrospection ) . to . deep . equal ( introspection ) ;
324
336
325
337
const clientFoodEnum = clientSchema . getType ( 'Food' ) ;
0 commit comments