@@ -63,7 +63,7 @@ describe('Type System: build schema from introspection', () => {
63
63
await testSchema ( schema ) ;
64
64
} ) ;
65
65
66
- it ( 'builds a simple schema with both operation types' , async ( ) => {
66
+ it ( 'builds a simple schema with all operation types' , async ( ) => {
67
67
const queryType = new GraphQLObjectType ( {
68
68
name : 'QueryType' ,
69
69
description : 'This is a simple query type' ,
@@ -726,17 +726,18 @@ describe('Type System: build schema from introspection', () => {
726
726
727
727
} ) ;
728
728
729
- describe ( 'KP: very deep decorators are not supported' , ( ) => {
729
+ describe ( 'very deep decorators are not supported' , ( ) => {
730
730
731
- it ( 'fails on very deep lists' , async ( ) => {
731
+ it ( 'fails on very deep (> 7 levels) lists' , async ( ) => {
732
732
const schema = new GraphQLSchema ( {
733
733
query : new GraphQLObjectType ( {
734
734
name : 'Query' ,
735
735
fields : {
736
736
foo : {
737
737
type : new GraphQLList ( new GraphQLList ( new GraphQLList (
738
- new GraphQLList ( GraphQLString )
739
- ) ) )
738
+ new GraphQLList ( new GraphQLList ( new GraphQLList (
739
+ new GraphQLList ( new GraphQLNonNull ( GraphQLString ) )
740
+ ) ) ) ) ) )
740
741
}
741
742
}
742
743
} )
@@ -748,15 +749,16 @@ describe('Type System: build schema from introspection', () => {
748
749
) . to . throw ( 'Decorated type deeper than introspection query.' ) ;
749
750
} ) ;
750
751
751
- it ( 'fails on a deep non-null' , async ( ) => {
752
+ it ( 'fails on a very deep (> 7 levels) non-null' , async ( ) => {
752
753
const schema = new GraphQLSchema ( {
753
754
query : new GraphQLObjectType ( {
754
755
name : 'Query' ,
755
756
fields : {
756
757
foo : {
757
758
type : new GraphQLList ( new GraphQLList ( new GraphQLList (
758
- new GraphQLNonNull ( GraphQLString )
759
- ) ) )
759
+ new GraphQLList ( new GraphQLList ( new GraphQLList (
760
+ new GraphQLList ( new GraphQLNonNull ( GraphQLString ) )
761
+ ) ) ) ) ) )
760
762
}
761
763
}
762
764
} )
@@ -768,6 +770,27 @@ describe('Type System: build schema from introspection', () => {
768
770
) . to . throw ( 'Decorated type deeper than introspection query.' ) ;
769
771
} ) ;
770
772
773
+ it ( 'succeeds on deep (<= 7 levels) types' , async ( ) => {
774
+ const schema = new GraphQLSchema ( {
775
+ query : new GraphQLObjectType ( {
776
+ name : 'Query' ,
777
+ fields : {
778
+ foo : {
779
+ // e.g., fully non-null 3D matrix
780
+ type : new GraphQLNonNull ( new GraphQLList (
781
+ new GraphQLNonNull ( new GraphQLList (
782
+ new GraphQLNonNull ( new GraphQLList (
783
+ new GraphQLNonNull ( GraphQLString )
784
+ ) ) ) ) ) )
785
+ }
786
+ }
787
+ } )
788
+ } ) ;
789
+
790
+ const introspection = await graphql ( schema , introspectionQuery ) ;
791
+ buildClientSchema ( introspection . data ) ;
792
+ } ) ;
793
+
771
794
} ) ;
772
795
773
796
} ) ;
0 commit comments