Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions src/utilities/__tests__/printSchema-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
`);
});
});
Loading