Skip to content

Commit

Permalink
Add support for fourfold nested lists in introspection
Browse files Browse the repository at this point in the history
  • Loading branch information
gschulze committed Aug 10, 2023
1 parent 3610786 commit 78834ca
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/utilities/__tests__/buildClientSchema-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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]]]]]]]]]]
}
`);

Expand All @@ -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!]!]!]!]!]
}
`);

Expand All @@ -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!]!]!]!]!
}
`;

Expand Down
8 changes: 8 additions & 0 deletions src/utilities/getIntrospectionQuery.ts
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,14 @@ export function getIntrospectionQuery(options?: IntrospectionOptions): string {
ofType {
kind
name
ofType {
kind
name
ofType {
kind
name
}
}
}
}
}
Expand Down

0 comments on commit 78834ca

Please sign in to comment.