From 826ae7f952dcccd8bb8a7ade3d9f9c7540edcc06 Mon Sep 17 00:00:00 2001 From: Gunnar Schulze Date: Fri, 11 Aug 2023 11:30:11 +0200 Subject: [PATCH] Add support for fourfold nested lists in introspection (#3948) Closes #2643 --- src/utilities/__tests__/buildClientSchema-test.ts | 14 +++++++------- src/utilities/getIntrospectionQuery.ts | 8 ++++++++ 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/src/utilities/__tests__/buildClientSchema-test.ts b/src/utilities/__tests__/buildClientSchema-test.ts index 209943e18e..818198bf7b 100644 --- a/src/utilities/__tests__/buildClientSchema-test.ts +++ b/src/utilities/__tests__/buildClientSchema-test.ts @@ -877,10 +877,10 @@ describe('Type System: build schema from introspection', () => { }); describe('very deep decorators are not supported', () => { - it('fails on very deep (> 7 levels) lists', () => { + it('fails on very deep (> 8 levels) lists', () => { const schema = buildSchema(` type Query { - foo: [[[[[[[[String]]]]]]]] + foo: [[[[[[[[[[String]]]]]]]]]] } `); @@ -890,10 +890,10 @@ describe('Type System: build schema from introspection', () => { ); }); - it('fails on a very deep (> 7 levels) non-null', () => { + it('fails on a very deep (> 8 levels) non-null', () => { const schema = buildSchema(` type Query { - foo: [[[[String!]!]!]!] + foo: [[[[[String!]!]!]!]!] } `); @@ -903,11 +903,11 @@ describe('Type System: build schema from introspection', () => { ); }); - it('succeeds on deep (<= 7 levels) types', () => { - // e.g., fully non-null 3D matrix + it('succeeds on deep (<= 8 levels) types', () => { + // e.g., fully non-null 4D matrix const sdl = dedent` type Query { - foo: [[[String!]!]!]! + foo: [[[[String!]!]!]!]! } `; diff --git a/src/utilities/getIntrospectionQuery.ts b/src/utilities/getIntrospectionQuery.ts index 12c2aa6404..5eb182bc36 100644 --- a/src/utilities/getIntrospectionQuery.ts +++ b/src/utilities/getIntrospectionQuery.ts @@ -152,6 +152,14 @@ export function getIntrospectionQuery(options?: IntrospectionOptions): string { ofType { kind name + ofType { + kind + name + ofType { + kind + name + } + } } } }