Skip to content

Commit

Permalink
tests(printSchema): test omitting schema of common names
Browse files Browse the repository at this point in the history
Extracted from #3362

Co-authored-by: spawnia <[email protected]>
  • Loading branch information
IvanGoncharov and spawnia committed Mar 28, 2022
1 parent def26e6 commit b3a97b9
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/utilities/__tests__/printSchema-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,22 @@ describe('Type System Printer', () => {
`);
});

it('Omits schema of common names', () => {
const schema = new GraphQLSchema({
query: new GraphQLObjectType({ name: 'Query', fields: {} }),
mutation: new GraphQLObjectType({ name: 'Mutation', fields: {} }),
subscription: new GraphQLObjectType({ name: 'Subscription', fields: {} }),
});

expectPrintedSchema(schema).to.equal(dedent`
type Query
type Mutation
type Subscription
`);
});

it('Prints custom query root types', () => {
const schema = new GraphQLSchema({
query: new GraphQLObjectType({ name: 'CustomType', fields: {} }),
Expand Down

0 comments on commit b3a97b9

Please sign in to comment.