Skip to content

Commit af87956

Browse files
committed
Create test to ensure that 'schema' keyword maintained when schema has description
1 parent 3283f8a commit af87956

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

src/utilities/__tests__/printSchema-test.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1018,4 +1018,22 @@ describe('Type System Printer', () => {
10181018
const printed = printSchema(viralSchema);
10191019
expect(printed).to.equal(viralSDL);
10201020
});
1021+
it('prints schema with description and default root operation types correctly', () => {
1022+
const Query = new GraphQLObjectType({
1023+
name: 'Query',
1024+
fields: { a: { type: GraphQLInt } },
1025+
});
1026+
const schema = new GraphQLSchema({ query: Query, description: 'Test' });
1027+
const printed = printSchema(schema);
1028+
expect(printed).to.equal(dedent`
1029+
"""Test"""
1030+
schema {
1031+
query: Query
1032+
}
1033+
1034+
type Query {
1035+
a: Int
1036+
}
1037+
`);
1038+
});
10211039
});

0 commit comments

Comments
 (0)