From 18c7ca693456ba5f04a615180030d5b269642e10 Mon Sep 17 00:00:00 2001 From: Gunnar Schulze Date: Thu, 10 Aug 2023 21:54:26 +0200 Subject: [PATCH] Add support for fourfold nested lists in introspection --- 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 7d17811515..c6c619be42 100644 --- a/src/utilities/__tests__/buildClientSchema-test.ts +++ b/src/utilities/__tests__/buildClientSchema-test.ts @@ -879,10 +879,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]]]]]]]]]] } `); @@ -892,10 +892,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!]!]!]!]!] } `); @@ -905,11 +905,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 c21fe9a1bb..b58fb083e4 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 + } + } } } }