@@ -63,7 +63,7 @@ describe('Type System: build schema from introspection', () => {
6363 await testSchema ( schema ) ;
6464 } ) ;
6565
66- it ( 'builds a simple schema with both operation types' , async ( ) => {
66+ it ( 'builds a simple schema with all operation types' , async ( ) => {
6767 const queryType = new GraphQLObjectType ( {
6868 name : 'QueryType' ,
6969 description : 'This is a simple query type' ,
@@ -726,17 +726,18 @@ describe('Type System: build schema from introspection', () => {
726726
727727 } ) ;
728728
729- describe ( 'KP: very deep decorators are not supported' , ( ) => {
729+ describe ( 'very deep decorators are not supported' , ( ) => {
730730
731- it ( 'fails on very deep lists' , async ( ) => {
731+ it ( 'fails on very deep (> 7 levels) lists' , async ( ) => {
732732 const schema = new GraphQLSchema ( {
733733 query : new GraphQLObjectType ( {
734734 name : 'Query' ,
735735 fields : {
736736 foo : {
737737 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+ ) ) ) ) ) )
740741 }
741742 }
742743 } )
@@ -748,15 +749,16 @@ describe('Type System: build schema from introspection', () => {
748749 ) . to . throw ( 'Decorated type deeper than introspection query.' ) ;
749750 } ) ;
750751
751- it ( 'fails on a deep non-null' , async ( ) => {
752+ it ( 'fails on a very deep (> 7 levels) non-null' , async ( ) => {
752753 const schema = new GraphQLSchema ( {
753754 query : new GraphQLObjectType ( {
754755 name : 'Query' ,
755756 fields : {
756757 foo : {
757758 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+ ) ) ) ) ) )
760762 }
761763 }
762764 } )
@@ -768,6 +770,27 @@ describe('Type System: build schema from introspection', () => {
768770 ) . to . throw ( 'Decorated type deeper than introspection query.' ) ;
769771 } ) ;
770772
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+
771794 } ) ;
772795
773796} ) ;
0 commit comments