Skip to content

Commit faa42e2

Browse files
IvanGoncharovspawnia
andauthoredMar 28, 2022
tests(printSchema): test omitting schema of common names (#3524)
Co-authored-by: spawnia <benedikt@franke.tech>
1 parent def26e6 commit faa42e2

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed
 

‎src/utilities/__tests__/printSchema-test.ts

+16
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,22 @@ describe('Type System Printer', () => {
276276
`);
277277
});
278278

279+
it('Omits schema of common names', () => {
280+
const schema = new GraphQLSchema({
281+
query: new GraphQLObjectType({ name: 'Query', fields: {} }),
282+
mutation: new GraphQLObjectType({ name: 'Mutation', fields: {} }),
283+
subscription: new GraphQLObjectType({ name: 'Subscription', fields: {} }),
284+
});
285+
286+
expectPrintedSchema(schema).to.equal(dedent`
287+
type Query
288+
289+
type Mutation
290+
291+
type Subscription
292+
`);
293+
});
294+
279295
it('Prints custom query root types', () => {
280296
const schema = new GraphQLSchema({
281297
query: new GraphQLObjectType({ name: 'CustomType', fields: {} }),

0 commit comments

Comments
 (0)
Please sign in to comment.