From af87956acf4a44dfc318109e769f7dc99560a1b5 Mon Sep 17 00:00:00 2001 From: Benjie Gillam Date: Thu, 26 Jun 2025 18:04:56 +0100 Subject: [PATCH] Create test to ensure that 'schema' keyword maintained when schema has description --- src/utilities/__tests__/printSchema-test.ts | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/utilities/__tests__/printSchema-test.ts b/src/utilities/__tests__/printSchema-test.ts index b03e01026e..2dd10ef8d7 100644 --- a/src/utilities/__tests__/printSchema-test.ts +++ b/src/utilities/__tests__/printSchema-test.ts @@ -1018,4 +1018,22 @@ describe('Type System Printer', () => { const printed = printSchema(viralSchema); expect(printed).to.equal(viralSDL); }); + it('prints schema with description and default root operation types correctly', () => { + const Query = new GraphQLObjectType({ + name: 'Query', + fields: { a: { type: GraphQLInt } }, + }); + const schema = new GraphQLSchema({ query: Query, description: 'Test' }); + const printed = printSchema(schema); + expect(printed).to.equal(dedent` + """Test""" + schema { + query: Query + } + + type Query { + a: Int + } + `); + }); });